#include <Light.h>
Inherited by PointLight, and QuadAreaLight.
Inheritance diagram for Light:
Public Member Functions | |
Light () | |
virtual | ~Light () |
virtual RGBAColor | illuminate (Vec3f &dir, const Vec3f &org, unsigned int index=0) const =0 |
virtual unsigned int | numberOfRays () const |
virtual void | setNumberOfRays (unsigned int)=0 |
void | setScene (Scene *newScene) |
Scene * | scene () |
Protected Attributes | |
Scene * | mScene |
Light is in this scene. |
Definition at line 17 of file Light.h.
virtual RGBAColor Light::illuminate | ( | Vec3f & | dir, | |
const Vec3f & | org, | |||
unsigned int | index = 0 | |||
) | const [pure virtual] |
Calculates the color value if you can set up a ray from org to this light source
dir | This vector is initialized with the direction to the light source | |
org | The origin for the ray (most likely the hit point | |
index | The index of the light source? |
Implemented in PointLight, and QuadAreaLight.
Referenced by PhongShader::shade(), and CookTorranceShader::shade().
virtual unsigned int Light::numberOfRays | ( | ) | const [inline, virtual] |
Return number of rays required to accomplish the shading produced by this light. (i.e. Point light = 1 ray) area light = n rays)
Reimplemented in QuadAreaLight.
Definition at line 45 of file Light.h.
Referenced by PhongShader::shade(), and CookTorranceShader::shade().
virtual void Light::setNumberOfRays | ( | unsigned | int | ) | [pure virtual] |
Set number of rays
Implemented in PointLight, and QuadAreaLight.
void Light::setScene | ( | Scene * | newScene | ) | [inline] |
Set the scene
Definition at line 56 of file Light.h.
References mScene.
Referenced by Scene::addLight().
Scene* Light::scene | ( | ) | [inline] |
Scene* Light::mScene [protected] |
Light is in this scene.
Definition at line 73 of file Light.h.
Referenced by QuadAreaLight::illuminate(), PointLight::illuminate(), scene(), and setScene().