Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Light Class Reference

#include <light.H>

Collaboration diagram for Light:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Light ()
 Default constructor.
 Light (mlib::CWvec &dir, bool is_enabled=false, bool is_in_cam_space=true, CCOLOR &ambient=COLOR::black, CCOLOR &diffuse=COLOR::white, CCOLOR &specular=COLOR::white)
 Constructor for a directional light.
 Light (mlib::CWpt &loc, bool is_enabled=false, bool is_in_cam_space=true, CCOLOR &ambient=COLOR::black, CCOLOR &diffuse=COLOR::white, CCOLOR &specular=COLOR::white, mlib::CWvec &spot_dir=mlib::Wvec(0, 0,-1), float spot_exponent=0, float spot_cutoff=180, float k0=1, float k1=0, float k2=0)
 Constructor for a positional light.
mlib::Wvec get_direction () const
 For a directional light, returns the direction:.
mlib::Wpt get_position () const
 For a positional light, returns the position:.
void set_position (mlib::CWpt &p)
void set_direction (mlib::CWvec &v)

Public Attributes

bool _is_enabled
 is enabled?
bool _is_in_cam_space
 is defined in camera space?
bool _is_positional
 is positional?
COLOR _ambient_color
 ambient color
COLOR _diffuse_color
 diffuse color
COLOR _specular_color
 specular color
mlib::Wvec _coords
 "coordinates": direction or position
mlib::Wvec _spot_direction
 GL_SPOT_DIRECTION.
float _spot_exponent
 GL_SPOT_EXPONENT.
float _spot_cutoff
 GL_SPOT_CUTOFF.
float _k0
 GL_CONSTANT_ATTENUATION.
float _k1
 GL_LINEAR_ATTENUATION.
float _k2
 GL_QUADRATIC_ATTENUATION.

Detailed Description

Class for managing lights

Definition at line 12 of file light.H.


Constructor & Destructor Documentation

Light::Light  )  [inline]
 

Default constructor.

Definition at line 17 of file light.H.

Light::Light mlib::CWvec dir,
bool  is_enabled = false,
bool  is_in_cam_space = true,
CCOLOR ambient = COLOR::black,
CCOLOR diffuse = COLOR::white,
CCOLOR specular = COLOR::white
[inline]
 

Constructor for a directional light.

Definition at line 33 of file light.H.

Light::Light mlib::CWpt loc,
bool  is_enabled = false,
bool  is_in_cam_space = true,
CCOLOR ambient = COLOR::black,
CCOLOR diffuse = COLOR::white,
CCOLOR specular = COLOR::white,
mlib::CWvec spot_dir = mlib::Wvec(0,0,-1),
float  spot_exponent = 0,
float  spot_cutoff = 180,
float  k0 = 1,
float  k1 = 0,
float  k2 = 0
[inline]
 

Constructor for a positional light.

Definition at line 55 of file light.H.


Member Function Documentation

mlib::Wvec Light::get_direction  )  const [inline]
 

For a directional light, returns the direction:.

Definition at line 82 of file light.H.

References _coords, and mlib::Vec3< V >::normalized().

Referenced by VIEW::light_get_coordinates_v(), and GL_VIEW::setup_light().

mlib::Wpt Light::get_position  )  const [inline]
 

For a positional light, returns the position:.

Definition at line 84 of file light.H.

References _coords.

Referenced by VIEW::light_get_coordinates_p(), and GL_VIEW::setup_light().

void Light::set_direction mlib::CWvec v  )  [inline]
 

Definition at line 92 of file light.H.

References _coords, and _is_positional.

Referenced by VIEW::light_set_coordinates_v().

void Light::set_position mlib::CWpt p  )  [inline]
 

Definition at line 88 of file light.H.

References _coords, and _is_positional.

Referenced by VIEW::light_set_coordinates_p().


Member Data Documentation

COLOR Light::_ambient_color
 

ambient color

Definition at line 105 of file light.H.

Referenced by VIEW::light_get_ambient(), VIEW::light_set_ambient(), and GL_VIEW::setup_light().

mlib::Wvec Light::_coords
 

"coordinates": direction or position

Definition at line 108 of file light.H.

Referenced by get_direction(), get_position(), set_direction(), and set_position().

COLOR Light::_diffuse_color
 

diffuse color

Definition at line 106 of file light.H.

Referenced by VIEW::light_get_diffuse(), VIEW::light_set_diffuse(), and GL_VIEW::setup_light().

bool Light::_is_enabled
 

is enabled?

Definition at line 102 of file light.H.

Referenced by VIEW::light_get_enable(), VIEW::light_set_enable(), and GL_VIEW::setup_light().

bool Light::_is_in_cam_space
 

is defined in camera space?

Definition at line 103 of file light.H.

Referenced by VIEW::light_get_in_cam_space(), VIEW::light_set_in_cam_space(), and GL_VIEW::setup_light().

bool Light::_is_positional
 

is positional?

Definition at line 104 of file light.H.

Referenced by VIEW::light_get_positional(), VIEW::light_set_positional(), set_direction(), set_position(), and GL_VIEW::setup_light().

float Light::_k0
 

GL_CONSTANT_ATTENUATION.

Definition at line 112 of file light.H.

Referenced by GL_VIEW::setup_light().

float Light::_k1
 

GL_LINEAR_ATTENUATION.

Definition at line 113 of file light.H.

Referenced by GL_VIEW::setup_light().

float Light::_k2
 

GL_QUADRATIC_ATTENUATION.

Definition at line 114 of file light.H.

Referenced by GL_VIEW::setup_light().

COLOR Light::_specular_color
 

specular color

Definition at line 107 of file light.H.

Referenced by GL_VIEW::setup_light().

float Light::_spot_cutoff
 

GL_SPOT_CUTOFF.

Definition at line 111 of file light.H.

Referenced by GL_VIEW::setup_light().

mlib::Wvec Light::_spot_direction
 

GL_SPOT_DIRECTION.

Definition at line 109 of file light.H.

Referenced by GL_VIEW::setup_light().

float Light::_spot_exponent
 

GL_SPOT_EXPONENT.

Definition at line 110 of file light.H.

Referenced by GL_VIEW::setup_light().


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:46:23 2006 for jot by  doxygen 1.4.4