The light class is used to initialise, store information and generally handle an OpenGL GLlight. It may also draw a sphere to represent the light on the 3D scene.
More...
|
| CGFlight (unsigned int lightid, float *pos, float *dir=NULL) |
| Constructor. Receives an OpenGL light id GL_LIGHT_n, a position in 4-float vector and an optional direction, both as defined in OpenGL's glLightfv() documentation.
|
|
virtual | ~CGFlight () |
| Base destructor.
|
|
void | draw () |
| Draws a visible representation of the light (a sphere). It forces an update() of the light.
|
|
void | update () |
| Updates the position and direction of the corresponding OpenGL's light. Has to be called after any camera transformations, so that the light is transformed in the proper referential.
|
|
void | enable () |
| Enables the light.
|
|
void | disable () |
| Disables the light.
|
|
void | setAmbient (float *) |
| Sets the Ambient component of the light (4-float vector)
|
|
void | setDiffuse (float *) |
| Sets the Diffuse component of the light (4-float vector)
|
|
void | setSpecular (float *) |
| Sets the Specular component of the light (4-float vector)
|
|
void | setKc (float f) |
| Sets the constant attenuation factor.
|
|
void | setKl (float f) |
| Sets the linear attenuation factor.
|
|
void | setKq (float f) |
| Sets the quadratic attenuation factor.
|
|
void | setAngle (float a) |
| Sets the angle of the spotlight's cone.
|
|
| CGFobject () |
| Base contructor.
|
|
virtual | ~CGFobject () |
| Base destructor.
|
|
The light class is used to initialise, store information and generally handle an OpenGL GLlight. It may also draw a sphere to represent the light on the 3D scene.