OpenSceneGraph
3.0.1
|
Light state class which encapsulates OpenGL glLight() functionality. More...
Public Member Functions | |
Light () | |
Light (unsigned int lightnum) | |
Light (const Light &light, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
virtual osg::Object * | cloneType () const |
Clone the type of an attribute, with Object* return type. | |
virtual osg::Object * | clone (const osg::CopyOp ©op) const |
Clone an attribute, with Object* return type. | |
virtual bool | isSameKindAs (const osg::Object *obj) const |
Return true if this and obj are of the same kind of object. | |
virtual const char * | libraryName () const |
Return the name of the attribute's library. | |
virtual const char * | className () const |
Return the name of the attribute's class type. | |
virtual Type | getType () const |
Return the Type identifier of the attribute's class type. | |
virtual int | compare (const StateAttribute &sa) const |
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. | |
virtual unsigned int | getMember () const |
Return the member identifier within the attribute's class type. | |
virtual bool | getModeUsage (StateAttribute::ModeUsage &usage) const |
Return the modes associated with this StateAttribute. | |
void | setLightNum (int num) |
Set which OpenGL light to operate on. | |
int | getLightNum () const |
Get which OpenGL light this osg::Light operates on. | |
void | setAmbient (const Vec4 &ambient) |
Set the ambient component of the light. | |
const Vec4 & | getAmbient () const |
Get the ambient component of the light. | |
void | setDiffuse (const Vec4 &diffuse) |
Set the diffuse component of the light. | |
const Vec4 & | getDiffuse () const |
Get the diffuse component of the light. | |
void | setSpecular (const Vec4 &specular) |
Set the specular component of the light. | |
const Vec4 & | getSpecular () const |
Get the specular component of the light. | |
void | setPosition (const Vec4 &position) |
Set the position of the light. | |
const Vec4 & | getPosition () const |
Get the position of the light. | |
void | setDirection (const Vec3 &direction) |
Set the direction of the light. | |
const Vec3 & | getDirection () const |
Get the direction of the light. | |
void | setConstantAttenuation (float constant_attenuation) |
Set the constant attenuation of the light. | |
float | getConstantAttenuation () const |
Get the constant attenuation of the light. | |
void | setLinearAttenuation (float linear_attenuation) |
Set the linear attenuation of the light. | |
float | getLinearAttenuation () const |
Get the linear attenuation of the light. | |
void | setQuadraticAttenuation (float quadratic_attenuation) |
Set the quadratic attenuation of the light. | |
float | getQuadraticAttenuation () const |
Get the quadratic attenuation of the light. | |
void | setSpotExponent (float spot_exponent) |
Set the spot exponent of the light. | |
float | getSpotExponent () const |
Get the spot exponent of the light. | |
void | setSpotCutoff (float spot_cutoff) |
Set the spot cutoff of the light. | |
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 void | apply (State &state) const |
Apply the light's state to the OpenGL state machine. | |
Protected Member Functions | |
virtual | ~Light () |
void | init () |
Initialize the light's settings with some decent defaults. | |
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 |
Light state class which encapsulates OpenGL glLight() functionality.
osg::Light::Light | ( | ) |
osg::Light::Light | ( | unsigned int | lightnum | ) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::Light::~Light | ( | ) | [protected, virtual] |
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::captureLightState | ( | ) |
Capture the lighting settings of the current OpenGL state and store them in this object.
virtual const char* osg::Light::className | ( | ) | const [inline, virtual] |
Return the name of the attribute's class type.
Reimplemented from 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 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 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_Types, and COMPARE_StateAttribute_Parameter.
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 | ( | StateAttribute::ModeUsage & | ) | const [inline, virtual] |
Return the modes associated with this StateAttribute.
Reimplemented from osg::StateAttribute.
References osg::StateAttribute::ModeUsage::usesMode(), and GL_LIGHT0.
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.
virtual Type osg::Light::getType | ( | ) | const [inline, virtual] |
Return the Type identifier of the attribute's class type.
Implements osg::StateAttribute.
void osg::Light::init | ( | ) | [protected] |
Initialize the light's settings with some decent defaults.
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.
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 | ) |
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.
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] |
![]() | Generated at Mon Oct 3 2011 12:39:42 for the OpenSceneGraph by doxygen 1.7.5. |