Light Class Reference
Can be used to illuminate a scene.
More...
#include <Light.h>
List of all members.
Detailed Description
Can be used to illuminate a scene.
The Light class just bundles together the code needed to apply lighting in OpenGL. Like any other object that can be added to a scene, a Light has a position that may vary over time. Furthermore, it contains values for the ambient, diffuse and specular illumination of a scene.
Definition at line 18 of file Light.h.
Constructor & Destructor Documentation
|
Constructor: Initialized the light to default values.
Definition at line 3 of file Light.cpp. |
Member Function Documentation
void Light::Apply |
( |
int |
time |
) |
|
|
|
Applies the light to the current OpenGL environment.
- Parameters:
-
| time | Specifies the time for which the position of the light shall be evaluated. |
Definition at line 57 of file Light.cpp. |
void Light::Bind |
( |
int |
id |
) |
|
|
|
Binds the light to OpenGL
- Parameters:
-
| id | Identifies this light under OpenGL. |
Definition at line 52 of file Light.cpp. |
static int Light::GetId |
( |
|
) |
[static] |
|
|
Returns a new unique value which identifies the light under OpenGL. |
void Light::SetAmbient |
( |
float |
red, |
|
|
float |
green, |
|
|
float |
blue, |
|
|
float |
alpha |
|
) |
|
|
|
Sets the ambient contribution of the light.
- Parameters:
-
| red | Red part of the ambient illumination. |
| green | Green part of the ambient illumination. |
| blue | Blue part of the ambient illumination. |
| alpha | Alpha value of the ambient illumination. |
Definition at line 28 of file Light.cpp. |
void Light::SetDiffuse |
( |
float |
red, |
|
|
float |
green, |
|
|
float |
blue, |
|
|
float |
alpha |
|
) |
|
|
|
Set the diffuse contribution of the light.
- Parameters:
-
| red | Red part of the diffuse illumination. |
| green | Green part of the diffuse illumination. |
| blue | Blue part of the diffuse illumination. |
| alpha | Alpha value of the diffuse illumination. |
Definition at line 36 of file Light.cpp. |
void Light::SetSpecular |
( |
float |
red, |
|
|
float |
green, |
|
|
float |
blue, |
|
|
float |
alpha |
|
) |
|
|
|
Sets the specular contributino of the light.
- Parameters:
-
| red | Red part of the specular illuminaion. |
| green | Green part of the specular illumination. |
| blue | Blue part of the specular illumination. |
| alpha | Alpha value of the specular illumination. |
Definition at line 44 of file Light.cpp. |
Member Data Documentation
|
Ambient contribution.
Definition at line 87 of file Light.h. |
|
holds id that will be distributed by the next call to 'GetId ()'.
Definition at line 99 of file Light.h. |
|
Diffuse contribution.
Definition at line 90 of file Light.h. |
|
Stores the identifier which is used to bind the light to OpenGL
Definition at line 96 of file Light.h. |
|
Path of the light over time.
Definition at line 41 of file Light.h. |
|
Specular contribution.
Definition at line 93 of file Light.h. |
Generated on Sun Jul 2 13:20:40 2006 for Demo by
1.4.6-NO