#include <CLight.h>
Public Member Functions | |
cLight (cWorld *a_world=NULL) | |
Constructor of cLight. | |
~cLight () | |
Destructor of cLight. | |
void | setDir (const cVector3d &a_direction) |
Set the direction of the light beam... only affects _positional_ lights with angular cutoffs (spotlights). | |
void | setDir (const double a_x, const double a_y, const double a_z) |
Set the direction of the light beam... only affects _positional_ lights with angular cutoffs (spotlights). | |
cVector3d | getDir () const |
Read the direction of the light beam... only affects _positional_ lights with angular cutoffs (spotlights). | |
void | setDirectionalLight (bool a_directionalLight) |
Set this light to be purely directional (true) or purely positional (false). | |
bool | getDirectionalLight () |
Returns true for a directional light, false for a positional light. | |
void | setAttConstant (const GLfloat &a_value) |
Set my constant attenuation parameter. | |
GLfloat | getAttConstant () const |
Read my constant attenuation parameter. | |
void | setAttLinear (const GLfloat &a_value) |
Set my linear attenuation parameter. | |
GLfloat | getAttLinear () const |
Read my linear attenuation parameter. | |
void | setAttQuadratic (const GLfloat &a_value) |
Set my quadratic attenuation parameter. | |
GLfloat | getAttQuadratic () const |
Read my quadratic attenuation parameter. | |
void | setSpotExponent (const GLfloat &a_value) |
Set concentration level of the light. | |
GLfloat | getSpotExponent () const |
Read concentration level of the light. | |
void | setCutOffAngle (const GLfloat &a_value) |
Set the cutoff angle in degrees (only affects spotlights) (positional lights with angular cutoffs). | |
GLfloat | getCutOffAngle () const |
Read Cut off angle. | |
void | setEnabled (const bool &a_enabled) |
Enable or disable this light source. | |
bool | getEnabled () const |
Is this light source enabled? | |
Public Attributes | |
cColorf | m_ambient |
Ambient light component. | |
cColorf | m_diffuse |
Diffuse light component. | |
cColorf | m_specular |
Specular light component. | |
Protected Member Functions | |
void | renderLightSource () |
Render the light in OpenGL. | |
Protected Attributes | |
cWorld * | m_parentWorld |
Parent world. | |
GLfloat | m_attConstant |
Constant attenuation parameter. | |
GLfloat | m_attLinear |
Linear attenuation parameter. | |
GLfloat | m_attQuadratic |
Quadratic attenuation parameter. | |
GLfloat | m_spotExponent |
Concentration of the light. | |
GLfloat | m_cutOffAngle |
Cut off angle (for spot lights only). Only values in the range [0, 90], and the special value 180, are accepted. | |
bool | m_enabled |
Enable light source (ON/OFF). | |
bool | m_directionalLight |
Is this a directional (true) or positional (false) light. | |
GLint | m_glLightNumber |
GL reference number of the light (0-7). | |
Friends | |
class | cWorld |
cWorld needs to access OpenGL information stored privately in cLight | |
class | cCamera |
cCamera needs to access OpenGL information stored privately in cLight |
cLight::cLight | ( | cWorld * | a_world = NULL |
) |
cLight::~cLight | ( | ) |
void cLight::renderLightSource | ( | ) | [protected] |
Render the light in OpenGL.
Render this light source in OpenGL.
Note that if this light source is disabled, the corresponding GL light source is disabled. That means you can't disable your CHAI light but turn on the GL light somewhere else.
void cLight::setCutOffAngle | ( | const GLfloat & | a_value | ) |
Set the cutoff angle in degrees (only affects spotlights) (positional lights with angular cutoffs).
Set the cutoff angle (in degrees) of my light beam.
Should range between 0 and 90 for spot lights. Use 180.0 to specify that there should be no cutoff.
a_value | Cutoff angle of light beam. |
void cLight::setDir | ( | const double | a_x, | |
const double | a_y, | |||
const double | a_z | |||
) |
Set the direction of the light beam... only affects _positional_ lights with angular cutoffs (spotlights).
Set the direction of my light beam.
a_x | X Coordinate of light beam. | |
a_y | Y Coordinate of light beam. | |
a_z | Z Coordinate of light beam. |
void cLight::setDir | ( | const cVector3d & | a_direction | ) |
Set the direction of the light beam... only affects _positional_ lights with angular cutoffs (spotlights).
Set the direction of my light beam.
a_direction | Direction of light beam |