Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

LIGHT Class Reference

#include <light.h>

Inheritance diagram for LIGHT:

OBJECT List of all members.

Public Methods

 LIGHT ()
 ~LIGHT ()
void Reset ()
void Update ()
void Apply ()

Public Attributes

int LightNumber
float Ambient [4]
float Diffuse [4]
float Specular [4]
bool SpotLight
VECTOR SpotDirection
float SpotExponent
float SpotCutoff
float Constant
float Linear
float Quadratic
float GlobalAmbient [4]
bool Positional
bool LocalViewer
bool TwoSided

Constructor & Destructor Documentation

LIGHT::LIGHT  
 

Definition at line 5 of file light.cpp.

00006 {
00007 }

LIGHT::~LIGHT  
 

Definition at line 9 of file light.cpp.

00010 {
00011 }


Member Function Documentation

void LIGHT::Apply  
 

Definition at line 64 of file light.cpp.

References LightNumber, OBJECT::Position, Positional, OBJECT::UpdatePosition(), VECTOR::x, VECTOR::y, and VECTOR::z.

Referenced by DrawGLScene().

00065 {
00066     UpdatePosition();
00067     float LightPosition[] = {Position.x, Position.y, Position.z, (float)Positional};
00068     glLightfv(GL_LIGHT[LightNumber], GL_POSITION, LightPosition);
00069 }

void LIGHT::Reset  
 

Reimplemented from OBJECT.

Definition at line 13 of file light.cpp.

References Ambient, Constant, OBJECT::Delta_x, OBJECT::Delta_y, OBJECT::Delta_z, Diffuse, OBJECT::GetZUnit(), GlobalAmbient, LightNumber, Linear, LocalViewer, OBJECT::Movement_x, OBJECT::Movement_y, OBJECT::Movement_z, OBJECT::Orientation, OBJECT::Position, Positional, Quadratic, QUAT::Reset(), VECTOR::Set(), Specular, SpotCutoff, SpotDirection, SpotExponent, SpotLight, TwoSided, VECTOR::x, VECTOR::y, and VECTOR::z.

00014 {
00015     Orientation.Reset();
00016     Position.Set(2.0, 2.0, 3.0);
00017     Delta_x = 0.0;
00018     Delta_y = 0.0;
00019     Delta_z = 0.0;
00020     Movement_x = 0.0;
00021     Movement_y = 0.0;
00022     Movement_z = 0.0;
00023     Ambient[0] = 0.0;
00024     Ambient[1] = 0.0;
00025     Ambient[2] = 0.0;
00026     Ambient[3] = 1.0;
00027     Diffuse[0] = 1.0;
00028     Diffuse[1] = 1.0;
00029     Diffuse[2] = 1.0;
00030     Diffuse[3] = 1.0;
00031     Specular[0] = 1.0;
00032     Specular[1] = 1.0;
00033     Specular[2] = 1.0;
00034     Specular[3] = 1.0;
00035     SpotLight = GL_FALSE;
00036     SpotDirection = GetZUnit();
00037     SpotExponent = 0.0;
00038     SpotCutoff = 180.0;
00039     Constant = 1.0;
00040     Linear = 0.0;
00041     Quadratic = 0.0;
00042     GlobalAmbient[0] = 0.2;
00043     GlobalAmbient[1] = 0.2;
00044     GlobalAmbient[2] = 0.2;
00045     GlobalAmbient[3] = 1.0;
00046     Positional = GL_FALSE;
00047     LocalViewer = GL_FALSE;
00048     TwoSided = GL_FALSE;
00049     float LightPosition[] = {Position.x, Position.y, Position.z, (float)Positional};
00050     glLightfv(GL_LIGHT[LightNumber], GL_POSITION, LightPosition);
00051     glLightfv(GL_LIGHT[LightNumber], GL_AMBIENT, Ambient);
00052     glLightfv(GL_LIGHT[LightNumber], GL_DIFFUSE, Diffuse);
00053     glLightfv(GL_LIGHT[LightNumber], GL_SPECULAR, Specular);
00054     glEnable(GL_LIGHT[LightNumber]);
00055 }

void LIGHT::Update  
 

Definition at line 57 of file light.cpp.

References Ambient, Diffuse, LightNumber, and Specular.

00058 {
00059     glLightfv(GL_LIGHT[LightNumber], GL_AMBIENT, Ambient);
00060     glLightfv(GL_LIGHT[LightNumber], GL_DIFFUSE, Diffuse);
00061     glLightfv(GL_LIGHT[LightNumber], GL_SPECULAR, Specular);
00062 }


Member Data Documentation

float LIGHT::Ambient[4]
 

Definition at line 22 of file light.h.

Referenced by Reset(), and Update().

float LIGHT::Constant
 

Definition at line 29 of file light.h.

Referenced by Reset().

float LIGHT::Diffuse[4]
 

Definition at line 23 of file light.h.

Referenced by Reset(), and Update().

float LIGHT::GlobalAmbient[4]
 

Definition at line 32 of file light.h.

Referenced by Reset().

int LIGHT::LightNumber
 

Definition at line 21 of file light.h.

Referenced by Apply(), Reset(), and Update().

float LIGHT::Linear
 

Definition at line 30 of file light.h.

Referenced by Reset().

bool LIGHT::LocalViewer
 

Definition at line 34 of file light.h.

Referenced by Reset().

bool LIGHT::Positional
 

Definition at line 33 of file light.h.

Referenced by Apply(), and Reset().

float LIGHT::Quadratic
 

Definition at line 31 of file light.h.

Referenced by Reset().

float LIGHT::Specular[4]
 

Definition at line 24 of file light.h.

Referenced by Reset(), and Update().

float LIGHT::SpotCutoff
 

Definition at line 28 of file light.h.

Referenced by Reset().

VECTOR LIGHT::SpotDirection
 

Definition at line 26 of file light.h.

Referenced by Reset().

float LIGHT::SpotExponent
 

Definition at line 27 of file light.h.

Referenced by Reset().

bool LIGHT::SpotLight
 

Definition at line 25 of file light.h.

Referenced by Reset().

bool LIGHT::TwoSided
 

Definition at line 35 of file light.h.

Referenced by Reset().


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:19:59 2005 for Particles by doxygen1.2.15