class SG_EXPORT osg::Light

Light state class which encapsulates OpenGL glLight() functionality

Inheritance:


Public Methods

[more] Light()
[more] Light(const Light& light, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more] META_StateAttribute(Light, (Type)(LIGHT_0+_lightnum))
[more]virtual int compare(const StateAttribute& sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const
[more]void setLightNum(const int num)
Set which OpenGL light to operate on
[more]const int getLightNum() const
Get which OpenGL light this osg::Light operates on
[more]inline void setAmbient( const Vec4& ambient )
Set the ambient component of the light.
[more]inline const Vec4& getAmbient() const
Get the ambient component of the light.
[more]inline void setDiffuse( const Vec4& diffuse )
Set the diffuse component of the light.
[more]inline const Vec4& getDiffuse() const
Get the diffuse component of the light.
[more]inline void setSpecular( const Vec4& specular )
Set the specular component of the light.
[more]inline const Vec4& getSpecular() const
Get the specular component of the light.
[more]inline void setPosition( const Vec4& position )
Set the position of the light.
[more]inline const Vec4& getPosition() const
Get the position of the light.
[more]inline void setDirection( const Vec3& direction )
Set the direction of the light.
[more]inline const Vec3& getDirection() const
Get the direction of the light.
[more]inline void setConstantAttenuation( const float constant_attenuation )
Set the constant attenuation of the light.
[more]inline const float getConstantAttenuation() const
Get the constant attenuation of the light.
[more]inline void setLinearAttenuation( const float linear_attenuation )
Set the linear attenuation of the light.
[more]inline const float getLinearAttenuation() const
Get the linear attenuation of the light.
[more]inline void setQuadraticAttenuation( const float quadratic_attenuation )
Set the quadratic attenuation of the light.
[more]inline const float getQuadraticAttenuation() const
Get the quadratic attenuation of the light.
[more]inline void setSpotExponent( const float spot_exponent )
Set the spot exponent of the light.
[more]inline const float getSpotExponent() const
Get the spot exponent of the light.
[more]inline void setSpotCutoff( const float spot_cutoff )
Set the spot cutoff of the light.
[more]inline const float getSpotCutoff() const
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
[more]virtual void apply(State& state) const
Apply the light's state to the OpenGL state machine.

Protected Fields

[more]int _lightnum
[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

Protected Methods

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


Inherited from StateAttribute:

Public Methods

ovirtual Object* cloneType() const
ovirtual Object* clone(const CopyOp&) const
ovirtual bool isSameKindAs(const Object* obj) const
ovirtual const char* className() const
ovirtual const Type getType() const
obool operator < (const StateAttribute& rhs) const
obool operator == (const StateAttribute& rhs) const
obool operator != (const StateAttribute& rhs) const
ovirtual void compile(State&) const

Public Members

otypedef GLenum GLMode
otypedef unsigned int GLModeValue
otypedef unsigned int OverrideValue
oenum Values
otypedef unsigned int Type
oenum Types


Inherited from Object:

Public Methods

oinline void setDataVariance(const DataVariance dv)
oinline const DataVariance getDataVariance() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance


Inherited from Referenced:

Public Methods

oinline Referenced& operator = (Referenced&)
oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

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

o Light(const Light& light, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

o META_StateAttribute(Light, (Type)(LIGHT_0+_lightnum))

ovirtual int compare(const StateAttribute& sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const

ovoid setLightNum(const int num)
Set which OpenGL light to operate on

oconst int getLightNum() const
Get which OpenGL light this osg::Light operates on

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

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

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

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

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

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

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

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

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

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

oinline void setConstantAttenuation( const float constant_attenuation )
Set the constant attenuation of the light.

oinline const float getConstantAttenuation() const
Get the constant attenuation of the light.

oinline void setLinearAttenuation( const float linear_attenuation )
Set the linear attenuation of the light.

oinline const float getLinearAttenuation() const
Get the linear attenuation of the light.

oinline void setQuadraticAttenuation( const float quadratic_attenuation )
Set the quadratic attenuation of the light.

oinline const float getQuadraticAttenuation() const
Get the quadratic attenuation of the light.

oinline void setSpotExponent( const float spot_exponent )
Set the spot exponent of the light.

oinline const float getSpotExponent() const
Get the spot exponent of the light.

oinline void setSpotCutoff( const float spot_cutoff )
Set the spot cutoff of the light.

oinline const float getSpotCutoff() const
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 void apply(State& state) const
Apply the light's state to the OpenGL state machine.

ovirtual ~Light()

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

oint _lightnum

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


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.