Light Class Reference

#include <Light.h>

Inherited by PointLight, and QuadAreaLight.

Inheritance diagram for Light:

Inheritance graph
[legend]
Collaboration diagram for Light:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Light ()
virtual ~Light ()
virtual RGBAColor illuminate (Vec3f &dir, const Vec3f &org, unsigned int index=0) const =0
virtual unsigned int numberOfRays () const
virtual void setNumberOfRays (unsigned int)=0
void setScene (Scene *newScene)
Scenescene ()

Protected Attributes

ScenemScene
 Light is in this scene.

Detailed Description

Base class for light sources

Author:
Alex Busenius

Christian Engels

Definition at line 17 of file Light.h.


Constructor & Destructor Documentation

Light::Light (  )  [inline]

Default constructor

Definition at line 22 of file Light.h.

virtual Light::~Light (  )  [inline, virtual]

Destructor

Definition at line 29 of file Light.h.


Member Function Documentation

virtual RGBAColor Light::illuminate ( Vec3f dir,
const Vec3f org,
unsigned int  index = 0 
) const [pure virtual]

Calculates the color value if you can set up a ray from org to this light source

Parameters:
dir This vector is initialized with the direction to the light source
org The origin for the ray (most likely the hit point
index The index of the light source?
Returns:
The illuminance value

Implemented in PointLight, and QuadAreaLight.

Referenced by PhongShader::shade(), and CookTorranceShader::shade().

virtual unsigned int Light::numberOfRays (  )  const [inline, virtual]

Return number of rays required to accomplish the shading produced by this light. (i.e. Point light = 1 ray) area light = n rays)

Reimplemented in QuadAreaLight.

Definition at line 45 of file Light.h.

Referenced by PhongShader::shade(), and CookTorranceShader::shade().

virtual void Light::setNumberOfRays ( unsigned  int  )  [pure virtual]

Set number of rays

Implemented in PointLight, and QuadAreaLight.

void Light::setScene ( Scene newScene  )  [inline]

Set the scene

Definition at line 56 of file Light.h.

References mScene.

Referenced by Scene::addLight().

Scene* Light::scene (  )  [inline]

Returns:
returns the setted scene

Definition at line 65 of file Light.h.

References mScene.


Member Data Documentation

Scene* Light::mScene [protected]

Light is in this scene.

Definition at line 73 of file Light.h.

Referenced by QuadAreaLight::illuminate(), PointLight::illuminate(), scene(), and setScene().


The documentation for this class was generated from the following file:
Generated on Fri Feb 1 00:02:19 2008 for Grayfall by  doxygen 1.5.1