zenilib
0.5.3.0
|
An Abstraction of a Light. More...
#include <Light.h>
Public Member Functions | |
Light (const Color &ambient=Color(1.0f, 0.0f, 0.0f, 0.0f), const Color &diffuse=Color(1.0f, 1.0f, 1.0f, 1.0f), const Color &specular=Color(1.0f, 1.0f, 1.0f, 1.0f), const Point3f &position=Point3f(0.0f, 0.0f, 0.0f), const Vector3f &spot_direction=Vector3f(0.0f, 0.0f,-1.0f)) | |
An Alternative to the numerous setter functions. More... | |
void | set (const GLenum &number, Video_GL_Fixed &screen) const |
void | set (const GLenum &number, Video_GL_Shader &screen) const |
void | set (const DWORD &number, Video_DX9 &screen) const |
void | set_light_type (const LIGHT_TYPE &light_type) |
Set the type of the Light. More... | |
void | set_spot_phi (const float &spot_phi) |
Set the angle, in radians, describing the size of the outer cone (automatically decreases theta if necessary) More... | |
void | set_spot_theta (const float &spot_theta) |
Set the angle, in radians, describing the size of the inner cone (automatically increases phi if necessary) More... | |
Public Attributes | |
Color | ambient |
The ambient Color. More... | |
float | constant_attenuation |
Part of the equation describing the weakening of Light over distance. Read online for more information. More... | |
Color | diffuse |
The diffuse Color. More... | |
LIGHT_TYPE | light_type |
The type of the Light. More... | |
float | linear_attenuation |
Part of the equation describing the weakening of Light over distance. Read online for more information. More... | |
Point3f | position |
The position of the Light (irrelevant for directional lights or purely ambient lights) More... | |
float | quadratic_attenuation |
Part of the equation describing the weakening of Light over distance. Read online for more information. More... | |
float | range |
The max distance reached by the light; NOT SUPPORTED BY OPENGL. More... | |
Color | specular |
The specular Color. More... | |
Point3f | spot_direction |
The direction of the Light (relevent only to spotlights) More... | |
float | spot_exponent |
Similar to Falloff in OpenGL, describes the intensity of the Light from the inner cone to the outer cone (Note that the inner cone is size 0 in OpenGL) More... | |
float | spot_phi |
The angle, in radians, describing the size of the outer cone (automatically decreases theta if necessary) More... | |
float | spot_theta |
The angle, in radians, describing the size of the inner cone (automatically increases phi if necessary); NOT SUPPORTED BY OPENGL. More... | |
An Abstraction of a Light.
The Light class simply provides Lighting data to both Direct3D9 and OpenGL.
Contact: bazal d@ze nipex .com
Zeni::Light::Light | ( | const Color & | ambient = Color(1.0f, 0.0f, 0.0f, 0.0f) , |
const Color & | diffuse = Color(1.0f, 1.0f, 1.0f, 1.0f) , |
||
const Color & | specular = Color(1.0f, 1.0f, 1.0f, 1.0f) , |
||
const Point3f & | position = Point3f(0.0f, 0.0f, 0.0f) , |
||
const Vector3f & | spot_direction = Vector3f(0.0f, 0.0f, -1.0f) |
||
) |
void Zeni::Light::set | ( | const GLenum & | number, |
Video_GL_Fixed & | screen | ||
) | const |
Definition at line 52 of file Light.cpp.
References ambient, constant_attenuation, diffuse, GL_AMBIENT, GL_CONSTANT_ATTENUATION, GL_DIFFUSE, GL_LINEAR_ATTENUATION, GL_POSITION, GL_QUADRATIC_ATTENUATION, GL_SPECULAR, GL_SPOT_CUTOFF, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, glEnable, glLightf, glLightfv, Zeni::LIGHT_DIRECTIONAL, light_type, linear_attenuation, Zeni::Global::pi, position, quadratic_attenuation, specular, spot_direction, spot_exponent, spot_phi, Zeni::Point3f::x, Zeni::Point3f::y, and Zeni::Point3f::z.
Referenced by set(), Zeni::Video_GL_Shader::set_Light(), Zeni::Video_GL_Fixed::set_Light(), and Zeni::Video_DX9::set_Light().
void Zeni::Light::set | ( | const GLenum & | number, |
Video_GL_Shader & | screen | ||
) | const |
Definition at line 84 of file Light.cpp.
References Zeni::Video_DX9::get_d3d_device(), and TRUE.
|
inline |
Set the type of the Light.
Definition at line 25 of file Light.hxx.
References Zeni::LIGHT_POINT, light_type, Zeni::Global::pi, spot_phi, and spot_theta.
Set the angle, in radians, describing the size of the outer cone (automatically decreases theta if necessary)
Definition at line 38 of file Light.hxx.
References Zeni::LIGHT_POINT, Zeni::LIGHT_SPOT, light_type, Zeni::Global::pi, spot_phi, and spot_theta.
Referenced by set_spot_theta().
Set the angle, in radians, describing the size of the inner cone (automatically increases phi if necessary)
Definition at line 31 of file Light.hxx.
References set_spot_phi(), spot_phi, and spot_theta.
Color Zeni::Light::ambient |
float Zeni::Light::constant_attenuation |
Color Zeni::Light::diffuse |
LIGHT_TYPE Zeni::Light::light_type |
The type of the Light.
Definition at line 82 of file Light.h.
Referenced by set(), set_light_type(), and set_spot_phi().
float Zeni::Light::linear_attenuation |
Point3f Zeni::Light::position |
float Zeni::Light::quadratic_attenuation |
float Zeni::Light::range |
Color Zeni::Light::specular |
Point3f Zeni::Light::spot_direction |
float Zeni::Light::spot_exponent |
float Zeni::Light::spot_phi |
The angle, in radians, describing the size of the outer cone (automatically decreases theta if necessary)
Definition at line 94 of file Light.h.
Referenced by set(), set_light_type(), set_spot_phi(), and set_spot_theta().
float Zeni::Light::spot_theta |
The angle, in radians, describing the size of the inner cone (automatically increases phi if necessary); NOT SUPPORTED BY OPENGL.
Definition at line 93 of file Light.h.
Referenced by set_light_type(), set_spot_phi(), and set_spot_theta().