#include <PointLight.h>
Public Member Functions | |
PointLight (RGBColor p, Point3D pos) | |
virtual | ~PointLight () |
const Point3D & | getPosition () 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 | |
Point3D | position |
Definition at line 10 of file PointLight.h.
Definition at line 6 of file PointLight.cpp.
rcrt::PointLight::~PointLight | ( | ) | [virtual] |
Definition at line 10 of file PointLight.cpp.
const Point3D & rcrt::PointLight::getPosition | ( | ) | const |
LightSample rcrt::PointLight::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 PointLight.cpp.
References rcrt::Vec3D::norm(), rcrt::Vec3D::normalize(), position, and rcrt::Light::power.
Referenced by illuminate().
void rcrt::PointLight::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 36 of file PointLight.cpp.
References illuminate().
pos | the position on the light | |
dir | the direction in which to emit |
Implements rcrt::Light.
Definition at line 42 of file PointLight.cpp.
References rcrt::Light::power.
void rcrt::PointLight::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 47 of file PointLight.cpp.
References position, rcrt::Light::power, rcrt::Photon::setDir(), rcrt::Photon::setPos(), and rcrt::Photon::setPower().
Point3D rcrt::PointLight::position [private] |
Definition at line 13 of file PointLight.h.
Referenced by emitPhoton(), getPosition(), and illuminate().