#include <OSGLight.h>
Inheritance diagram for osg::Light:

Public Types | |
| typedef LightPtr | Ptr |
| enum | { AmbientFieldId = Inherited::NextFieldId, DiffuseFieldId = AmbientFieldId + 1, SpecularFieldId = DiffuseFieldId + 1, BeaconFieldId = SpecularFieldId + 1, OnFieldId = BeaconFieldId + 1, ConstantAttenuationFieldId = OnFieldId + 1, LinearAttenuationFieldId = ConstantAttenuationFieldId + 1, QuadraticAttenuationFieldId = LinearAttenuationFieldId + 1, NextFieldId = QuadraticAttenuationFieldId + 1 } |
Public Member Functions | |
Set | |
| *void | setAmbient (Real32 rRed, Real32 rGreen, Real32 rBlue, Real32 rAlpha) |
| void | setDiffuse (Real32 rRed, Real32 rGreen, Real32 rBlue, Real32 rAlpha) |
| void | setSpecular (Real32 rRed, Real32 rGreen, Real32 rBlue, Real32 rAlpha) |
| void | setAmbient (const Color4f &col) |
| Set the value of the Light::_sfAmbient field. | |
| void | setDiffuse (const Color4f &col) |
| Set the value of the Light::_sfDiffuse field. | |
| void | setSpecular (const Color4f &col) |
| Set the value of the Light::_sfSpecular field. | |
Chunk | |
| *LightChunkPtr | getChunk (void) |
| virtual void | makeChunk (void) |
Sync | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
Dump | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *SFColor4f * | getSFAmbient (void) |
| Get the Light::_sfAmbient field. | |
| SFColor4f * | getSFDiffuse (void) |
| Get the Light::_sfDiffuse field. | |
| SFColor4f * | getSFSpecular (void) |
| Get the Light::_sfSpecular field. | |
| SFNodePtr * | getSFBeacon (void) |
| Get the Light::_sfBeacon field. | |
| SFBool * | getSFOn (void) |
| Get the Light::_sfOn field. | |
| SFReal32 * | getSFConstantAttenuation (void) |
| Get the Light::_sfConstantAttenuation field. | |
| SFReal32 * | getSFLinearAttenuation (void) |
| Get the Light::_sfLinearAttenuation field. | |
| SFReal32 * | getSFQuadraticAttenuation (void) |
| Get the Light::_sfQuadraticAttenuation field. | |
| Color4f & | getAmbient (void) |
| Get the value of the Light::_sfAmbient field. | |
| const Color4f & | getAmbient (void) const |
| Get the value of the Light::_sfAmbient field. | |
| Color4f & | getDiffuse (void) |
| Get the value of the Light::_sfDiffuse field. | |
| const Color4f & | getDiffuse (void) const |
| Get the value of the Light::_sfDiffuse field. | |
| Color4f & | getSpecular (void) |
| Get the value of the Light::_sfSpecular field. | |
| const Color4f & | getSpecular (void) const |
| Get the value of the Light::_sfSpecular field. | |
| NodePtr & | getBeacon (void) |
| Get the value of the Light::_sfBeacon field. | |
| const NodePtr & | getBeacon (void) const |
| Get the value of the Light::_sfBeacon field. | |
| bool & | getOn (void) |
| Get the value of the Light::_sfOn field. | |
| const bool & | getOn (void) const |
| Get the value of the Light::_sfOn field. | |
| Real32 & | getConstantAttenuation (void) |
| Get the value of the Light::_sfConstantAttenuation field. | |
| const Real32 & | getConstantAttenuation (void) const |
| Get the value of the Light::_sfConstantAttenuation field. | |
| Real32 & | getLinearAttenuation (void) |
| Get the value of the Light::_sfLinearAttenuation field. | |
| const Real32 & | getLinearAttenuation (void) const |
| Get the value of the Light::_sfLinearAttenuation field. | |
| Real32 & | getQuadraticAttenuation (void) |
| Get the value of the Light::_sfQuadraticAttenuation field. | |
| const Real32 & | getQuadraticAttenuation (void) const |
| Get the value of the Light::_sfQuadraticAttenuation field. | |
Field Set | |
| void | setBeacon (const NodePtr &value) |
| Set the value of the Light::_sfBeacon field. | |
| void | setOn (const bool &value) |
| Set the value of the Light::_sfOn field. | |
| void | setConstantAttenuation (const Real32 &value) |
| Set the value of the Light::_sfConstantAttenuation field. | |
| void | setLinearAttenuation (const Real32 &value) |
| Set the value of the Light::_sfLinearAttenuation field. | |
| void | setQuadraticAttenuation (const Real32 &value) |
| Set the value of the Light::_sfQuadraticAttenuation field. | |
Binary Access | |
| *virtual UInt32 | getBinSize (const BitVector &whichField) |
| virtual void | copyToBin (BinaryDataHandler &pMem, const BitVector &whichField) |
| virtual void | copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField) |
Parents | |
| *MFNodePtr & | getParents (void) |
| const MFNodePtr & | getParents (void) const |
| MFNodePtr * | getMFParents (void) |
Volume | |
| *virtual void | invalidateVolume (void) |
Clone | |
| *virtual FieldContainerPtr | shallowCopy (void) const =0 |
Parents | |
| *MFNodePtr & | getParents (void) |
| const MFNodePtr & | getParents (void) const |
| MFNodePtr * | getMFParents (void) |
Volume | |
| *virtual void | invalidateVolume (void) |
Static Public Member Functions | |
Class Get | |
| *static FieldContainerType & | getClassType (void) |
| access the type of the class | |
| static UInt32 | getClassTypeId (void) |
| access the numerical type of the class | |
Static Public Attributes | |
| static const osg::BitVector | AmbientFieldMask |
| static const osg::BitVector | DiffuseFieldMask |
| static const osg::BitVector | SpecularFieldMask |
| static const osg::BitVector | BeaconFieldMask |
| static const osg::BitVector | OnFieldMask |
| static const osg::BitVector | ConstantAttenuationFieldMask |
| static const osg::BitVector | LinearAttenuationFieldMask |
| static const osg::BitVector | QuadraticAttenuationFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const BitVector | ParentsFieldMask = (1 << NodeCore::ParentsFieldId ) |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
CoredNodePtr helper | |
| *static const bool | isNodeCore = true |
CoredNodePtr helper | |
| *static const bool | isNodeCore = true |
Protected Types | |
| typedef LightBase | Inherited |
Protected Member Functions | |
Constructors | |
| * | Light (void) |
| Light (const Light &source) | |
Destructors | |
| *virtual | ~Light (void) |
Actions | |
| *Action::ResultE | drawEnter (Action *action) |
| Action::ResultE | drawLeave (Action *action) |
| Action::ResultE | renderEnter (Action *action) |
| Action::ResultE | renderLeave (Action *action) |
Sync | |
| *void | executeSyncImpl (LightBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Sync | |
| void | executeSyncImpl (NodeCore *pOther, const BitVector &whichField) |
MT Destruction | |
| *virtual void | onDestroy (void) |
Set / Get Parents | |
| *void | addParent (const NodePtr &parent) |
| void | subParent (const NodePtr &parent) |
Pointer | |
| *NodeCorePtr | getPtr (void) const |
Transformation | |
| *virtual void | accumulateMatrix (Matrix &result) |
Volume | |
| *virtual void | adjustVolume (Volume &volume) |
Sync | |
| void | executeSyncImpl (NodeCore *pOther, const BitVector &whichField) |
MT Destruction | |
| *virtual void | onDestroy (void) |
Set / Get Parents | |
| *void | addParent (const NodePtr &parent) |
| void | subParent (const NodePtr &parent) |
Pointer | |
| *NodeCorePtr | getPtr (void) const |
Protected Attributes | |
| LightChunkPtr | _pChunk |
Fields | |
| *SFColor4f | _sfAmbient |
| SFColor4f | _sfDiffuse |
| SFColor4f | _sfSpecular |
| SFNodePtr | _sfBeacon |
| SFBool | _sfOn |
| SFReal32 | _sfConstantAttenuation |
| SFReal32 | _sfLinearAttenuation |
| SFReal32 | _sfQuadraticAttenuation |
Fields | |
| *MFNodePtr | _parents |
Fields | |
| *MFNodePtr | _parents |
Private Member Functions | |
| void | operator= (const Light &source) |
| prohibit default function (move to 'public' if needed) | |
Static Private Member Functions | |
| static void | initMethod (void) |
| initialize the static features of the class, e.g. action callbacks | |
Friends | |
| class | FieldContainer |
| class | LightBase |
Definition at line 58 of file OSGLight.h.
|
|
Reimplemented from osg::LightBase. Reimplemented in osg::DirectionalLight, osg::DirectionalLightBase, osg::PointLight, osg::PointLightBase, osg::SpotLight, and osg::SpotLightBase. Definition at line 112 of file OSGLight.h. |
|
|
Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase. Definition at line 97 of file OSGLightBase.h. |
|
|
Reimplemented from osg::NodeCore. Definition at line 99 of file OSGLightBase.h. 00100 { 00101 AmbientFieldId = Inherited::NextFieldId, 00102 DiffuseFieldId = AmbientFieldId + 1, 00103 SpecularFieldId = DiffuseFieldId + 1, 00104 BeaconFieldId = SpecularFieldId + 1, 00105 OnFieldId = BeaconFieldId + 1, 00106 ConstantAttenuationFieldId = OnFieldId + 1, 00107 LinearAttenuationFieldId = ConstantAttenuationFieldId + 1, 00108 QuadraticAttenuationFieldId = LinearAttenuationFieldId + 1, 00109 NextFieldId = QuadraticAttenuationFieldId + 1 00110 };
|
|
|
Definition at line 131 of file OSGLight.cpp.
|
|
|
Definition at line 137 of file OSGLight.cpp.
|
|
|
Definition at line 146 of file OSGLight.cpp. References _pChunk, osg::NullFC, and osg::subRefCP().
|
|
||||||||||||||||||||
|
Definition at line 66 of file OSGLight.cpp. References osg::LightBase::_sfAmbient, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00070 { 00071 _sfAmbient.getValue().setValuesRGBA(rRed, rGreen, rBlue, rAlpha); 00072 }
|
|
||||||||||||||||||||
|
Definition at line 74 of file OSGLight.cpp. References osg::LightBase::_sfDiffuse, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00078 { 00079 _sfDiffuse.getValue().setValuesRGBA(rRed, rGreen, rBlue, rAlpha); 00080 }
|
|
||||||||||||||||||||
|
Definition at line 82 of file OSGLight.cpp. References osg::LightBase::_sfSpecular, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00086 { 00087 _sfSpecular.getValue().setValuesRGBA(rRed, rGreen, rBlue, rAlpha); 00088 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 46 of file OSGLight.inl. References osg::LightBase::setAmbient(). 00047 { 00048 Inherited::setAmbient(col); 00049 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 52 of file OSGLight.inl. References osg::LightBase::setDiffuse(). 00053 { 00054 Inherited::setDiffuse(col); 00055 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 58 of file OSGLight.inl. References osg::LightBase::setSpecular(). 00059 { 00060 Inherited::setSpecular(col); 00061 }
|
|
|
Definition at line 93 of file OSGLight.cpp. References _pChunk. Referenced by osg::RenderAction::dropLight(). 00094 { 00095 return _pChunk; 00096 }
|
|
|
Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 98 of file OSGLight.cpp. References _pChunk, osg::LightChunkBase::create(), osg::LightBase::getAmbient(), osg::LightBase::getDiffuse(), osg::LightBase::getSpecular(), and osg::NullFC. Referenced by osg::RenderAction::dropLight(), osg::PointLight::makeChunk(), and osg::DirectionalLight::makeChunk(). 00099 { 00100 if(_pChunk == NullFC) 00101 { 00102 _pChunk = LightChunk::create(); 00103 } 00104 00105 _pChunk->setAmbient (getAmbient ()); 00106 _pChunk->setDiffuse (getDiffuse ()); 00107 _pChunk->setSpecular(getSpecular()); 00108 }
|
|
||||||||||||
|
Reimplemented from osg::AttachmentContainer. Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 113 of file OSGLight.cpp. References osg::AttachmentContainer::changed(). Referenced by osg::PointLight::changed(), and osg::DirectionalLight::changed(). 00114 { 00115 Inherited::changed(whichField, origin); 00116 }
|
|
||||||||||||
|
Reimplemented from osg::NodeCore. Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 122 of file OSGLight.cpp. References osg::NodeCore::dump(). Referenced by osg::PointLight::dump(), and osg::DirectionalLight::dump(). 00124 { 00125 Inherited::dump(uiIndent, bvFlags); 00126 }
|
|
|
Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 155 of file OSGLight.cpp. References osg::LightBase::_sfAmbient, osg::LightBase::_sfConstantAttenuation, osg::LightBase::_sfDiffuse, osg::LightBase::_sfLinearAttenuation, osg::LightBase::_sfQuadraticAttenuation, osg::LightBase::_sfSpecular, osg::Action::Continue, osg::Action::getActNode(), osg::LightBase::getBeacon(), osg::DrawAction::getLightCount(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::TransformationMatrix< ValueTypeT >::getValues(), GLenum, osg::DrawAction::incLightCount(), osg::TransformationMatrix< ValueTypeT >::invert(), osg::TransformationMatrix< ValueTypeT >::mult(), osg::NullFC, osg::DrawActionBase::selectVisibles(), and SINFO. Referenced by osg::SpotLight::drawEnter(), osg::PointLight::drawEnter(), and osg::DirectionalLight::drawEnter(). 00156 { 00157 DrawAction *da = dynamic_cast<DrawAction *>(action); 00158 GLenum light = GL_LIGHT0 + da->getLightCount(); 00159 00160 da->incLightCount(); 00161 00162 glEnable (light); 00163 00164 glLightfv(light, GL_DIFFUSE , _sfDiffuse. getValue().getValuesRGBA()); 00165 glLightfv(light, GL_AMBIENT , _sfAmbient. getValue().getValuesRGBA()); 00166 glLightfv(light, GL_SPECULAR, _sfSpecular.getValue().getValuesRGBA()); 00167 00168 glLightf( light, 00169 GL_CONSTANT_ATTENUATION, 00170 _sfConstantAttenuation.getValue() ); 00171 glLightf( light, 00172 GL_LINEAR_ATTENUATION, 00173 _sfLinearAttenuation.getValue() ); 00174 glLightf( light, 00175 GL_QUADRATIC_ATTENUATION, 00176 _sfQuadraticAttenuation.getValue()); 00177 00178 // add the matrix to get into the beacon's coordinate system onto the stack 00179 00180 Matrix fromworld; 00181 Matrix tobeacon; 00182 00183 action->getActNode()->getToWorld(fromworld); 00184 fromworld.invert(); 00185 00186 NodePtr beacon = getBeacon(); 00187 00188 if(beacon == NullFC) 00189 { 00190 SINFO << "draw: no beacon set!" << std::endl; 00191 00192 glPushMatrix(); 00193 } 00194 else 00195 { 00196 getBeacon()->getToWorld(tobeacon); 00197 00198 tobeacon.mult(fromworld); 00199 00200 glPushMatrix(); 00201 glMultMatrixf(tobeacon.getValues()); 00202 } 00203 00204 da->selectVisibles(); 00205 00206 return Action::Continue; 00207 }
|
|
|
Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 209 of file OSGLight.cpp. References osg::Action::Continue, osg::DrawAction::decLightCount(), osg::DrawAction::getLightCount(), and GLenum. Referenced by osg::SpotLight::drawLeave(), osg::PointLight::drawLeave(), and osg::DirectionalLight::drawLeave(). 00210 { 00211 DrawAction *da = dynamic_cast<DrawAction *>(action); 00212 00213 da->decLightCount(); 00214 00215 GLenum light = GL_LIGHT0 + da->getLightCount(); 00216 00217 glDisable(light); 00218 00219 return Action::Continue; 00220 }
|
|
|
Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 225 of file OSGLight.cpp. References osg::Action::Continue, and osg::RenderAction::dropLight(). Referenced by osg::PointLight::renderEnter(), and osg::DirectionalLight::renderEnter(). 00226 { 00227 RenderAction *pAction = dynamic_cast<RenderAction *>(action); 00228 00229 pAction->dropLight(this); 00230 00231 return Action::Continue; 00232 }
|
|
|
Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 234 of file OSGLight.cpp. References osg::Action::Continue, and osg::RenderAction::undropLight(). Referenced by osg::SpotLight::renderLeave(), osg::PointLight::renderLeave(), and osg::DirectionalLight::renderLeave(). 00235 { 00236 RenderAction *pAction = dynamic_cast<RenderAction *>(action); 00237 00238 pAction->undropLight(this); 00239 00240 return Action::Continue; 00241 }
|
|
|
Reimplemented in osg::DirectionalLight, osg::PointLight, and osg::SpotLight. Definition at line 248 of file OSGLight.cpp.
|
|
|
|
|
|
Reimplemented from osg::NodeCore. Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase. Definition at line 58 of file OSGLightBase.inl. References osg::LightBase::_type. 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::NodeCore. Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase. Definition at line 65 of file OSGLightBase.inl. References osg::LightBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::NodeCore. Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase. Definition at line 183 of file OSGLightBase.cpp. References osg::LightBase::_type. 00184 { 00185 return _type; 00186 }
|
|
|
Reimplemented from osg::NodeCore. Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase. Definition at line 188 of file OSGLightBase.cpp. References osg::LightBase::_type. 00189 { 00190 return _type; 00191 }
|
|
|
Reimplemented from osg::NodeCore. Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase. Definition at line 194 of file OSGLightBase.cpp. 00195 { 00196 return sizeof(Light); 00197 }
|
|
|
Definition at line 75 of file OSGLightBase.inl. References osg::LightBase::_sfAmbient. 00076 { 00077 return &_sfAmbient; 00078 }
|
|
|
Definition at line 82 of file OSGLightBase.inl. References osg::LightBase::_sfDiffuse. 00083 { 00084 return &_sfDiffuse; 00085 }
|
|
|
Definition at line 89 of file OSGLightBase.inl. References osg::LightBase::_sfSpecular. 00090 { 00091 return &_sfSpecular; 00092 }
|
|
|
Definition at line 96 of file OSGLightBase.inl. References osg::LightBase::_sfBeacon. 00097 { 00098 return &_sfBeacon; 00099 }
|
|
|
Definition at line 103 of file OSGLightBase.inl. References osg::LightBase::_sfOn. 00104 { 00105 return &_sfOn; 00106 }
|
|
|
Definition at line 110 of file OSGLightBase.inl. References osg::LightBase::_sfConstantAttenuation. 00111 { 00112 return &_sfConstantAttenuation; 00113 }
|
|
|
Definition at line 117 of file OSGLightBase.inl. References osg::LightBase::_sfLinearAttenuation. 00118 { 00119 return &_sfLinearAttenuation; 00120 }
|
|
|
Definition at line 124 of file OSGLightBase.inl. References osg::LightBase::_sfQuadraticAttenuation. 00125 { 00126 return &_sfQuadraticAttenuation; 00127 }
|
|
|
Definition at line 132 of file OSGLightBase.inl. References osg::LightBase::_sfAmbient, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by makeChunk(). 00133 { 00134 return _sfAmbient.getValue(); 00135 }
|
|
|
|