source: GTP/trunk/App/Demos/Illum/pathmap/Light.hpp @ 2197

Revision 2197, 712 bytes checked in by szirmay, 18 years ago (diff)
RevLine 
[2197]1#pragma once
2#include "Vector.hpp"
3
4class Light
5{
6public:
7        Vector direction;
8
9        Vector position;
10        Vector radiance;
11        Vector power;
12        float area;
13        float luminance;
14
15        Light() {};
16        Light(const Vector& position, const Vector& radiance)
17        {
18                this->position = position;
19                this->radiance = radiance;
20                luminance = radiance.r + radiance.g + radiance.b;
21                power = radiance;
22                area = 1.0f;
23        }
24        inline float getLuminance() const {return luminance;}
25        virtual float getFormFactor(const Vector& lookpoint, const Vector& normal) const =0;
26        virtual Vector getSample() const =0;
27        virtual bool isPossiblyVisible(const Vector& point) const {return true;}
28        virtual Vector getRadianceAt(const Vector& dir)
29        {
30                return radiance;
31        }
32};
Note: See TracBrowser for help on using the repository browser.