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

toxic::PointLight Class Reference

The point light is located at the origin. More...

#include <pointlight.h>

Inheritance diagram for toxic::PointLight:

toxic::Basis toxic::ILight List of all members.

Public Member Functions

 PointLight (const sheep::Matrix4 &m, const Color3 &power, bool cast_shadows=true)
 m is the object space to world space transformation matrix.

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 &, IrradianceSampleVector *output) const

Private Attributes

sheep::Point3 m_origin
 Location of the point light in world space.

Color3 m_power
 Emission power of the light, expressed in W.

Color3 m_scaled_power
 m_scaled_power = m_power / (4.0 * PI)


Detailed Description

The point light is located at the origin.

Definition at line 44 of file pointlight.h.


Constructor & Destructor Documentation

PointLight::PointLight const sheep::Matrix4 m,
const Color3 power,
bool  cast_shadows = true
 

m is the object space to world space transformation matrix.

Parameters:
power  Power of the light, expressed in W (not W.m^-2!).

Definition at line 34 of file pointlight.cpp.

References sheep::PI.


Member Function Documentation

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

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

Implements toxic::ILight.

Definition at line 45 of file pointlight.cpp.

References toxic::Scene::ArePointsMutuallyVisible(), sheep::Vector3::IsUnitLength(), m_origin, m_scaled_power, toxic::Statistics::m_shadow_rays, toxic::Context::m_statistics, toxic::ISurfaceSampler::SampleVector, and sheep::Vector3::SquareNorm().

Ray PointLight::GeneratePhotonRay const Context context  )  const [inline, virtual]
 

Implements toxic::ILight.

Definition at line 103 of file pointlight.h.

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

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

Implements toxic::ILight.

Definition at line 98 of file pointlight.h.


Member Data Documentation

sheep::Point3 toxic::PointLight::m_origin [private]
 

Location of the point light in world space.

Definition at line 70 of file pointlight.h.

Referenced by ComputeIrradiance().

Color3 toxic::PointLight::m_power [private]
 

Emission power of the light, expressed in W.

Definition at line 71 of file pointlight.h.

Color3 toxic::PointLight::m_scaled_power [private]
 

m_scaled_power = m_power / (4.0 * PI)

Definition at line 72 of file pointlight.h.

Referenced by ComputeIrradiance().


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