HyperspaceExplorer 0.7.1
|
An interface for the definition of light sources' attributes. More...
#include <Light.h>
Public Member Functions | |
LightSource () | |
Construct a black light source. | |
LightSource (const VecMath::Vector< 4 > &pos, const Color &a, const Color &d, const Color &s) | |
Construct a light source with a location and color values. | |
virtual | ~LightSource () |
Destroy a light source. Does nothing except releasing members. | |
virtual const VecMath::Vector< 4 > & | getPosition () const |
virtual void | setPosition (const VecMath::Vector< 4 > &pos) |
virtual const Color & | getAmbient () const |
virtual void | setAmbient (const Color &col) |
virtual const Color & | getDiffuse () const |
virtual void | setDiffuse (const Color &col) |
virtual const Color & | getSpecular () const |
virtual void | setSpecular (const Color &col) |
Private Attributes | |
VecMath::Vector< 4 > | _position |
The light source's location in homogenous coordinates. | |
Color | _ambient |
The light source's ambient color. | |
Color | _diffuse |
The light source's diffuse color. | |
Color | _specular |
The light source's color for specular reflections. |
An interface for the definition of light sources' attributes.
This class is just a POD struct with getters and setters to the location of the light source, and the color for its ambient value, its diffuse light and the specular reflections caused by the light source.
LightSource::LightSource | ( | const VecMath::Vector< 4 > & | pos, |
const Color & | a, | ||
const Color & | d, | ||
const Color & | s | ||
) | [inline] |
Construct a light source with a 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& LightSource::getAmbient | ( | ) | const [inline, virtual] |
References _ambient.
Referenced by Light::getAmbient().
virtual const Color& LightSource::getDiffuse | ( | ) | const [inline, virtual] |
References _diffuse.
Referenced by Light::getDiffuse().
virtual const VecMath::Vector<4>& LightSource::getPosition | ( | ) | const [inline, virtual] |
References _position.
Referenced by Light::getPosition().
virtual const Color& LightSource::getSpecular | ( | ) | const [inline, virtual] |
References _specular.
Referenced by Light::getSpecular().
virtual void LightSource::setAmbient | ( | const Color & | col | ) | [inline, virtual] |
col | The light source's ambient color |
References _ambient.
virtual void LightSource::setDiffuse | ( | const Color & | col | ) | [inline, virtual] |
col | The light source's diffuse color |
References _diffuse.
virtual void LightSource::setPosition | ( | const VecMath::Vector< 4 > & | pos | ) | [inline, virtual] |
pos | The light source's location in homogenous coordinates |
References _position.
virtual void LightSource::setSpecular | ( | const Color & | col | ) | [inline, virtual] |
col | The light source's color for specular reflections |
References _specular.