#include <QuadAreaLight.h>
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 Vector3D & | GetNormal () 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 |
Initialize quad area light.
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().
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.
ColorRGBA QuadAreaLight::power [private] |
Vector3D QuadAreaLight::p0 [private] |
Vector3D QuadAreaLight::e1 [private] |
Vector3D QuadAreaLight::e2 [private] |
float QuadAreaLight::area [private] |
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().