-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ambient.h
53 lines (33 loc) · 911 Bytes
/
Ambient.h
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
47
48
49
50
51
52
53
#ifndef __AMBIENT__
#define __AMBIENT__
#include "Light.h"
class Ambient: public Light {
public:
Ambient(void);
Ambient(const Ambient& a);
virtual Light* clone(void) const;
Ambient& operator= (const Ambient& rhs);
virtual ~Ambient(void);
void scale_radiance(const float b);
void set_color(const float c);
void set_color(const RGBColor& c);
void set_color(const float r, const float g, const float b);
virtual Vector3D get_direction(ShadeRec& s);
virtual RGBColor L(ShadeRec& s);
private:
float ls;
RGBColor color;
};
inline void Ambient::scale_radiance(const float b) {
ls = b;
}
inline void Ambient::set_color(const float c) {
color.r = c; color.g = c; color.b = c;
}
inline void Ambient::set_color(const RGBColor& c) {
color = c;
}
inline void Ambient::set_color(const float r, const float g, const float b) {
color.r = r; color.g = g; color.b = b;
}
#endif