#include <OSGDirectionalLightBase.h>
Inheritance diagram for osg::DirectionalLightBase:

Public Types | |
| typedef DirectionalLightPtr | Ptr |
| enum | { DirectionFieldId = Inherited::NextFieldId, NextFieldId = DirectionFieldId + 1 } |
Public Member Functions | |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *SFVec3f * | getSFDirection (void) |
| Get the DirectionalLight::_sfDirection field. | |
| Vec3f & | getDirection (void) |
| Get the value of the DirectionalLight::_sfDirection field. | |
| const Vec3f & | getDirection (void) const |
| Get the value of the DirectionalLight::_sfDirection field. | |
Field Set | |
| *void | setDirection (const Vec3f &value) |
| Set the value of the DirectionalLight::_sfDirection 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) |
Copy | |
| *virtual FieldContainerPtr | shallowCopy (void) const |
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 | |
Construction | |
| *static DirectionalLightPtr | create (void) |
| create a new instance of the class | |
| static DirectionalLightPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Static Public Attributes | |
| static const osg::BitVector | DirectionFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| 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 BitVector | ParentsFieldMask = (1 << NodeCore::ParentsFieldId ) |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
Protected Member Functions | |
Constructors | |
| * | DirectionalLightBase (void) |
| DirectionalLightBase (const DirectionalLightBase &source) | |
Destructors | |
| *virtual | ~DirectionalLightBase (void) |
Sync | |
| *void | executeSyncImpl (DirectionalLightBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Protected Attributes | |
| LightChunkPtr | _pChunk |
Fields | |
| *SFVec3f | _sfDirection |
Private Types | |
| typedef Light | Inherited |
Private Member Functions | |
| void | operator= (const DirectionalLightBase &source) |
Static Private Attributes | |
| static FieldDescription * | _desc [] |
| DirectionalLight description. | |
| static FieldContainerType | _type |
Friends | |
| class | FieldContainer |
Definition at line 81 of file OSGDirectionalLightBase.h.
|
|
Reimplemented from osg::Light. Reimplemented in osg::DirectionalLight. Definition at line 85 of file OSGDirectionalLightBase.h. |
|
|
Reimplemented from osg::LightBase. Definition at line 90 of file OSGDirectionalLightBase.h. |
|
|
Reimplemented from osg::LightBase. Definition at line 92 of file OSGDirectionalLightBase.h. 00093 { 00094 DirectionFieldId = Inherited::NextFieldId, 00095 NextFieldId = DirectionFieldId + 1 00096 };
|
|
|
Definition at line 164 of file OSGDirectionalLightBase.cpp. 00164 : 00165 _sfDirection (Vec3f(0,0,1)), 00166 Inherited() 00167 { 00168 }
|
|
|
Definition at line 174 of file OSGDirectionalLightBase.cpp. 00174 : 00175 _sfDirection (source._sfDirection ), 00176 Inherited (source) 00177 { 00178 }
|
|
|
Definition at line 182 of file OSGDirectionalLightBase.cpp.
|
|
|
Reimplemented from osg::LightBase. Definition at line 58 of file OSGDirectionalLightBase.inl. References _type. Referenced by create(), and osg::DirectionalLight::initMethod(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 65 of file OSGDirectionalLightBase.inl. References _type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 106 of file OSGDirectionalLightBase.cpp. References _type. 00107 { 00108 return _type; 00109 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 111 of file OSGDirectionalLightBase.cpp. References _type. 00112 { 00113 return _type; 00114 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 126 of file OSGDirectionalLightBase.cpp. 00127 { 00128 return sizeof(DirectionalLight); 00129 }
|
|
|
Definition at line 101 of file OSGDirectionalLightBase.inl. References _sfDirection. 00102 { 00103 return &_sfDirection; 00104 }
|
|
|
Definition at line 109 of file OSGDirectionalLightBase.inl. References _sfDirection, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00110 { 00111 return _sfDirection.getValue(); 00112 }
|
|
|
Definition at line 116 of file OSGDirectionalLightBase.inl. References _sfDirection, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00117 { 00118 return _sfDirection.getValue(); 00119 }
|
|
|
Reimplemented in osg::DirectionalLight. Definition at line 123 of file OSGDirectionalLightBase.inl. References _sfDirection, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). Referenced by osg::DirectionalLight::setDirection(). 00124 { 00125 _sfDirection.setValue(value); 00126 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 188 of file OSGDirectionalLightBase.cpp. References _sfDirection, DirectionFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::LightBase::getBinSize(), and osg::FieldBits::NoField. 00189 { 00190 UInt32 returnValue = Inherited::getBinSize(whichField); 00191 00192 if(FieldBits::NoField != (DirectionFieldMask & whichField)) 00193 { 00194 returnValue += _sfDirection.getBinSize(); 00195 } 00196 00197 00198 return returnValue; 00199 }
|
|
||||||||||||
|
Reimplemented from osg::LightBase. Definition at line 201 of file OSGDirectionalLightBase.cpp. References _sfDirection, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::LightBase::copyToBin(), DirectionFieldMask, and osg::FieldBits::NoField. 00203 { 00204 Inherited::copyToBin(pMem, whichField); 00205 00206 if(FieldBits::NoField != (DirectionFieldMask & whichField)) 00207 { 00208 _sfDirection.copyToBin(pMem); 00209 } 00210 00211 00212 }
|
|
||||||||||||
|
Reimplemented from osg::LightBase. Definition at line 214 of file OSGDirectionalLightBase.cpp. References _sfDirection, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::LightBase::copyFromBin(), DirectionFieldMask, and osg::FieldBits::NoField. 00216 { 00217 Inherited::copyFromBin(pMem, whichField); 00218 00219 if(FieldBits::NoField != (DirectionFieldMask & whichField)) 00220 { 00221 _sfDirection.copyFromBin(pMem); 00222 } 00223 00224 00225 }
|
|
|
Definition at line 72 of file OSGDirectionalLightBase.inl. References osg::AttachmentContainerPtr::dcast(), getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and shallowCopy(). Referenced by osg::SimpleSceneManager::initialize(). 00073 { 00074 DirectionalLightPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = DirectionalLightPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
|
|
|
Definition at line 87 of file OSGDirectionalLightBase.inl. References osg::FieldContainer::newPtr(). 00088 { 00089 DirectionalLightPtr returnValue; 00090 00091 newPtr(returnValue); 00092 00093 return returnValue; 00094 }
|
|
|
Implements osg::FieldContainer. Definition at line 117 of file OSGDirectionalLightBase.cpp. References osg::FieldContainer::newPtr(). Referenced by create(). 00118 { 00119 DirectionalLightPtr returnValue; 00120 00121 newPtr(returnValue, dynamic_cast<const DirectionalLight *>(this)); 00122 00123 return returnValue; 00124 }
|
|
||||||||||||
|
Definition at line 228 of file OSGDirectionalLightBase.cpp. References _sfDirection, DirectionFieldMask, osg::LightBase::executeSyncImpl(), osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith(). Referenced by executeSync(). 00230 { 00231 00232 Inherited::executeSyncImpl(pOther, whichField); 00233 00234 if(FieldBits::NoField != (DirectionFieldMask & whichField)) 00235 _sfDirection.syncWith(pOther->_sfDirection); 00236 00237 00238 }
|
|
||||||||||||
|
Reimplemented from osg::LightBase. Definition at line 133 of file OSGDirectionalLightBase.cpp. References executeSyncImpl(). 00135 { 00136 this->executeSyncImpl((DirectionalLightBase *) &other, whichField); 00137 }
|
|
|
|
|
||||||||||||||||||||
|
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 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 46 of file OSGLight.inl. References osg::LightBase::setAmbient(). 00047 { 00048 Inherited::setAmbient(col); 00049 }
|
|
||||||||||||||||||||
|
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 }
|
|
|
Reimplemented from osg::LightBase. Definition at line 52 of file OSGLight.inl. References osg::LightBase::setDiffuse(). 00053 { 00054 Inherited::setDiffuse(col); 00055 }
|
|
||||||||||||||||||||
|
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 58 of file OSGLight.inl. References osg::LightBase::setSpecular(). 00059 { 00060 Inherited::setSpecular(col); 00061 }
|
|
|
Definition at line 93 of file OSGLight.cpp. References osg::Light::_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 osg::Light::_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 }
|
|
|
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 osg::Light::makeChunk(). 00133 { 00134 return _sfAmbient.getValue(); 00135 }
|
|
|
Definition at line 139 of file OSGLightBase.inl. References osg::LightBase::_sfAmbient, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00140 { 00141 return _sfAmbient.getValue(); 00142 }
|
|
|
Definition at line 153 of file OSGLightBase.inl. References osg::LightBase::_sfDiffuse, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by osg::Light::makeChunk(). 00154 { 00155 return _sfDiffuse.getValue(); 00156 }
|
|
|
Definition at line 160 of file OSGLightBase.inl. References osg::LightBase::_sfDiffuse, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00161 { 00162 return _sfDiffuse.getValue(); 00163 }
|
|
|
Definition at line 174 of file OSGLightBase.inl. References osg::LightBase::_sfSpecular, and osg::SField< Fiel |