Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

toxic::IAreaLight Class Reference

#include <iarealight.h>

Inheritance diagram for toxic::IAreaLight:

toxic::IBoundedObject toxic::ILight toxic::IObject toxic::Basis toxic::Cube toxic::Mesh toxic::Ring toxic::Sphere toxic::Square List of all members.

Public Member Functions

 IAreaLight (const sheep::Matrix4 &m, const ISurfaceShader *surface_shader, IntersectionMask intersection_mask=INTERSECT_ALL_RAYS)
 m is the object space to world space transformation matrix.

virtual ~IAreaLight ()
virtual void Finalize (const Context &context)
virtual const Color3GetPower () const
 Returns the emission power of this object, expressed in W.

virtual Ray GeneratePhotonRay (const Context &context) const
virtual void ComputeIrradiance (const Context &context, const Scene *scene, const sheep::Point3 &point, const sheep::Vector3 &geometric_normal, const sheep::Vector3 &shading_normal, const ISurfaceSampler::SampleVector &input, IrradianceSampleVector *output) const

Protected Attributes

sheep::Real m_surface_area
 Cached value of the surface area of this object, expressed in m^2.

Color3 m_power
 Emission power of this object, expressed in W.


Constructor & Destructor Documentation

IAreaLight::IAreaLight const sheep::Matrix4 m,
const ISurfaceShader surface_shader,
IntersectionMask  intersection_mask = INTERSECT_ALL_RAYS
 

m is the object space to world space transformation matrix.

Definition at line 44 of file iarealight.cpp.

virtual toxic::IAreaLight::~IAreaLight  )  [inline, virtual]
 

Definition at line 51 of file iarealight.h.


Member Function Documentation

void IAreaLight::ComputeIrradiance const Context context,
const Scene scene,
const sheep::Point3 point,
const sheep::Vector3 geometric_normal,
const sheep::Vector3 shading_normal,
const ISurfaceSampler::SampleVector input,
IrradianceSampleVector output
const [virtual]
 

Computes irradiance due to this light source. The point and the surface normal are both expressed in world space.

Todo:
Not sure which normal to use.

Implements toxic::ILight.

Reimplemented in toxic::Sphere.

Definition at line 89 of file iarealight.cpp.

References toxic::Scene::ArePointsMutuallyVisible(), toxic::IBoundedObject::EvaluateSurface(), toxic::ISurfaceShader::GetEDF(), toxic::IEDF::GetEmittedRadiance(), toxic::ISurfaceShader::GetRadiantExitance(), toxic::IObject::GetSurfaceShader(), sheep::Vector3::IsUnitLength(), toxic::Statistics::m_shadow_rays, toxic::Context::m_statistics, m_surface_area, toxic::ISurfaceSampler::SampleVector, and sheep::Vector3::SquareNorm().

void IAreaLight::Finalize const Context context  )  [virtual]
 

This method must be called only once, after the object is completely configured, and before it is used for the first time.

Reimplemented from toxic::IObject.

Reimplemented in toxic::Mesh.

Definition at line 52 of file iarealight.cpp.

References toxic::IBoundedObject::ComputeSurfaceArea(), toxic::ISurfaceShader::GetRadiantExitance(), m_power, and m_surface_area.

Referenced by toxic::Mesh::Finalize().

Ray IAreaLight::GeneratePhotonRay const Context context  )  const [virtual]
 

Implements toxic::ILight.

Definition at line 60 of file iarealight.cpp.

References toxic::IBoundedObject::EvaluateSurface(), toxic::ISurfaceShader::GetEDF(), toxic::IObject::GetSurfaceShader(), toxic::Ray::m_direction, toxic::Ray::m_origin, toxic::Context::m_rng, sheep::MT19937RNG::RandomReal1(), and toxic::IEDF::Sample().

const Color3 & IAreaLight::GetPower  )  const [inline, virtual]
 

Returns the emission power of this object, expressed in W.

Implements toxic::ILight.

Definition at line 102 of file iarealight.h.


Member Data Documentation

Color3 toxic::IAreaLight::m_power [protected]
 

Emission power of this object, expressed in W.

Definition at line 76 of file iarealight.h.

Referenced by Finalize().

sheep::Real toxic::IAreaLight::m_surface_area [protected]
 

Cached value of the surface area of this object, expressed in m^2.

Definition at line 75 of file iarealight.h.

Referenced by ComputeIrradiance(), and Finalize().


The documentation for this class was generated from the following files:
Generated on Tue May 11 01:31:57 2004 for toxic by doxygen 1.3.6