#include <PointLight.h>
Inherits Light.
Inheritance diagram for PointLight:
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). |
Definition at line 12 of file PointLight.h.
Inititalize light source.
intensity | Intensity of the light source (color) | |
position | Position of the point light |
Definition at line 20 of file PointLight.h.
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
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? |
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().
Vec3f PointLight::mPosition [private] |
RGBAColor PointLight::mIntensity [private] |
Emission (red, green, blue, alpha here unused).
Definition at line 63 of file PointLight.h.
Referenced by illuminate().