#include <Light.h>
Public Member Functions | |
Light (const RGBColor &p=RGBColor(0), const int &minS=1) | |
virtual | ~Light () |
virtual const RGBColor & | getPower () const |
virtual void | setPower (const RGBColor &pow) |
virtual LightSample | illuminate (const Point3D &p, const Vec3D &no) const =0 |
virtual void | illuminate (const Point3D &p, const Vec3D &no, std::vector< LightSample > &samples, const int &noSamples, Scene *s=0) const =0 |
virtual RGBColor | getEmitted (const Vec3D &dir, const Point3D &pos) const =0 |
virtual void | setSampler (LightSampler *ls) |
virtual LightSampler * | getSampler () const |
virtual bool | hasSampler () const |
const int & | getMinSamples () const |
virtual Object * | getObject () |
virtual void | emitPhoton (Photon *photon) const =0 |
Protected Attributes | |
RGBColor | power |
int | minSamples |
LightSampler * | sampler |
Definition at line 17 of file Light.h.
const RGBColor & rcrt::Light::getPower | ( | ) | const [virtual] |
void rcrt::Light::setPower | ( | const RGBColor & | pow | ) | [virtual] |
virtual LightSample rcrt::Light::illuminate | ( | const Point3D & | p, | |
const Vec3D & | no | |||
) | const [pure virtual] |
p | the point to illuminate | |
no | the normal at the point |
Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.
Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().
virtual void rcrt::Light::illuminate | ( | const Point3D & | p, | |
const Vec3D & | no, | |||
std::vector< LightSample > & | samples, | |||
const int & | noSamples, | |||
Scene * | s = 0 | |||
) | const [pure 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. |
Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.
virtual RGBColor rcrt::Light::getEmitted | ( | const Vec3D & | dir, | |
const Point3D & | pos | |||
) | const [pure virtual] |
pos | the position on the light | |
dir | the direction in which to emit |
Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.
Referenced by rcrt::LightMaterial::getEmitted().
void rcrt::Light::setSampler | ( | LightSampler * | ls | ) | [virtual] |
LightSampler * rcrt::Light::getSampler | ( | ) | const [virtual] |
Definition at line 36 of file Light.cpp.
References sampler.
Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().
bool rcrt::Light::hasSampler | ( | ) | const [virtual] |
Definition at line 41 of file Light.cpp.
References sampler.
Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().
const int & rcrt::Light::getMinSamples | ( | ) | const |
Definition at line 26 of file Light.cpp.
References minSamples.
Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().
Object * rcrt::Light::getObject | ( | ) | [virtual] |
Reimplemented in rcrt::AreaLight.
Definition at line 46 of file Light.cpp.
Referenced by rcrt::SceneLoader::goToFrame(), and rcrt::SceneLoader::nextFrame().
virtual void rcrt::Light::emitPhoton | ( | Photon * | photon | ) | const [pure virtual] |
Emits a (random) photon.
photon | the photon in which to store initial position, direction and power |
Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.
Referenced by rcrt::PhotonMap::generateJob().
RGBColor rcrt::Light::power [protected] |
Definition at line 20 of file Light.h.
Referenced by rcrt::PointLight::emitPhoton(), rcrt::AreaLight::emitPhoton(), rcrt::SphericalLight::getEmitted(), rcrt::PointLight::getEmitted(), rcrt::DirLight::getEmitted(), rcrt::AreaLight::getEmitted(), getPower(), rcrt::AreaLight::getSample(), rcrt::SphericalLight::illuminate(), rcrt::PointLight::illuminate(), rcrt::DirLight::illuminate(), and setPower().
int rcrt::Light::minSamples [protected] |
Definition at line 21 of file Light.h.
Referenced by rcrt::AreaLight::AreaLight(), and getMinSamples().
LightSampler* rcrt::Light::sampler [protected] |
Lights may use special sampling strategies.
Definition at line 26 of file Light.h.
Referenced by getSampler(), hasSampler(), and setSampler().