rcrt::SphericalLight Class Reference

#include <SphericalLight.h>

Inheritance diagram for rcrt::SphericalLight:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SphericalLight (const RGBColor &power, const float &radius, const Point3D &center, 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


Detailed Description

Definition at line 9 of file SphericalLight.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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

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 53 of file SphericalLight.cpp.

References center, illuminate(), and radius2.

RGBColor rcrt::SphericalLight::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 69 of file SphericalLight.cpp.

References rcrt::Light::power.

void rcrt::SphericalLight::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 74 of file SphericalLight.cpp.


Member Data Documentation

float rcrt::SphericalLight::radius [private]

Definition at line 12 of file SphericalLight.h.

Point3D rcrt::SphericalLight::center [private]

Definition at line 13 of file SphericalLight.h.

Referenced by illuminate().

float rcrt::SphericalLight::radius2 [private]

Definition at line 16 of file SphericalLight.h.

Referenced by illuminate().


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