HyperspaceExplorer 0.7.1
Public Member Functions | Private Attributes
LightSource Class Reference

An interface for the definition of light sources' attributes. More...

#include <Light.h>

Collaboration diagram for LightSource:
Collaboration graph
[legend]

List of all members.

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 ColorgetAmbient () const
virtual void setAmbient (const Color &col)
virtual const ColorgetDiffuse () const
virtual void setDiffuse (const Color &col)
virtual const ColorgetSpecular () 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.

Detailed Description

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.

Author:
Lene Preuss <lene.preuss@gmail.com>

Constructor & Destructor Documentation

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.

Parameters:
posThe light source's location in homogenous coordinates
aThe light source's ambient color
dThe light source's diffuse color
sThe light source's color for specular reflections

Member Function Documentation

virtual const Color& LightSource::getAmbient ( ) const [inline, virtual]
Returns:
The light source's ambient color

References _ambient.

Referenced by Light::getAmbient().

Here is the caller graph for this function:

virtual const Color& LightSource::getDiffuse ( ) const [inline, virtual]
Returns:
The light source's diffuse color

References _diffuse.

Referenced by Light::getDiffuse().

Here is the caller graph for this function:

virtual const VecMath::Vector<4>& LightSource::getPosition ( ) const [inline, virtual]
Returns:
The light source's location in homogenous coordinates

References _position.

Referenced by Light::getPosition().

Here is the caller graph for this function:

virtual const Color& LightSource::getSpecular ( ) const [inline, virtual]
Returns:
The light source's color for specular reflections

References _specular.

Referenced by Light::getSpecular().

Here is the caller graph for this function:

virtual void LightSource::setAmbient ( const Color col) [inline, virtual]
Parameters:
colThe light source's ambient color

References _ambient.

virtual void LightSource::setDiffuse ( const Color col) [inline, virtual]
Parameters:
colThe light source's diffuse color

References _diffuse.

virtual void LightSource::setPosition ( const VecMath::Vector< 4 > &  pos) [inline, virtual]
Parameters:
posThe light source's location in homogenous coordinates

References _position.

virtual void LightSource::setSpecular ( const Color col) [inline, virtual]
Parameters:
colThe light source's color for specular reflections

References _specular.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:18 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo