#include <QuadAreaLight.h>
Inherits Light.
Inheritance diagram for QuadAreaLight:
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 Vec3f & | normal () 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. |
Definition at line 14 of file QuadAreaLight.h.
QuadAreaLight::QuadAreaLight | ( | const RGBAColor & | power, | |
const Vec3f & | pos, | |||
const Vec3f & | d1, | |||
const Vec3f & | d2 | |||
) | [inline] |
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 23 of file QuadAreaLight.h.
References Vec3f::cross(), Vec3f::length(), mArea, mE1, mE2, mNormal, mPower, and Vec3f::normalize().
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
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 ? |
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.
RGBAColor QuadAreaLight::mPower [private] |
Light source power.
Definition at line 102 of file QuadAreaLight.h.
Referenced by illuminate(), and QuadAreaLight().
Vec3f QuadAreaLight::mP0 [private] |
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] |
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().