QuadAreaLight Class Reference

#include <QuadAreaLight.h>

Inherits Light.

Inheritance diagram for QuadAreaLight:

Inheritance graph
[legend]
Collaboration diagram for QuadAreaLight:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 QuadAreaLight (const RGBAColor &power, const Vec3f &pos, const Vec3f &d1, const Vec3f &d2)
unsigned int numberOfRays () const
void setNumberOfRays (unsigned int i)
RGBAColor illuminate (Vec3f &dir, const Vec3f &org, unsigned int) const
const Vec3fnormal () const

Private Attributes

RGBAColor mPower
 Light source power.
Vec3f mP0
 Position.
Vec3f mE1
 Span vector.
Vec3f mE2
 Another span vector.
float mArea
 Light area.
Vec3f mNormal
 Normal vector of the surface.
unsigned int mRaycount
 Number of rays needed to calculate the illuminance.

Detailed Description

This class represents a quad area light source

Author:
Alex Busenius

Christian Engels

Definition at line 14 of file QuadAreaLight.h.


Constructor & Destructor Documentation

QuadAreaLight::QuadAreaLight ( const RGBAColor power,
const Vec3f pos,
const Vec3f d1,
const Vec3f 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 23 of file QuadAreaLight.h.

References Vec3f::cross(), Vec3f::length(), mArea, mE1, mE2, mNormal, mPower, and Vec3f::normalize().


Member Function Documentation

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

Return number of shadow rays handled by this light source

Reimplemented from Light.

Definition at line 49 of file QuadAreaLight.h.

References mRaycount.

void QuadAreaLight::setNumberOfRays ( unsigned int  i  )  [inline, virtual]

Set number of rays

Implements Light.

Definition at line 53 of file QuadAreaLight.h.

References mRaycount.

Referenced by QuadAreaLightFactory::create().

RGBAColor QuadAreaLight::illuminate ( Vec3f dir,
const Vec3f org,
unsigned int   
) const [inline, virtual]

Calculates the illuminance

Parameters:
dir This vector is initialized with the direction to the light source
org The point which should be illuminated
index The number of the shadowray ?
Returns:
Illuminance color, if the object is in the shadow we return black

Implements Light.

Definition at line 62 of file QuadAreaLight.h.

References Primitive::castShadows(), Scene::castShadows(), Vec3f::dot(), EPSILON, frand(), Ray::hit(), Ray::init(), Scene::intersect(), Vec3f::length(), mE1, mE2, mNormal, mP0, mPower, mRaycount, Light::mScene, Vec3f::normalize(), and Ray::t().

const Vec3f& QuadAreaLight::normal (  )  const [inline]

Get normal of the quad representing the light source

Definition at line 94 of file QuadAreaLight.h.

References mNormal.


Member Data Documentation

RGBAColor QuadAreaLight::mPower [private]

Light source power.

Definition at line 102 of file QuadAreaLight.h.

Referenced by illuminate(), and QuadAreaLight().

Vec3f QuadAreaLight::mP0 [private]

Position.

Definition at line 105 of file QuadAreaLight.h.

Referenced by illuminate().

Vec3f QuadAreaLight::mE1 [private]

Span vector.

Definition at line 108 of file QuadAreaLight.h.

Referenced by illuminate(), and QuadAreaLight().

Vec3f QuadAreaLight::mE2 [private]

Another span vector.

Definition at line 111 of file QuadAreaLight.h.

Referenced by illuminate(), and QuadAreaLight().

float QuadAreaLight::mArea [private]

Light area.

Definition at line 114 of file QuadAreaLight.h.

Referenced by QuadAreaLight().

Vec3f QuadAreaLight::mNormal [private]

Normal vector of the surface.

Definition at line 117 of file QuadAreaLight.h.

Referenced by illuminate(), normal(), and QuadAreaLight().

unsigned int QuadAreaLight::mRaycount [private]

Number of rays needed to calculate the illuminance.

Definition at line 120 of file QuadAreaLight.h.

Referenced by illuminate(), numberOfRays(), and setNumberOfRays().


The documentation for this class was generated from the following file:
Generated on Fri Feb 1 00:02:24 2008 for Grayfall by  doxygen 1.5.1