Light state class which encapsulates OpenGL glLight() functionality
Inheritance:
Public Methods
-
Light()
-
virtual Object* clone() const
- return a shallow copy of a node, with Object* return type
-
virtual bool isSameKindAs(const Object* obj) const
- return true if this and obj are of the same kind of object
-
virtual const char* className() const
- return the name of the node's class type
-
virtual const Type getType() const
-
virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const
-
inline void on()
- Turn the light on.
-
inline void off()
- Turn the light off.
-
virtual void apply(State& state) const
- Apply the light's state to the OpenGL state machine.
-
inline void setAmbient( const Vec4& ambient )
- Set the ambient component of the light.
-
inline const Vec4& getAmbient() const
- Get the ambient component of the light.
-
inline void setDiffuse( const Vec4& diffuse )
- Set the diffuse component of the light.
-
inline const Vec4& getDiffuse() const
- Get the diffuse component of the light.
-
inline void setSpecular( const Vec4& specular )
- Set the specular component of the light.
-
inline const Vec4& getSpecular() const
- Get the specular component of the light.
-
inline void setPosition( const Vec4& position )
- Set the position of the light.
-
inline const Vec4& getPosition() const
- Get the position of the light.
-
inline void setDirection( const Vec3& direction )
- Set the direction of the light.
-
inline const Vec3& getDirection() const
- Get the direction of the light.
-
inline void setConstantAttenuation( const float constant_attenuation )
- Set the constant attenuation of the light.
-
inline const float getConstantAttenuation() const
- Get the constant attenuation of the light.
-
inline void setLinearAttenuation( const float linear_attenuation )
- Set the linear attenuation of the light.
-
inline const float getLinearAttenuation() const
- Get the linear attenuation of the light.
-
inline void setQuadraticAttenuation( const float quadratic_attenuation )
- Set the quadratic attenuation of the light.
-
inline const float getQuadraticAttenuation() const
- Get the quadratic attenuation of the light.
-
inline void setSpotExponent( const float spot_exponent )
- Set the spot exponent of the light.
-
inline const float getSpotExponent() const
- Get the spot exponent of the light.
-
inline void setSpotCutoff( const float spot_cutoff )
- Set the spot cutoff of the light.
-
inline const float getSpotCutoff() const
- Get the spot cutoff of the light.
-
void captureLightState()
- Capture the lighting settings of the current OpenGL state and store them in this object
Protected Fields
-
int _lightnum
-
bool _on
-
Vec4 _ambient
-
Vec4 _diffuse
-
Vec4 _specular
-
Vec4 _position
-
Vec3 _direction
-
float _constant_attenuation
-
float _linear_attenuation
-
float _quadratic_attenuation
-
float _spot_exponent
-
float _spot_cutoff
-
static int _currentLightNum
Protected Methods
-
virtual ~Light()
-
void init()
- Initialize the light's settings with some decent defaults.
Public Methods
-
virtual void compile(State&) const
Public Members
-
typedef GLenum GLMode
-
typedef unsigned int GLModeValue
-
typedef unsigned int OverrideValue
-
enum Values
-
enum Type
Inherited from Object:
Public Methods
-
inline Referenced& operator = (Referenced&)
-
inline void ref() const
-
inline void unref() const
-
inline const int referenceCount() const
Protected Fields
-
mutable int _refCount
Documentation
Light state class which encapsulates OpenGL glLight() functionality
- Light()
- virtual Object* clone() const
- return a shallow copy of a node, with Object* return type
- virtual bool isSameKindAs(const Object* obj) const
- return true if this and obj are of the same kind of object
- virtual const char* className() const
- return the name of the node's class type
- virtual const Type getType() const
- virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const
- inline void on()
-
Turn the light on.
Calling this method doesn't directly affect OpenGL's lighting mode.
- inline void off()
-
Turn the light off.
Calling this method doesn't directly affect OpenGL's lighting mode.
- virtual void apply(State& state) const
- Apply the light's state to the OpenGL state machine.
- inline void setAmbient( const Vec4& ambient )
- Set the ambient component of the light.
- inline const Vec4& getAmbient() const
- Get the ambient component of the light.
- inline void setDiffuse( const Vec4& diffuse )
- Set the diffuse component of the light.
- inline const Vec4& getDiffuse() const
- Get the diffuse component of the light.
- inline void setSpecular( const Vec4& specular )
- Set the specular component of the light.
- inline const Vec4& getSpecular() const
- Get the specular component of the light.
- inline void setPosition( const Vec4& position )
- Set the position of the light.
- inline const Vec4& getPosition() const
- Get the position of the light.
- inline void setDirection( const Vec3& direction )
- Set the direction of the light.
- inline const Vec3& getDirection() const
- Get the direction of the light.
- inline void setConstantAttenuation( const float constant_attenuation )
- Set the constant attenuation of the light.
- inline const float getConstantAttenuation() const
- Get the constant attenuation of the light.
- inline void setLinearAttenuation( const float linear_attenuation )
- Set the linear attenuation of the light.
- inline const float getLinearAttenuation() const
- Get the linear attenuation of the light.
- inline void setQuadraticAttenuation( const float quadratic_attenuation )
- Set the quadratic attenuation of the light.
- inline const float getQuadraticAttenuation() const
- Get the quadratic attenuation of the light.
- inline void setSpotExponent( const float spot_exponent )
- Set the spot exponent of the light.
- inline const float getSpotExponent() const
- Get the spot exponent of the light.
- inline void setSpotCutoff( const float spot_cutoff )
- Set the spot cutoff of the light.
- inline const float getSpotCutoff() const
- Get the spot cutoff of the light.
- void captureLightState()
-
Capture the lighting settings of the current OpenGL state
and store them in this object
- virtual ~Light()
- void init()
- Initialize the light's settings with some decent defaults.
- int _lightnum
- bool _on
- Vec4 _ambient
- Vec4 _diffuse
- Vec4 _specular
- Vec4 _position
- Vec3 _direction
- float _constant_attenuation
- float _linear_attenuation
- float _quadratic_attenuation
- float _spot_exponent
- float _spot_cutoff
- static int _currentLightNum
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.