#include <DirLight.h>
Public Member Functions | |
DirLight (const RGBColor &p, const Vec3D &dir) | |
virtual | ~DirLight () |
const Vec3D & | getDirection () const |
virtual LightSample | illuminate (const Point3D &p, const Vec3D &no) const |
virtual void | illuminate (const Point3D &p, const Vec3D &no, std::vector< LightSample > &samples, const int &noSamples, Scene *s) const |
virtual RGBColor | getEmitted (const Vec3D &dir, const Point3D &pos) const |
virtual void | emitPhoton (Photon *photon) const |
Private Attributes | |
Vec3D | direction |
Definition at line 10 of file DirLight.h.
Definition at line 6 of file DirLight.cpp.
rcrt::DirLight::~DirLight | ( | ) | [virtual] |
Definition at line 10 of file DirLight.cpp.
const Vec3D & rcrt::DirLight::getDirection | ( | ) | const |
LightSample rcrt::DirLight::illuminate | ( | const Point3D & | p, | |
const Vec3D & | no | |||
) | const [virtual] |
p | the point to illuminate | |
no | the normal at the point |
Implements rcrt::Light.
Definition at line 19 of file DirLight.cpp.
References direction, and rcrt::Light::power.
Referenced by illuminate().
void rcrt::DirLight::illuminate | ( | const Point3D & | p, | |
const Vec3D & | no, | |||
std::vector< LightSample > & | samples, | |||
const int & | noSamples, | |||
Scene * | s | |||
) | const [virtual] |
p | the point to illuminate | |
no | the normal at the given point | |
samples | the vector to be filled with samples | |
noSamples | the number of samples to generate | |
s | (Optional) if used, it is up to the light to decide whether to cast shadow rays and what to use to test for occlusion. |
Implements rcrt::Light.
Definition at line 30 of file DirLight.cpp.
References illuminate().
pos | the position on the light | |
dir | the direction in which to emit |
Implements rcrt::Light.
Definition at line 36 of file DirLight.cpp.
References rcrt::Light::power.
void rcrt::DirLight::emitPhoton | ( | Photon * | photon | ) | const [virtual] |
Emits a (random) photon.
photon | the photon in which to store initial position, direction and power |
Implements rcrt::Light.
Definition at line 41 of file DirLight.cpp.
Vec3D rcrt::DirLight::direction [private] |