#include <PhongLight.h>

Public Member Functions | |
| PhongLight (const PhongMaterial &color) | |
| Standard constructor. | |
| PhongLight (const PhongLight &source) | |
| Copy constructor. | |
| ~PhongLight () | |
| Standard destructor. | |
| GLfloat | getSpotAngle () |
| Getter for Spot Angle (180.0 = omni). | |
| void | setSpotAngle (const GLfloat &angle) |
| Setter for Spot Angle (180.0 = omni). | |
| GLfloat | getSpotExponent () |
| Getter for Spot falloff Exponent. | |
| void | setSpotExponent (const GLfloat &exponent) |
| Setter for Spot falloff Exponent. | |
| void | renderGl () |
| Display the Light. | |
| void | selectGl () |
| Not needed for lights. | |
| const PhongMaterial | getMaterial () const |
| Getter for Material. | |
| const GLint | getLightId () const |
| Getter for OpenGL light id. | |
| void | setLightId (const GLint &lightId) |
| Setter for OpenGL light id. | |
| GLfloat | getAttenConst () |
| Getter for constant attenuation. | |
| void | setAttenConst (const GLfloat &attenConst) |
| Setter for constant attenuation. | |
| GLfloat | getAttenLin () |
| Getter for linear attenuation. | |
| void | setAttenLin (const GLfloat &attenLin) |
| Setter for linear attenuation. | |
| GLfloat | getAttenQuad () |
| Getter for quadratic attenuation. | |
| void | setAttenQuad (const GLfloat &attenQuad) |
| Setter for quadratic attenuation. | |
| virtual string | toString () const |
| Returns a textual representation. | |
| virtual string | className () const |
| Returns the class name of the object. | |
| virtual enum classId | classId () const |
| Returns the class id of the object. | |
Private Member Functions | |
| void | takeSlotGl () |
| Finds the next free light id in OpenGL and assigns it. | |
Private Attributes | |
| PhongMaterial | material |
| Color properties. | |
| GLint | lightId |
| Light id in OpenGL. | |
| GLfloat | spotAngle |
| GLfloat | spotExponent |
| GLfloat | attenConst |
| Attenuation Parameters. | |
| GLfloat | attenLin |
| GLfloat | attenQuad |
Static Private Attributes | |
| static bool | lightSlotGl [] = {true, true, true, true, true, true, true, true} |
| Static array of free lights. | |
An animatable lightsource.
Needs a static member that automatically checks, if a light id is already in use.
| PhongLight::PhongLight | ( | const PhongMaterial & | color | ) |
Standard constructor.
Creates a new simple white omni light, that will be the fist light in the scene. So if more than one light is invoked with the standard constructor, these lights will conflict.
| PhongLight::PhongLight | ( | const PhongLight & | source | ) |
Copy constructor.
| PhongLight::~PhongLight | ( | ) |
Standard destructor.
Disables the corresponding light in OpenGL
| void PhongLight::takeSlotGl | ( | ) | [private] |
Finds the next free light id in OpenGL and assigns it.
Does nothing if all slots are taken
| GLfloat PhongLight::getSpotAngle | ( | ) |
Getter for Spot Angle (180.0 = omni).
| void PhongLight::setSpotAngle | ( | const GLfloat & | angle | ) |
Setter for Spot Angle (180.0 = omni).
| GLfloat PhongLight::getSpotExponent | ( | ) |
Getter for Spot falloff Exponent.
| void PhongLight::setSpotExponent | ( | const GLfloat & | exponent | ) |
Setter for Spot falloff Exponent.
| void PhongLight::renderGl | ( | ) | [virtual] |
Display the Light.
Sets light in OpenGL for rendering.
| time | The time in ms for which the light shall be rendered (used for animation). |
Implements Object3d.
| void PhongLight::selectGl | ( | ) | [virtual] |
| const PhongMaterial PhongLight::getMaterial | ( | ) | const |
Getter for Material.
| const GLint PhongLight::getLightId | ( | ) | const |
Getter for OpenGL light id.
| void PhongLight::setLightId | ( | const GLint & | lightId | ) |
Setter for OpenGL light id.
| lightId | The OpenGl light id (GL_LIGHT0 - GL_LIGHT7) to be used. If the light id is invalid, this call will have no effect. |
| GLfloat PhongLight::getAttenConst | ( | ) |
Getter for constant attenuation.
| void PhongLight::setAttenConst | ( | const GLfloat & | attenConst | ) |
Setter for constant attenuation.
| GLfloat PhongLight::getAttenLin | ( | ) |
Getter for linear attenuation.
| void PhongLight::setAttenLin | ( | const GLfloat & | attenLin | ) |
Setter for linear attenuation.
| GLfloat PhongLight::getAttenQuad | ( | ) |
Getter for quadratic attenuation.
| void PhongLight::setAttenQuad | ( | const GLfloat & | attenQuad | ) |
Setter for quadratic attenuation.
| string PhongLight::toString | ( | ) | const [virtual] |
Returns a textual representation.
Reimplemented from Object3d.
| string PhongLight::className | ( | ) | const [virtual] |
Returns the class name of the object.
Reimplemented from Object3d.
| enum classId PhongLight::classId | ( | ) | const [virtual] |
Returns the class id of the object.
Reimplemented from Object3d.
PhongMaterial PhongLight::material [private] |
Color properties.
GLint PhongLight::lightId [private] |
Light id in OpenGL.
GLfloat PhongLight::spotAngle [private] |
GLfloat PhongLight::spotExponent [private] |
GLfloat PhongLight::attenConst [private] |
Attenuation Parameters.
GLfloat PhongLight::attenLin [private] |
GLfloat PhongLight::attenQuad [private] |
bool PhongLight::lightSlotGl = {true, true, true, true, true, true, true, true} [static, private] |
Static array of free lights.
1.5.6