PointLight Class Reference

#include <PointLight.h>

Inherits Light.

Inheritance diagram for PointLight:

Inheritance graph
[legend]
Collaboration diagram for PointLight:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PointLight (const RGBAColor &intensity, const Vec3f &position)
void setNumberOfRays (unsigned int)
RGBAColor illuminate (Vec3f &dir, const Vec3f &org, unsigned int) const

Private Attributes

Vec3f mPosition
 Origin.
RGBAColor mIntensity
 Emission (red, green, blue, alpha here unused).

Detailed Description

Point light source

Author:
Alex Busenius

Christian Engels

Definition at line 12 of file PointLight.h.


Constructor & Destructor Documentation

PointLight::PointLight ( const RGBAColor intensity,
const Vec3f position 
) [inline]

Inititalize light source.

Parameters:
intensity Intensity of the light source (color)
position Position of the point light

Definition at line 20 of file PointLight.h.


Member Function Documentation

void PointLight::setNumberOfRays ( unsigned int   )  [inline, virtual]

Set number of rays. The argument is ignored since a point light source only needs 1 ray.

Implements Light.

Definition at line 30 of file PointLight.h.

RGBAColor PointLight::illuminate ( Vec3f dir,
const Vec3f org,
unsigned int   
) const [inline, virtual]

Calculates the illuminance

Parameters:
dir This vector is initialized with the direction to the light source
org The point which should be illuminated
index The number of the shadow ray?
Returns:
Illuminance color, if the object is in the shadow we return black

Implements Light.

Definition at line 39 of file PointLight.h.

References Primitive::castShadows(), Scene::castShadows(), EPSILON, Ray::hit(), Ray::init(), Scene::intersect(), Vec3f::length(), mIntensity, mPosition, Light::mScene, Vec3f::normalize(), RGBAColor::rgb(), and Ray::t().


Member Data Documentation

Vec3f PointLight::mPosition [private]

Origin.

Definition at line 60 of file PointLight.h.

Referenced by illuminate().

RGBAColor PointLight::mIntensity [private]

Emission (red, green, blue, alpha here unused).

Definition at line 63 of file PointLight.h.

Referenced by illuminate().


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