class SG_EXPORT osg::Light: public Object

Light state class which encapsulates OpenGL glLight() functionality

Inheritance:


Public Methods

[more] Light()
[more]static Light* instance()
return a static instance of an osg::Light, to be used as prototype for loading lights
[more]virtual Object* clone() const
return a shallow copy of a node, with Object* return type
[more]virtual bool isSameKindAs(Object* obj)
[more]virtual const char* className() const
return the name of the node's class type
[more]void on( void )
Turn the light on.
[more]void off( void )
Turn the light off.
[more]static void enable( void )
Enable OpenGL's Lighting mode.
[more]static void disable( void )
Disable OpenGL's Lighting mode.
[more]void apply( void )
Apply the light's state to the OpenGL state machine.
[more]void setAmbient( const Vec4& ambient )
Set the ambient component of the light.
[more]const Vec4& getAmbient() const
Get the ambient component of the light.
[more]void setDiffuse( const Vec4& diffuse )
Set the diffuse component of the light.
[more]const Vec4& getDiffuse() const
Get the diffuse component of the light.
[more]void setSpecular( const Vec4& specular )
Set the specular component of the light.
[more]const Vec4& getSpecular() const
Get the specular component of the light.
[more]void setPosition( const Vec4& position )
Set the position of the light.
[more]const Vec4& getPosition() const
Get the position of the light.
[more]void setDirection( const Vec3& direction )
Set the direction of the light.
[more]const Vec3& getDirection() const
Get the direction of the light.
[more]void setConstantAttenuation( float constant_attenuation )
Set the constant attenuation of the light.
[more]float setConstantAttenuation() const
Get the constant attenuation of the light.
[more]void setLinearAttenuation( float linear_attenuation )
Set the linear attenuation of the light.
[more]float getLinearAttenuation() const
Get the linear attenuation of the light.
[more]void setQuadraticAttenuation( float quadratic_attenuation )
Set the quadratic attenuation of the light.
[more]float getQuadraticAttenuation() const
Get the quadratic attenuation of the light.
[more]void setSpotExponent( float spot_exponent )
Set the spot exponent of the light.
[more]float getSpotExponent() const
Get the spot exponent of the light.
[more]void setSpotCutoff( float spot_cutoff )
Set the spot cutoff of the light.
[more]float getSpotCutoff()
Get the spot cutoff of the light.
[more]void captureLightState()
Capture the lighting settings of the current OpenGL state and store them in this object

Protected Fields

[more]int _lightnum
[more]bool _on
[more]Vec4 _ambient
[more]Vec4 _diffuse
[more]Vec4 _specular
[more]Vec4 _position
[more]Vec3 _direction
[more]float _constant_attenuation
[more]float _linear_attenuation
[more]float _quadratic_attenuation
[more]float _spot_exponent
[more]float _spot_cutoff
[more]static int _currentLightNum

Protected Methods

[more]virtual ~Light( void )
[more]void init( void )
Initialize the light's settings with some decent defaults.


Inherited from Object:

Public Methods

ovirtual Object* readClone(Input& fr)
ovirtual bool write(Output& fw)

Protected Methods

ovirtual bool readLocalData(Input&)
ovirtual bool writeLocalData(Output&)


Inherited from Referenced:

Public Methods

oReferenced& operator = (Referenced&)
ovoid ref()
ovoid unref()
oint referenceCount()

Protected Fields

oint _refCount


Documentation

Light state class which encapsulates OpenGL glLight() functionality
o Light()

ostatic Light* instance()
return a static instance of an osg::Light, to be used as prototype for loading lights

ovirtual Object* clone() const
return a shallow copy of a node, with Object* return type

ovirtual bool isSameKindAs(Object* obj)

ovirtual const char* className() const
return the name of the node's class type

ovoid on( void )
Turn the light on. Calling this method doesn't directly affect OpenGL's lighting mode.

ovoid off( void )
Turn the light off. Calling this method doesn't directly affect OpenGL's lighting mode.

ostatic void enable( void )
Enable OpenGL's Lighting mode.

ostatic void disable( void )
Disable OpenGL's Lighting mode.

ovoid apply( void )
Apply the light's state to the OpenGL state machine.

ovoid setAmbient( const Vec4& ambient )
Set the ambient component of the light.

oconst Vec4& getAmbient() const
Get the ambient component of the light.

ovoid setDiffuse( const Vec4& diffuse )
Set the diffuse component of the light.

oconst Vec4& getDiffuse() const
Get the diffuse component of the light.

ovoid setSpecular( const Vec4& specular )
Set the specular component of the light.

oconst Vec4& getSpecular() const
Get the specular component of the light.

ovoid setPosition( const Vec4& position )
Set the position of the light.

oconst Vec4& getPosition() const
Get the position of the light.

ovoid setDirection( const Vec3& direction )
Set the direction of the light.

oconst Vec3& getDirection() const
Get the direction of the light.

ovoid setConstantAttenuation( float constant_attenuation )
Set the constant attenuation of the light.

ofloat setConstantAttenuation() const
Get the constant attenuation of the light.

ovoid setLinearAttenuation( float linear_attenuation )
Set the linear attenuation of the light.

ofloat getLinearAttenuation() const
Get the linear attenuation of the light.

ovoid setQuadraticAttenuation( float quadratic_attenuation )
Set the quadratic attenuation of the light.

ofloat getQuadraticAttenuation() const
Get the quadratic attenuation of the light.

ovoid setSpotExponent( float spot_exponent )
Set the spot exponent of the light.

ofloat getSpotExponent() const
Get the spot exponent of the light.

ovoid setSpotCutoff( float spot_cutoff )
Set the spot cutoff of the light.

ofloat getSpotCutoff()
Get the spot cutoff of the light.

ovoid captureLightState()
Capture the lighting settings of the current OpenGL state and store them in this object

ovirtual ~Light( void )

ovoid init( void )
Initialize the light's settings with some decent defaults.

oint _lightnum

obool _on

oVec4 _ambient

oVec4 _diffuse

oVec4 _specular

oVec4 _position

oVec3 _direction

ofloat _constant_attenuation

ofloat _linear_attenuation

ofloat _quadratic_attenuation

ofloat _spot_exponent

ofloat _spot_cutoff

ostatic 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++.