22 #define GL_LIGHT0 0x4000
23 #define GL_LIGHT1 0x4001
24 #define GL_LIGHT2 0x4002
25 #define GL_LIGHT3 0x4003
26 #define GL_LIGHT4 0x4004
27 #define GL_LIGHT5 0x4005
28 #define GL_LIGHT6 0x4006
29 #define GL_LIGHT7 0x4007
33 #define GL_LIGHTING 0x0B50
66 virtual const char*
className()
const {
return "Light"; }
#define GL_LIGHT0
Definition Light:22
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
Vec4f Vec4
Definition Vec4:21
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
void setAmbient(const Vec4 &ambient)
Set the ambient component of the light.
Definition Light:109
const Vec4 & getAmbient() const
Get the ambient component of the light.
Definition Light:112
Vec4 _position
Definition Light:188
float getSpotExponent() const
Get the spot exponent of the light.
Definition Light:160
float _spot_cutoff
Definition Light:194
void setLinearAttenuation(float linear_attenuation)
Set the linear attenuation of the light.
Definition Light:145
void setSpotCutoff(float spot_cutoff)
Set the spot cutoff of the light.
Definition Light:163
float _linear_attenuation
Definition Light:191
virtual int compare(const StateAttribute &sa) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition Light:70
virtual osg::Object * cloneType() const
Clone the type of an attribute, with Object* return type.
Definition Light:62
Vec3 _direction
Definition Light:189
const Vec4 & getDiffuse() const
Get the diffuse component of the light.
Definition Light:118
float _quadratic_attenuation
Definition Light:192
const Vec3 & getDirection() const
Get the direction of the light.
Definition Light:136
virtual const char * className() const
Return the name of the attribute's class type.
Definition Light:66
float getSpotCutoff() const
Get the spot cutoff of the light.
Definition Light:166
void setSpotExponent(float spot_exponent)
Set the spot exponent of the light.
Definition Light:157
float getQuadraticAttenuation() const
Get the quadratic attenuation of the light.
Definition Light:154
void init()
Initialize the light's settings with some decent defaults.
float _constant_attenuation
Definition Light:190
void setDirection(const Vec3 &direction)
Set the direction of the light.
Definition Light:133
int _lightnum
Definition Light:183
float getConstantAttenuation() const
Get the constant attenuation of the light.
Definition Light:142
virtual Type getType() const
Return the Type identifier of the attribute's class type.
Definition Light:67
Light(unsigned int lightnum)
void setQuadraticAttenuation(float quadratic_attenuation)
Set the quadratic attenuation of the light.
Definition Light:151
Vec4 _ambient
Definition Light:185
virtual void apply(State &state) const
Apply the light's state to the OpenGL state machine.
virtual bool getModeUsage(StateAttribute::ModeUsage &usage) const
Return the modes associated with this StateAttribute.
Definition Light:94
int getLightNum() const
Get which OpenGL light this osg::Light operates on.
Definition Light:106
virtual unsigned int getMember() const
Return the member identifier within the attribute's class type.
Definition Light:92
virtual const char * libraryName() const
Return the name of the attribute's library.
Definition Light:65
virtual osg::Object * clone(const osg::CopyOp ©op) const
Clone an attribute, with Object* return type.
Definition Light:63
virtual bool isSameKindAs(const osg::Object *obj) const
Return true if this and obj are of the same kind of object.
Definition Light:64
void setLightNum(int num)
Set which OpenGL light to operate on.
void captureLightState()
Capture the lighting settings of the current OpenGL state and store them in this object.
float _spot_exponent
Definition Light:193
void setSpecular(const Vec4 &specular)
Set the specular component of the light.
Definition Light:121
const Vec4 & getPosition() const
Get the position of the light.
Definition Light:130
const Vec4 & getSpecular() const
Get the specular component of the light.
Definition Light:124
float getLinearAttenuation() const
Get the linear attenuation of the light.
Definition Light:148
Light(const Light &light, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition Light:48
void setPosition(const Vec4 &position)
Set the position of the light.
Definition Light:127
Vec4 _specular
Definition Light:187
void setDiffuse(const Vec4 &diffuse)
Set the diffuse component of the light.
Definition Light:115
Vec4 _diffuse
Definition Light:186
void setConstantAttenuation(float constant_attenuation)
Set the constant attenuation of the light.
Definition Light:139
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Type
Type identifier to differentiate between different state types.
Definition StateAttribute:124
@ LIGHT
Definition StateAttribute:137
Definition StateAttribute:308
virtual void usesMode(GLMode mode)=0
#define NULL
Definition Export:55
#define OSG_EXPORT
Definition Export:39