HyperspaceExplorer 0.7.1
|
An interface for the definition of light sources. More...
#include <Light.h>
Public Member Functions | |
Light (const LightSource &s) | |
Construct a Light from a LightSource definition. | |
Light (const VecMath::Vector< 4 > &pos, const Color &a, const Color &d, const Color &s) | |
Construct a light directly from location and color values. | |
virtual void | render () const =0 |
Set the light source into the scene. | |
Protected Member Functions | |
virtual const VecMath::Vector< 4 > & | getPosition () const |
virtual const Color & | getAmbient () const |
virtual const Color & | getDiffuse () const |
virtual const Color & | getSpecular () const |
Private Attributes | |
LightSource | _lightSource |
The LightSource object defining the properties of the Light. |
An interface for the definition of light sources.
In addition to managing the attributes of the light source, as defined in the class LightSource, Light provides an abstract method render() which must be implemented in descendants to put the light source into the scene.
Light::Light | ( | const VecMath::Vector< 4 > & | pos, |
const Color & | a, | ||
const Color & | d, | ||
const Color & | s | ||
) | [inline] |
Construct a light directly from location and color values.
pos | The light source's location in homogenous coordinates |
a | The light source's ambient color |
d | The light source's diffuse color |
s | The light source's color for specular reflections |
virtual const Color& Light::getAmbient | ( | ) | const [inline, protected, virtual] |
References _lightSource, and LightSource::getAmbient().
Referenced by LightOpenGL::render().
virtual const Color& Light::getDiffuse | ( | ) | const [inline, protected, virtual] |
References _lightSource, and LightSource::getDiffuse().
Referenced by LightOpenGL::render().
virtual const VecMath::Vector<4>& Light::getPosition | ( | ) | const [inline, protected, virtual] |
References _lightSource, and LightSource::getPosition().
Referenced by LightOpenGL::render().
virtual const Color& Light::getSpecular | ( | ) | const [inline, protected, virtual] |
References _lightSource, and LightSource::getSpecular().
Referenced by LightOpenGL::render().
virtual void Light::render | ( | ) | const [pure virtual] |
Set the light source into the scene.
The actual rendering of the light source is done in the class implementing this interface.
Implemented in LightOpenGL.