#include <light.h>
Public Member Functions | |
CLight (void) | |
Constructs a CLight object. | |
bool | getEnabled (void) const |
Reads the enabled bit. | |
void | setEnabled (bool en) |
Writes enabled state bit. | |
bool | getLockedToCamera (void) const |
Reads lock-to-camera state bit. | |
void | setLockedToCamera (bool locked) |
Writes lock-to-camera state bit. | |
bool | getAutoRotate (void) const |
Reads auto-rotate state bit. | |
void | setAutoRotate (bool enable) |
Writes auto-rotate state bit. | |
vec4_t | getPosition (void) const |
Reads light position. | |
void | setPosition (const vec4_t &v) |
Writes light position. | |
vec4_t | getAmbient (void) const |
Reads ambient color. | |
void | setAmbient (const vec4_t &v) |
Writes ambient color. | |
vec4_t | getDiffuse (void) const |
Reads diffuse color. | |
void | setDiffuse (const vec4_t &v) |
Writes diffuse color. | |
vec4_t | getSpecular (void) const |
Reads specular color. | |
void | setSpecular (const vec4_t &v) |
Writes specular color. |
This class allows storing the most important OpenGL light source parameters like position, colors and the enabled bit. It also supports some application specific state, like a flag wether the light is locked to a camera or not. In the first case, the light position is specified in eye coordinates, in the other case world coordinats. Another feature is a flag, wether a light should be auto-rotated around the origin. This takes only effect, if the light is not locked to the camera position. Auto-rotation can be used to test the behavoir of lighting shaders without manipulating many light positions by hand. The exact auto-rotate transformation is implementation specific.
The methods of this class are only used for reading/writing light source parameters and have no side effects. That's why they are less documented.
CLight::CLight | ( | void | ) | [inline] |
Constructs a CLight object.
It defaults all colors to back (0,0,0,0) and all state bits (enabled, locked-to-camera, auto-rotate) to False.