16 #ifndef SURGSIM_GRAPHICS_OSGLIGHT_H 17 #define SURGSIM_GRAPHICS_OSGLIGHT_H 21 #include <unordered_map> 23 #include "SurgSim/Graphics/OsgRepresentation.h" 24 #include "SurgSim/Graphics/Light.h" 26 #include <osg/ref_ptr> 30 #pragma warning(disable:4250) 50 SURGSIM_STATIC_REGISTRATION(OsgLight);
62 explicit OsgLight(
const std::string& name);
67 bool setGroup(std::shared_ptr<SurgSim::Graphics::Group> group)
override;
69 void setLightGroupReference(
const std::string& name)
override;
71 std::string getLightGroupReference()
override;
73 std::shared_ptr<SurgSim::Graphics::Group> getGroup()
override;
83 void setConstantAttenuation(
double val)
override;
85 double getConstantAttenuation()
override;
87 void setLinearAttenuation(
double val)
override;
89 double getLinearAttenuation()
override;
91 void setQuadraticAttenuation(
double val)
override;
93 double getQuadraticAttenuation()
override;
97 void doUpdate(
double dt)
override;
100 void apply(osg::ref_ptr<osg::StateSet> stateSet);
103 void remove(osg::ref_ptr<osg::StateSet> stateSet);
111 CONSTANT_ATTENUATION,
113 QUADRATIC_ATTENUATION
117 std::shared_ptr<OsgGroup> m_group;
120 std::unordered_map<int, osg::ref_ptr<osg::Uniform>> m_uniforms;
125 double m_constantAttenuation;
126 double m_linearAttenuation;
127 double m_quadraticAttenuation;
131 osg::ref_ptr<osg::Light> m_light;
132 osg::ref_ptr<osg::LightSource> m_lightSource;
135 std::string m_groupReference;
138 #if defined(_MSC_VER) Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
Abstract interface for a light, a light needs to be assigned to a group to be active, only the members of this group will be considered to be lit by this light.
Definition: Light.h:48
OpenScenegraph implementation for the Light interface.
Definition: OsgLight.h:53
Definition: OsgLightTests.cpp:48
Definition: OsgImGuiHandler.h:8
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55