rcrt::PointLight Class Reference

#include <PointLight.h>

Inheritance diagram for rcrt::PointLight:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PointLight (RGBColor p, Point3D pos)
virtual ~PointLight ()
const Point3DgetPosition () 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


Detailed Description

Definition at line 10 of file PointLight.h.


Constructor & Destructor Documentation

rcrt::PointLight::PointLight ( RGBColor  p,
Point3D  pos 
)

Definition at line 6 of file PointLight.cpp.

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

Definition at line 10 of file PointLight.cpp.


Member Function Documentation

const Point3D & rcrt::PointLight::getPosition (  )  const

Definition at line 14 of file PointLight.cpp.

References position.

LightSample rcrt::PointLight::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 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]

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 36 of file PointLight.cpp.

References illuminate().

RGBColor rcrt::PointLight::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 42 of file PointLight.cpp.

References rcrt::Light::power.

void rcrt::PointLight::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 47 of file PointLight.cpp.

References position, rcrt::Light::power, rcrt::Photon::setDir(), rcrt::Photon::setPos(), and rcrt::Photon::setPower().


Member Data Documentation

Point3D rcrt::PointLight::position [private]

Definition at line 13 of file PointLight.h.

Referenced by emitPhoton(), getPosition(), and illuminate().


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