HyperspaceExplorer 0.7.1
Public Member Functions | Protected Member Functions | Private Attributes
Light Class Reference

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

#include <Light.h>

Inheritance diagram for Light:
Inheritance graph
[legend]
Collaboration diagram for Light:
Collaboration graph
[legend]

List of all members.

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 ColorgetAmbient () const
virtual const ColorgetDiffuse () const
virtual const ColorgetSpecular () const

Private Attributes

LightSource _lightSource
 The LightSource object defining the properties of the Light.

Detailed Description

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.

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

Constructor & Destructor Documentation

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.

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& Light::getAmbient ( ) const [inline, protected, virtual]
Returns:
The light source's ambient color

References _lightSource, and LightSource::getAmbient().

Referenced by LightOpenGL::render().

Here is the call graph for this function:

Here is the caller graph for this function:

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

References _lightSource, and LightSource::getDiffuse().

Referenced by LightOpenGL::render().

Here is the call graph for this function:

Here is the caller graph for this function:

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

References _lightSource, and LightSource::getPosition().

Referenced by LightOpenGL::render().

Here is the call graph for this function:

Here is the caller graph for this function:

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

References _lightSource, and LightSource::getSpecular().

Referenced by LightOpenGL::render().

Here is the call graph for this function:

Here is the caller graph for this function:

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.


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