The OpenGL light class. Defines a light for the basic OpenGL pipeline.
More...
#include <GLLight.h>
|
enum | LightSpace { WORLD,
CAMERA
} |
| Defines the space of the camera: world or camera. More...
|
|
enum | LightType { POINT,
DIRECTIONAL
} |
| Defines the type of the light: point or directional. More...
|
|
|
float | _diff [4] |
| The diffuse color of the light. It includes the red, green, blue and alpha values.
|
|
float | _pos [4] |
| The position of the light. It includes the x, y, z and type values. If type is 0, the light is directional, otherwise it is a point light.
|
|
LightSpace | _space |
| Space of the light.
|
|
The OpenGL light class. Defines a light for the basic OpenGL pipeline.
Defines the space of the camera: world or camera.
If world, the camera is fixed to the world. If camera, it is fixed to the camera and moves with the camera.
Defines the type of the light: point or directional.
If the light is point light, it acts like a single point source originating from the position. If the light is a directional light, it is a light source, infinitely far away oriented in the direction of the vector defined by the light position.
void Menge::SceneGraph::GLLight::initGL |
( |
int |
i, |
|
|
LightSpace |
space = WORLD |
|
) |
| const |
Initializes the corresponding OpenGL light.
- Parameters
-
i | The GL identifier for this light, such that this light is GL_LIGHTi. |
space | The space being initialized. If the light is defined in a different space, then it shouldn't execute itself |
void Menge::SceneGraph::GLLight::setColor |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a = 1.0 |
|
) |
| |
Sets the light color.
- Parameters
-
r | The red component of the light's diffuse color. Must lie in the range [0, 1] |
g | The green component of the light's diffuse color. Must lie in the range [0, 1] |
b | The blue component of the light's diffuse color. Must lie in the range [0, 1] |
a | The alpha component of the light's diffuse color. Must lie in the range [0, 1] |
void Menge::SceneGraph::GLLight::setLightType |
( |
LightType |
lightType | ) |
|
Sets the light type.
- Parameters
-
lightType | The enumeration specifying either POINT or DIRECTIONAL light. |
void Menge::SceneGraph::GLLight::setPosition |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
w = -1.f |
|
) |
| |
Sets the light color.
- Parameters
-
x | The x-value of the light's position. |
y | The y-value of the light's position. |
z | The z-value of the light's position. |
w | The w-value of the light's position. It determines the light type (point or directional). If the value is 0, the light is set to directional, if > 0 it is set to point, if < 0, it remains unchanged. |
void Menge::SceneGraph::GLLight::setSpace |
( |
LightSpace |
space | ) |
|
|
inline |
Sets the space of the camera.
- Parameters
-
space | The space for the camera. |
The documentation for this class was generated from the following files:
- src/menge/MengeCore/SceneGraph/GLLight.h
- src/menge/MengeCore/SceneGraph/GLLight.cpp