zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Light Class Reference

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...
 

Detailed Description

An Abstraction of a Light.

The Light class simply provides Lighting data to both Direct3D9 and OpenGL.

Note
To OpenGL developers: Direct3D behavior won out over OpenGL behavior. Angles describing the spread of a spotlight should be twice what you're used to.
Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 57 of file Light.h.

Constructor & Destructor Documentation

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) 
)

An Alternative to the numerous setter functions.

Definition at line 34 of file Light.cpp.

Member Function Documentation

void Zeni::Light::set ( const GLenum number,
Video_GL_Shader screen 
) const

DEPRECATED

Definition at line 77 of file Light.cpp.

References set().

void Zeni::Light::set ( const DWORD number,
Video_DX9 screen 
) const

Definition at line 84 of file Light.cpp.

References Zeni::Video_DX9::get_d3d_device(), and TRUE.

void Zeni::Light::set_light_type ( const LIGHT_TYPE light_type)
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.

void Zeni::Light::set_spot_phi ( const float &  spot_phi)
inline

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().

void Zeni::Light::set_spot_theta ( const float &  spot_theta)
inline

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.

Member Data Documentation

Color Zeni::Light::ambient

The ambient Color.

Definition at line 85 of file Light.h.

Referenced by set().

float Zeni::Light::constant_attenuation

Part of the equation describing the weakening of Light over distance. Read online for more information.

Definition at line 90 of file Light.h.

Referenced by set().

Color Zeni::Light::diffuse

The diffuse Color.

Definition at line 83 of file Light.h.

Referenced by set().

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

Part of the equation describing the weakening of Light over distance. Read online for more information.

Definition at line 91 of file Light.h.

Referenced by set().

Point3f Zeni::Light::position

The position of the Light (irrelevant for directional lights or purely ambient lights)

Definition at line 86 of file Light.h.

Referenced by set().

float Zeni::Light::quadratic_attenuation

Part of the equation describing the weakening of Light over distance. Read online for more information.

Definition at line 92 of file Light.h.

Referenced by set().

float Zeni::Light::range

The max distance reached by the light; NOT SUPPORTED BY OPENGL.

Definition at line 88 of file Light.h.

Color Zeni::Light::specular

The specular Color.

Definition at line 84 of file Light.h.

Referenced by set().

Point3f Zeni::Light::spot_direction

The direction of the Light (relevent only to spotlights)

Definition at line 87 of file Light.h.

Referenced by set().

float Zeni::Light::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)

Definition at line 89 of file Light.h.

Referenced by set().

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().


The documentation for this class was generated from the following files: