PointLight Class Reference

#include <PointLight.h>

Inheritance diagram for PointLight:

Light

Detailed Description

Inherits from Light. This light consists only of a point that works as light source.

Definition at line 16 of file PointLight.h.


Public Member Functions

 PointLight (Vector3D position, ColorRGBA intensity)
 Inititalize light source.
void changeIllumination (float fac)
 Adds a constant factor to the intensity of the light.
bool Illuminate (Ray &ray, ColorRGBA &intensity, unsigned int index=0)
 Illuminate a ray by this light source. The illumination is done by computing the attenuation factor which is based on the distance to the surface point and the light source.

Private Attributes

Vector3D position
 The position of the light.
ColorRGBA intensity
 The emission of the lightsource.

Constructor & Destructor Documentation

PointLight::PointLight ( Vector3D  position,
ColorRGBA  intensity 
) [inline]

Inititalize light source.

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

Definition at line 40 of file PointLight.h.


Member Function Documentation

void PointLight::changeIllumination ( float  fac  )  [inline]

Adds a constant factor to the intensity of the light.

Parameters:
fac The factor to be added.

Definition at line 51 of file PointLight.h.

References ColorRGBA::blue(), ColorRGBA::green(), intensity, and ColorRGBA::red().

Referenced by main().

bool PointLight::Illuminate ( Ray ray,
ColorRGBA intensity,
unsigned int  index = 0 
) [inline, virtual]

Illuminate a ray by this light source. The illumination is done by computing the attenuation factor which is based on the distance to the surface point and the light source.

Parameters:
ray The ray that has hit a surface.
intensity The intensity of the light that arrives at the surface is saved in this value.
index ??

Implements Light.

Definition at line 66 of file PointLight.h.

References Ray::dir, Epsilon, Ray::hit, Vector3D::Length(), Vector3D::Normalize(), Ray::org, position, and Ray::t.


Field Documentation

Vector3D PointLight::position [private]

The position of the light.

Vector3D position

Definition at line 24 of file PointLight.h.

Referenced by Illuminate().

ColorRGBA PointLight::intensity [private]

The emission of the lightsource.

ColorRGBA intensity

Definition at line 30 of file PointLight.h.

Referenced by changeIllumination().


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 21:48:56 2008 for RayTracer by  doxygen 1.5.4