osg::Light Class Reference

Inheritance diagram for osg::Light:

osg::StateAttribute osg::Object osg::Referenced

List of all members.

Public Member Functions

 Light ()
 Light (unsigned int lightnum)
 Light (const Light &light, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual osg::ObjectcloneType () const
virtual osg::Objectclone (const osg::CopyOp &copyop) const
virtual bool isSameKindAs (const osg::Object *obj) const
virtual const char * libraryName () const
virtual const char * className () const
virtual Type getType () const
virtual int compare (const StateAttribute &sa) const
virtual unsigned int getMember () const
virtual bool getModeUsage (StateAttribute::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 ( unsigned int  lightnum  ) 

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 osg::Object* osg::Light::cloneType (  )  const [inline, virtual]

Clone the type of an attribute, with Object* return type. Must be defined by derived classes.

Implements osg::StateAttribute.

virtual osg::Object* osg::Light::clone ( const osg::CopyOp  )  const [inline, virtual]

Clone an attribute, with Object* return type. Must be defined by derived classes.

Implements osg::StateAttribute.

virtual bool osg::Light::isSameKindAs ( const osg::Object obj  )  const [inline, virtual]

Return true if this and obj are of the same kind of object.

Reimplemented from osg::StateAttribute.

References NULL.

virtual const char* osg::Light::libraryName (  )  const [inline, virtual]

Return the name of the attribute's library.

Reimplemented from osg::StateAttribute.

virtual const char* osg::Light::className (  )  const [inline, virtual]

Return the name of the attribute's class type.

Reimplemented from osg::StateAttribute.

virtual Type osg::Light::getType (  )  const [inline, virtual]

Return the Type identifier of the attribute's class type.

Implements osg::StateAttribute.

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.

References COMPARE_StateAttribute_Parameter, and COMPARE_StateAttribute_Types.

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 ( StateAttribute::ModeUsage  )  const [inline, virtual]

Return the modes associated with this StateAttribute.

Reimplemented from osg::StateAttribute.

References osg::StateAttribute::ModeUsage::usesMode().

void osg::Light::setLightNum ( int  num  ) 

Set which OpenGL light to operate on.

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

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

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

Set the ambient component of the light.

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

Get the ambient component of the light.

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

Set the diffuse component of the light.

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

Get the diffuse component of the light.

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

Set the specular component of the light.

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

Get the specular component of the light.

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

Set the position of the light.

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

Get the position of the light.

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

Set the direction of the light.

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

Get the direction of the light.

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

Set the constant attenuation of the light.

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

Get the constant attenuation of the light.

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

Set the linear attenuation of the light.

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

Get the linear attenuation of the light.

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

Set the quadratic attenuation of the light.

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

Get the quadratic attenuation of the light.

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

Set the spot exponent of the light.

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

Get the spot exponent of the light.

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

Set the spot cutoff of the light.

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

Get the spot cutoff of the light.

void osg::Light::captureLightState (  ) 

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

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

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

Reimplemented from osg::StateAttribute.

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

Initialize the light's settings with some decent defaults.


Member Data Documentation

int osg::Light::_lightnum [protected]

float osg::Light::_spot_exponent [protected]

float osg::Light::_spot_cutoff [protected]


The documentation for this class was generated from the following file:

Generated on Wed Nov 17 16:52:49 2010 for openscenegraph by  doxygen 1.5.6