osg::Light Class Reference

Inheritance diagram for osg::Light:

osg::StateAttribute osg::Object osg::Referenced List of all members.

Public Member Functions

 Light ()
 Light (const Light &light, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 META_StateAttribute (osg, Light, LIGHT)
virtual int compare (const StateAttribute &sa) const
virtual unsigned int getMember () const
virtual bool getModeUsage (ModeUsage &usage) const
void setLightNum (int num)
int getLightNum () const
void setAmbient (const Vec4 &ambient)
const Vec4getAmbient () const
void setDiffuse (const Vec4 &diffuse)
const Vec4getDiffuse () const
void setSpecular (const Vec4 &specular)
const Vec4getSpecular () const
void setPosition (const Vec4 &position)
const Vec4getPosition () const
void setDirection (const Vec3 &direction)
const Vec3getDirection () const
void setConstantAttenuation (float constant_attenuation)
float getConstantAttenuation () const
void setLinearAttenuation (float linear_attenuation)
float getLinearAttenuation () const
void setQuadraticAttenuation (float quadratic_attenuation)
float getQuadraticAttenuation () const
void setSpotExponent (float spot_exponent)
float getSpotExponent () const
void setSpotCutoff (float spot_cutoff)
float getSpotCutoff () const
void captureLightState ()
virtual void apply (State &state) const

Protected Member Functions

virtual ~Light ()
void init ()

Protected Attributes

int _lightnum
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

Detailed Description

Light state class which encapsulates OpenGL glLight() functionality.


Constructor & Destructor Documentation

osg::Light::Light (  ) 

osg::Light::Light ( const Light light,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
) [inline]

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::Light::~Light (  )  [protected, virtual]


Member Function Documentation

virtual void osg::Light::apply ( State state  )  const [virtual]

Apply the light's state to the OpenGL state machine.

Implements osg::StateAttribute.

void osg::Light::captureLightState (  ) 

Capture the lighting settings of the current OpenGL state and store them in this object.

virtual int osg::Light::compare ( const StateAttribute sa  )  const [inline, virtual]

Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

Implements osg::StateAttribute.

const Vec4& osg::Light::getAmbient (  )  const [inline]

Get the ambient component of the light.

float osg::Light::getConstantAttenuation (  )  const [inline]

Get the constant attenuation of the light.

const Vec4& osg::Light::getDiffuse (  )  const [inline]

Get the diffuse component of the light.

const Vec3& osg::Light::getDirection (  )  const [inline]

Get the direction of the light.

int osg::Light::getLightNum (  )  const [inline]

Get which OpenGL light this osg::Light operates on.

float osg::Light::getLinearAttenuation (  )  const [inline]

Get the linear attenuation of the light.

virtual unsigned int osg::Light::getMember (  )  const [inline, virtual]

Return the member identifier within the attribute's class type. Used for light number/clip plane number etc.

Reimplemented from osg::StateAttribute.

virtual bool osg::Light::getModeUsage ( ModeUsage &  usage  )  const [inline, virtual]

const Vec4& osg::Light::getPosition (  )  const [inline]

Get the position of the light.

float osg::Light::getQuadraticAttenuation (  )  const [inline]

Get the quadratic attenuation of the light.

const Vec4& osg::Light::getSpecular (  )  const [inline]

Get the specular component of the light.

float osg::Light::getSpotCutoff (  )  const [inline]

Get the spot cutoff of the light.

float osg::Light::getSpotExponent (  )  const [inline]

Get the spot exponent of the light.

void osg::Light::init (  )  [protected]

Initialize the light's settings with some decent defaults.

osg::Light::META_StateAttribute ( osg  ,
Light  ,
LIGHT   
)

void osg::Light::setAmbient ( const Vec4 ambient  )  [inline]

Set the ambient component of the light.

void osg::Light::setConstantAttenuation ( float  constant_attenuation  )  [inline]

Set the constant attenuation of the light.

void osg::Light::setDiffuse ( const Vec4 diffuse  )  [inline]

Set the diffuse component of the light.

void osg::Light::setDirection ( const Vec3 direction  )  [inline]

Set the direction of the light.

void osg::Light::setLightNum ( int  num  )  [inline]

Set which OpenGL light to operate on.

void osg::Light::setLinearAttenuation ( float  linear_attenuation  )  [inline]

Set the linear attenuation of the light.

void osg::Light::setPosition ( const Vec4 position  )  [inline]

Set the position of the light.

void osg::Light::setQuadraticAttenuation ( float  quadratic_attenuation  )  [inline]

Set the quadratic attenuation of the light.

void osg::Light::setSpecular ( const Vec4 specular  )  [inline]

Set the specular component of the light.

void osg::Light::setSpotCutoff ( float  spot_cutoff  )  [inline]

Set the spot cutoff of the light.

void osg::Light::setSpotExponent ( float  spot_exponent  )  [inline]

Set the spot exponent of the light.


Member Data Documentation

Vec4 osg::Light::_ambient [protected]

float osg::Light::_constant_attenuation [protected]

Vec4 osg::Light::_diffuse [protected]

Vec3 osg::Light::_direction [protected]

int osg::Light::_lightnum [protected]

float osg::Light::_linear_attenuation [protected]

Vec4 osg::Light::_position [protected]

float osg::Light::_quadratic_attenuation [protected]

Vec4 osg::Light::_specular [protected]

float osg::Light::_spot_cutoff [protected]

float osg::Light::_spot_exponent [protected]


The documentation for this class was generated from the following file:
Generated on Sun Oct 1 13:17:06 2006 for openscenegraph by  doxygen 1.4.7