A simple point light source. More...

#include <Light.h>

Public Member Functions

 Light ()
 Constructor loading standard values for position, color, intensity and attenuation. More...
 
 Light (const vmml::Vector3f &position, const vmml::Vector3f &color)
 Constructor loading standard values for intensity and attenuation. More...
 
 Light (const vmml::Vector3f &position, const vmml::Vector3f &color, GLfloat intensity, GLfloat attenuation, GLfloat radius)
 Constructor. More...
 
 Light (const vmml::Vector3f &position, const vmml::Vector3f &diffuseColor, const vmml::Vector3f &specularColor, GLfloat intensity, GLfloat attenuation, GLfloat radius)
 Constructor. More...
 
virtual ~Light ()
 Virtual destructor. More...
 
void setPosition (const vmml::Vector3f &position)
 Sets the position of the light. More...
 
void setDiffuseColor (const vmml::Vector3f &color)
 Sets the color of the light for diffuse lighting. More...
 
void setSpecularColor (const vmml::Vector3f &color)
 Sets the color of the light for specular lighting. More...
 
void setIntensity (GLfloat intensity)
 Sets the intensity of the light. More...
 
void setAttenuation (GLfloat attenuation)
 Sets the attenuation of the light. More...
 
void setRadius (GLfloat radius)
 Sets the radius of the light. More...
 
const vmml::Vector4f & getPosition ()
 Returns the position of the light. More...
 
const vmml::Vector3f & getDiffuseColor ()
 Returns the color of the light for diffuse lighting. More...
 
const vmml::Vector3f & getSpecularColor ()
 Returns the color of the light for specular lighting. More...
 
GLfloat getIntensity ()
 Returns the intensity of the light. More...
 
GLfloat getAttenuation ()
 Returns the attenuation of the light. More...
 
GLfloat getRadius ()
 Returns the radius of the light. More...
 

Detailed Description

A simple point light source.

Author
Benjamin Buergisser

Constructor & Destructor Documentation

Light::Light ( )
inline

Constructor loading standard values for position, color, intensity and attenuation.

Light::Light ( const vmml::Vector3f &  position,
const vmml::Vector3f &  color 
)
inline

Constructor loading standard values for intensity and attenuation.

Parameters
[in]positionPosition of the light
[in]colorColor of the light for both diffuse and specular lighting
Light::Light ( const vmml::Vector3f &  position,
const vmml::Vector3f &  color,
GLfloat  intensity,
GLfloat  attenuation,
GLfloat  radius 
)
inline

Constructor.

Parameters
[in]positionPosition of the light
[in]colorColor of the light for both diffuse and specular lighting
[in]intensityIntensity of the light
[in]attenuationAttenuation of the light
[in]radiusRadius of the light (clamps the light at a certain distance)
Light::Light ( const vmml::Vector3f &  position,
const vmml::Vector3f &  diffuseColor,
const vmml::Vector3f &  specularColor,
GLfloat  intensity,
GLfloat  attenuation,
GLfloat  radius 
)
inline

Constructor.

Parameters
[in]positionPosition of the light
[in]diffuseColorColor of the light for diffuse lighting
[in]specularColorColor of the light for specular lighting
[in]intensityIntensity of the light
[in]attenuationAttenuation of the light
[in]radiusRadius of the light (clamps the light at a certain distance)
virtual Light::~Light ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

GLfloat Light::getAttenuation ( )
inline

Returns the attenuation of the light.

const vmml::Vector3f& Light::getDiffuseColor ( )
inline

Returns the color of the light for diffuse lighting.

GLfloat Light::getIntensity ( )
inline

Returns the intensity of the light.

const vmml::Vector4f& Light::getPosition ( )
inline

Returns the position of the light.

GLfloat Light::getRadius ( )
inline

Returns the radius of the light.

const vmml::Vector3f& Light::getSpecularColor ( )
inline

Returns the color of the light for specular lighting.

void Light::setAttenuation ( GLfloat  attenuation)
inline

Sets the attenuation of the light.

Parameters
[in]attenuationAttenuation of the light
void Light::setDiffuseColor ( const vmml::Vector3f &  color)
inline

Sets the color of the light for diffuse lighting.

Parameters
[in]colorColor of the light for diffuse lighting
void Light::setIntensity ( GLfloat  intensity)
inline

Sets the intensity of the light.

Parameters
[in]intensityIntensity of the light
void Light::setPosition ( const vmml::Vector3f &  position)
inline

Sets the position of the light.

Parameters
[in]positionPosition of the light
void Light::setRadius ( GLfloat  radius)
inline

Sets the radius of the light.

Parameters
[in]radiusRadius of the light
void Light::setSpecularColor ( const vmml::Vector3f &  color)
inline

Sets the color of the light for specular lighting.

Parameters
[in]colorColor of the light for specular lighting