-
Notifications
You must be signed in to change notification settings - Fork 0
/
Light.hh
46 lines (31 loc) · 854 Bytes
/
Light.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef Light_hh
#define Light_hh
#include "Color.hh"
#include "Vector.hh"
#include "RenderContext.hh"
#include "Point.hh"
class Light{
private:
public:
virtual void Preprocess() = 0;
virtual float GetLight(Color& lcolor, Vector& ldir, const RenderContext& rc, const Point& hp) const=0;
};
class PointLight : public Light{
private:
Point p;
Color color;
public:
PointLight(Point p, Color color);
void Preprocess();
float GetLight(Color& lcolor, Vector& ldir, const RenderContext& rc, const Point& hp) const;
};
class DirectionalLight : public Light{
private:
Vector dir;
Color color;
public:
DirectionalLight(Vector dir, Color color);
void Preprocess();
float GetLight(Color& lcolor, Vector& ldir, const RenderContext& rc, const Point& hp) const;
};
#endif