ClanLib
2.3.7
|
Light Source description. More...
#include <light_source.h>
Public Member Functions | |
CL_LightSource_GL1 () | |
Construction. More... | |
~CL_LightSource_GL1 () | |
CL_Colorf | get_ambient_intensity () const |
Returns the ambient (global light) intensity of the light. More... | |
float | get_constant_attenuation () const |
Returns constant attenuation of the light. More... | |
CL_Colorf | get_diffuse_intensity () const |
Returns the diffuse (spread over wide area) intensity of the light. More... | |
float | get_linear_attenuation () const |
Returns linear attenuation of the light. More... | |
CL_Vec4f | get_position () const |
Returns the light position. More... | |
float | get_quadratic_attenuation () const |
Returns quadratic attenuation of the light. More... | |
CL_Colorf | get_specular_intensity () const |
Returns the specular (mirror reflective) intensity of the light. More... | |
float | get_spot_cutoff () const |
Returns the spot cutoff angle (the maximum spread angle of a light source). More... | |
CL_Vec4f | get_spot_direction () const |
Returns the light spot direction. More... | |
float | get_spot_exponent () const |
Attributes. More... | |
void | set_ambient_intensity (const CL_Colorf &color) |
Sets the ambient (global light) intensity of the light. More... | |
void | set_constant_attenuation (float constant_attenuation) |
Sets the constant attenuation of the light. More... | |
void | set_diffuse_intensity (const CL_Colorf &color) |
Sets the diffuse (spread over wide area) intensity of the light. More... | |
void | set_linear_attenuation (float linear_attenuation) |
Sets linear attenuation of the light. More... | |
void | set_position (const CL_Vec4f &position) |
Sets the light position. More... | |
void | set_quadratic_attenuation (float quadratic_attenuation) |
Sets quadratic attenuation of the light. More... | |
void | set_specular_intensity (const CL_Colorf &color) |
Sets the specular (mirror reflective) intensity of the light. More... | |
void | set_spot_cutoff (float spot_cutoff) |
Sets the spot cutoff angle (the maximum spread angle of a light source). More... | |
void | set_spot_direction (const CL_Vec3f &spot_direction) |
Sets the light spot direction. More... | |
void | set_spot_exponent (float spot_exponent) |
Operations. More... | |
Light Source description.
CL_LightSource_GL1::CL_LightSource_GL1 | ( | ) |
Construction.
Constructs a light source container.
CL_LightSource_GL1::~CL_LightSource_GL1 | ( | ) |
CL_Colorf CL_LightSource_GL1::get_ambient_intensity | ( | ) | const |
Returns the ambient (global light) intensity of the light.
float CL_LightSource_GL1::get_constant_attenuation | ( | ) | const |
Returns constant attenuation of the light.
The default attenuation factors are (1,0,0), resulting in no attenuation.
CL_Colorf CL_LightSource_GL1::get_diffuse_intensity | ( | ) | const |
Returns the diffuse (spread over wide area) intensity of the light.
float CL_LightSource_GL1::get_linear_attenuation | ( | ) | const |
Returns linear attenuation of the light.
The default attenuation factors are (1,0,0), resulting in no attenuation.
CL_Vec4f CL_LightSource_GL1::get_position | ( | ) | const |
Returns the light position.
float CL_LightSource_GL1::get_quadratic_attenuation | ( | ) | const |
Returns quadratic attenuation of the light.
The default attenuation factors are (1,0,0), resulting in no attenuation.
CL_Colorf CL_LightSource_GL1::get_specular_intensity | ( | ) | const |
Returns the specular (mirror reflective) intensity of the light.
float CL_LightSource_GL1::get_spot_cutoff | ( | ) | const |
Returns the spot cutoff angle (the maximum spread angle of a light source).
The default spot cutoff is 180, resulting in uniform light distribution.
CL_Vec4f CL_LightSource_GL1::get_spot_direction | ( | ) | const |
Returns the light spot direction.
float CL_LightSource_GL1::get_spot_exponent | ( | ) | const |
Attributes.
Returns the intensity distribution of the light.
Only values in the range [0,128] are accepted. The default spot exponent is 0, resulting in uniform light distribution.
void CL_LightSource_GL1::set_ambient_intensity | ( | const CL_Colorf & | color) |
Sets the ambient (global light) intensity of the light.
void CL_LightSource_GL1::set_constant_attenuation | ( | float | constant_attenuation) |
Sets the constant attenuation of the light.
The default attenuation factors are (1,0,0), resulting in no attenuation.
void CL_LightSource_GL1::set_diffuse_intensity | ( | const CL_Colorf & | color) |
Sets the diffuse (spread over wide area) intensity of the light.
void CL_LightSource_GL1::set_linear_attenuation | ( | float | linear_attenuation) |
Sets linear attenuation of the light.
The default attenuation factors are (1,0,0), resulting in no attenuation.
void CL_LightSource_GL1::set_position | ( | const CL_Vec4f & | position) |
Sets the light position.
The position is transformed by the modelview matrix when glLight is called (just as if it were a point), and it is stored in eye coordinates. If the w component of the position is 0.0, the light is treated as a directional source.
Diffuse and specular lighting calculations take the lights direction, but not its actual position, into account, and attenuation is disabled. Otherwise, diffuse and specular lighting calculations are based on the actual location of the light in eye coordinates, and attenuation is enabled.
The default position is (0,0,1,0); thus, the default light source is directional, parallel to, and in the direction of the x axis.
void CL_LightSource_GL1::set_quadratic_attenuation | ( | float | quadratic_attenuation) |
Sets quadratic attenuation of the light.
The default attenuation factors are (1,0,0), resulting in no attenuation.
void CL_LightSource_GL1::set_specular_intensity | ( | const CL_Colorf & | color) |
Sets the specular (mirror reflective) intensity of the light.
void CL_LightSource_GL1::set_spot_cutoff | ( | float | spot_cutoff) |
Sets the spot cutoff angle (the maximum spread angle of a light source).
The default spot cutoff is 180, resulting in uniform light distribution.
void CL_LightSource_GL1::set_spot_direction | ( | const CL_Vec3f & | spot_direction) |
Sets the light spot direction.
void CL_LightSource_GL1::set_spot_exponent | ( | float | spot_exponent) |
Operations.
Sets the intensity distribution of the light.
Only values in the range [0,128] are accepted. The default spot exponent is 0, resulting in uniform light distribution.