rcrt::AreaLight Class Reference

#include <AreaLight.h>

Inheritance diagram for rcrt::AreaLight:

Inheritance graph
[legend]
Collaboration diagram for rcrt::AreaLight:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AreaLight (const RGBColor &p, const Point3D &pos, const Vec3D &dir1, const Vec3D &dir2, const Vec3D &no=Vec3D(0))
virtual ~AreaLight ()
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 ObjectgetObject ()
virtual void emitPhoton (Photon *photon) const

Protected Member Functions

Point3D getRandomPosition () const
LightSample getSample (const Point3D &p, const Vec3D &no, const Point3D &pos, Scene *s=0) const
LightSample getSample (const Point2D &uv, const Vec3D &no, const Point3D &pos, Scene *s=0) const

Protected Attributes

Point3D base
Vec3D span1
Vec3D span2
Vec3D normal
float area
AffineObject object
LightMaterial material
Triangle tri1
Triangle tri2
std::vector
< Primitive * > 
triList
float aspect

Friends

class AreaLightSampler


Detailed Description

Definition at line 13 of file AreaLight.h.


Constructor & Destructor Documentation

rcrt::AreaLight::AreaLight ( const RGBColor p,
const Point3D pos,
const Vec3D dir1,
const Vec3D dir2,
const Vec3D no = Vec3D(0) 
)

Definition at line 10 of file AreaLight.cpp.

References area, aspect, rcrt::Matrix4D::identity(), material, rcrt::Light::minSamples, rcrt::Vec3D::norm(), span1, span2, tri1, tri2, and triList.

rcrt::AreaLight::~AreaLight (  )  [virtual]

Definition at line 34 of file AreaLight.cpp.


Member Function Documentation

Point3D rcrt::AreaLight::getRandomPosition (  )  const [protected]

Definition at line 79 of file AreaLight.cpp.

References base, span1, and span2.

Referenced by illuminate().

LightSample rcrt::AreaLight::getSample ( const Point3D p,
const Vec3D no,
const Point3D pos,
Scene s = 0 
) const [inline, protected]

Definition at line 51 of file AreaLight.h.

References area, rcrt::Scene::castShadows(), rcrt::Scene::isOccluded(), rcrt::Vec3D::norm(), normal, rcrt::Vec3D::normalize(), rcrt::Vec3D::normalized(), and rcrt::Light::power.

Referenced by getSample(), illuminate(), rcrt::AreaLightSampler::sample(), and rcrt::AreaLightSampler::subdivide().

LightSample rcrt::AreaLight::getSample ( const Point2D uv,
const Vec3D no,
const Point3D pos,
Scene s = 0 
) const [inline, protected]

Definition at line 74 of file AreaLight.h.

References base, getSample(), span1, span2, rcrt::Point2D::x(), and rcrt::Point2D::y().

LightSample rcrt::AreaLight::illuminate ( const Point3D p,
const Vec3D no 
) const [virtual]

Parameters:
p the point to illuminate
no the normal at the point
Returns:
A single sample of the light source.

Implements rcrt::Light.

Definition at line 41 of file AreaLight.cpp.

References getRandomPosition(), and getSample().

void rcrt::AreaLight::illuminate ( const Point3D p,
const Vec3D no,
std::vector< LightSample > &  samples,
const int &  noSamples,
Scene s = 0 
) const [virtual]

Parameters:
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 47 of file AreaLight.cpp.

References aspect, base, getSample(), rcrt::LightSample::setWeight(), span1, span2, and rcrt::LightSample::weight().

RGBColor rcrt::AreaLight::getEmitted ( const Vec3D dir,
const Point3D pos 
) const [virtual]

Parameters:
pos the position on the light
dir the direction in which to emit
Returns:
the emitted light on the given point in the given direction

Implements rcrt::Light.

Definition at line 92 of file AreaLight.cpp.

References area, normal, and rcrt::Light::power.

Object * rcrt::AreaLight::getObject (  )  [virtual]

Returns:
An object, if any, that is a physical representation of the light in the scene.

Reimplemented from rcrt::Light.

Definition at line 87 of file AreaLight.cpp.

References object.

void rcrt::AreaLight::emitPhoton ( Photon photon  )  const [virtual]

Emits a (random) photon.

Parameters:
photon the photon in which to store initial position, direction and power

Implements rcrt::Light.

Definition at line 103 of file AreaLight.cpp.

References area, base, rcrt::Photon::getDir(), normal, rcrt::Vec3D::normalized(), rcrt::Light::power, rcrt::Photon::setDir(), rcrt::Photon::setPos(), rcrt::Photon::setPower(), span1, and span2.


Friends And Related Function Documentation

friend class AreaLightSampler [friend]

Definition at line 15 of file AreaLight.h.


Member Data Documentation

Point3D rcrt::AreaLight::base [protected]

Definition at line 18 of file AreaLight.h.

Referenced by emitPhoton(), getRandomPosition(), getSample(), illuminate(), and rcrt::AreaLightSampler::sample().

Vec3D rcrt::AreaLight::span1 [protected]

Definition at line 19 of file AreaLight.h.

Referenced by AreaLight(), emitPhoton(), getRandomPosition(), getSample(), illuminate(), and rcrt::AreaLightSampler::sample().

Vec3D rcrt::AreaLight::span2 [protected]

Definition at line 20 of file AreaLight.h.

Referenced by AreaLight(), emitPhoton(), getRandomPosition(), getSample(), illuminate(), and rcrt::AreaLightSampler::sample().

Vec3D rcrt::AreaLight::normal [protected]

Definition at line 21 of file AreaLight.h.

Referenced by emitPhoton(), getEmitted(), and getSample().

float rcrt::AreaLight::area [protected]

Definition at line 22 of file AreaLight.h.

Referenced by AreaLight(), emitPhoton(), getEmitted(), and getSample().

AffineObject rcrt::AreaLight::object [protected]

Definition at line 23 of file AreaLight.h.

Referenced by getObject().

LightMaterial rcrt::AreaLight::material [protected]

Definition at line 24 of file AreaLight.h.

Referenced by AreaLight().

Triangle rcrt::AreaLight::tri1 [protected]

Definition at line 25 of file AreaLight.h.

Referenced by AreaLight().

Triangle rcrt::AreaLight::tri2 [protected]

Definition at line 26 of file AreaLight.h.

Referenced by AreaLight().

std::vector<Primitive*> rcrt::AreaLight::triList [protected]

Definition at line 27 of file AreaLight.h.

Referenced by AreaLight().

float rcrt::AreaLight::aspect [protected]

Definition at line 28 of file AreaLight.h.

Referenced by AreaLight(), and illuminate().


The documentation for this class was generated from the following files:
Generated on Thu Jan 31 19:32:31 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3