#include <PointLight.h>
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. |
Inititalize light source.
position | Position of the point light | |
intensity | Intensity of the light source (color) |
Definition at line 40 of file PointLight.h.
void PointLight::changeIllumination | ( | float | fac | ) | [inline] |
Adds a constant factor to the intensity of the light.
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.
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.
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().