#include <SphericalLight.h>
Public Member Functions | |
SphericalLight (const RGBColor &power, const float &radius, const Point3D ¢er, const int &samples=4) | |
virtual | ~SphericalLight () |
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=0) const |
virtual RGBColor | getEmitted (const Vec3D &dir, const Point3D &pos) const |
virtual void | emitPhoton (Photon *photon) const |
Private Attributes | |
float | radius |
Point3D | center |
float | radius2 |
Definition at line 9 of file SphericalLight.h.
rcrt::SphericalLight::SphericalLight | ( | const RGBColor & | power, | |
const float & | radius, | |||
const Point3D & | center, | |||
const int & | samples = 4 | |||
) |
Definition at line 6 of file SphericalLight.cpp.
rcrt::SphericalLight::~SphericalLight | ( | ) | [virtual] |
Definition at line 12 of file SphericalLight.cpp.
LightSample rcrt::SphericalLight::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 17 of file SphericalLight.cpp.
References center, rcrt::Light::power, and radius2.
Referenced by illuminate().
void rcrt::SphericalLight::illuminate | ( | const Point3D & | p, | |
const Vec3D & | no, | |||
std::vector< LightSample > & | samples, | |||
const int & | noSamples, | |||
Scene * | s = 0 | |||
) | 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 53 of file SphericalLight.cpp.
References center, illuminate(), and radius2.
RGBColor rcrt::SphericalLight::getEmitted | ( | const Vec3D & | dir, | |
const Point3D & | pos | |||
) | const [virtual] |
pos | the position on the light | |
dir | the direction in which to emit |
Implements rcrt::Light.
Definition at line 69 of file SphericalLight.cpp.
References rcrt::Light::power.
void rcrt::SphericalLight::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 74 of file SphericalLight.cpp.
float rcrt::SphericalLight::radius [private] |
Definition at line 12 of file SphericalLight.h.
Point3D rcrt::SphericalLight::center [private] |
float rcrt::SphericalLight::radius2 [private] |