Rev | Line | |
---|
[2891] | 1 | #ifndef __LIGHT_H
|
---|
| 2 | #define __LIGHT_H
|
---|
| 3 |
|
---|
| 4 | #include "common.h"
|
---|
| 5 | #include "Vector3.h"
|
---|
| 6 | #include "Material.h"
|
---|
| 7 |
|
---|
| 8 |
|
---|
| 9 | namespace CHCDemoEngine
|
---|
| 10 | {
|
---|
| 11 |
|
---|
| 12 | /** Class representing a directional light source
|
---|
| 13 | */
|
---|
[2952] | 14 | class DirectionalLight
|
---|
[2891] | 15 | {
|
---|
| 16 | public:
|
---|
| 17 |
|
---|
[2968] | 18 | DirectionalLight(const Vector3 &dir, const RgbaColor &amb, const RgbaColor &dif):
|
---|
| 19 | mAmbient(amb), mDiffuse(dif) { mDirection = Normalize(dir); }
|
---|
[2891] | 20 |
|
---|
[2954] | 21 | void SetDirection(const Vector3 &dir) { mDirection = dir; }
|
---|
[2968] | 22 |
|
---|
| 23 | void SetDiffuseColor(const RgbaColor &dif) { mDiffuse = dif; }
|
---|
| 24 |
|
---|
| 25 | void SetAmbientColor(const RgbaColor &amb) { mAmbient = amb; }
|
---|
[2891] | 26 |
|
---|
[2968] | 27 | Vector3 GetDirection() const { return mDirection; }
|
---|
| 28 | RgbaColor GetDiffuseColor() const { return mDiffuse; }
|
---|
| 29 | RgbaColor GetAmbientColor() const { return mAmbient; }
|
---|
[2891] | 30 |
|
---|
| 31 |
|
---|
| 32 | protected:
|
---|
| 33 |
|
---|
| 34 | Vector3 mDirection;
|
---|
[2968] | 35 |
|
---|
| 36 | RgbaColor mDiffuse;
|
---|
| 37 | RgbaColor mAmbient;
|
---|
[2891] | 38 | };
|
---|
| 39 |
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | #endif // __LIGHT_H |
---|
Note: See
TracBrowser
for help on using the repository browser.