QuadAreaLight Class Reference

#include <QuadAreaLight.h>

Inheritance diagram for QuadAreaLight:

Light

Detailed Description

Definition at line 8 of file QuadAreaLight.h.


Public Member Functions

 QuadAreaLight (ColorRGBA power, Vector3D pos, Vector3D d1, Vector3D d2)
unsigned int GetNumberOfRays () const
 Return number of shadow rays handled by this light source.
void SetNumberOfRays (unsigned int i)
 Set number of rays.
bool Illuminate (Ray &ray, ColorRGBA &intensity, unsigned int index=0)
const Vector3DGetNormal () const
 Get normal of the quad representing the light source.

Private Attributes

ColorRGBA power
Vector3D p0
Vector3D e1
Vector3D e2
float area
Vector3D normal
unsigned int raycount

Constructor & Destructor Documentation

QuadAreaLight::QuadAreaLight ( ColorRGBA  power,
Vector3D  pos,
Vector3D  d1,
Vector3D  d2 
) [inline]

Initialize quad area light.

Parameters:
power Intensity of the light source
pos Position of the light source
d1,d2 Direction vectors spanning the quad polygon

Definition at line 25 of file QuadAreaLight.h.

References area, Cross(), e1, e2, Vector3D::Length(), normal, and Vector3D::Normalize().


Member Function Documentation

unsigned int QuadAreaLight::GetNumberOfRays (  )  const [inline, virtual]

Return number of shadow rays handled by this light source.

Reimplemented from Light.

Definition at line 39 of file QuadAreaLight.h.

References raycount.

void QuadAreaLight::SetNumberOfRays ( unsigned int  i  )  [inline]

Set number of rays.

Definition at line 42 of file QuadAreaLight.h.

References raycount.

Referenced by main().

bool QuadAreaLight::Illuminate ( Ray ray,
ColorRGBA intensity,
unsigned int  index = 0 
) [inline, virtual]

Illuminate the pixel/ray. The illumination is done in the same as for a simple point light source, but now we place the point light source randomly on the quad surface. Also the area of the quad light source has to be taken into account, by computing the intensity

Implements Light.

Definition at line 51 of file QuadAreaLight.h.

References area, Ray::dir, Dot(), e1, e2, Epsilon, frand(), Ray::hit, Vector3D::Length(), normal, Vector3D::Normalize(), Ray::org, p0, power, and Ray::t.

const Vector3D& QuadAreaLight::GetNormal (  )  const [inline]

Get normal of the quad representing the light source.

Definition at line 78 of file QuadAreaLight.h.

References normal.


Field Documentation

ColorRGBA QuadAreaLight::power [private]

Definition at line 11 of file QuadAreaLight.h.

Referenced by Illuminate().

Vector3D QuadAreaLight::p0 [private]

Definition at line 12 of file QuadAreaLight.h.

Referenced by Illuminate().

Vector3D QuadAreaLight::e1 [private]

Definition at line 12 of file QuadAreaLight.h.

Referenced by Illuminate(), and QuadAreaLight().

Vector3D QuadAreaLight::e2 [private]

Definition at line 12 of file QuadAreaLight.h.

Referenced by Illuminate(), and QuadAreaLight().

float QuadAreaLight::area [private]

Definition at line 13 of file QuadAreaLight.h.

Referenced by Illuminate(), and QuadAreaLight().

Vector3D QuadAreaLight::normal [private]

Definition at line 14 of file QuadAreaLight.h.

Referenced by GetNormal(), Illuminate(), and QuadAreaLight().

unsigned int QuadAreaLight::raycount [private]

Definition at line 15 of file QuadAreaLight.h.

Referenced by GetNumberOfRays(), and SetNumberOfRays().


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 21:48:57 2008 for RayTracer by  doxygen 1.5.4