/* SpotLight class An OpenSceneGraph viewer for pyVolution .sww files. copyright (C) 2004 Geoscience Australia */ #ifndef SPOTLIGHT_H #define SPOTLIGHT_H #include #include #include #include #include #include #include #include #include #include class SpotLight { public: SpotLight(osg::StateSet* rootStateSet, int num=0); virtual osg::Group* get(){ return _transform; } virtual void setPosition(osg::Vec3 v); virtual osg::Vec3f* getPosition(){ return _position; } void setSpotAngle( float degrees ); void setMatrix( osg::Matrixf matrix ){ _transform->setMatrix( matrix ); } void setAmbient( osg::Vec3f v ){ _light->setAmbient(osg::Vec4(v,1)); } void setDiffuse( osg::Vec3f v ){ _light->setDiffuse(osg::Vec4(v,1)); } const osg::Matrix getMatrix(){ return _transform->getMatrix(); } protected: osg::MatrixTransform* _transform; osg::Vec3* _position; osg::Vec3* _target; osg::Light* _light; osg::LightSource* _source; osg::Geode* _marker; osg::Cone* _shape; osg::Geometry* _geom; osg::StateSet* _stateset; virtual ~SpotLight(); }; #endif // SPOTLIGHT_H