-
-
Notifications
You must be signed in to change notification settings - Fork 385
/
Copy pathLight.h
46 lines (36 loc) · 1.16 KB
/
Light.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
// Copyright © 2008-2025 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#ifndef _LIGHT_H
#define _LIGHT_H
#include "Color.h"
#include "vector3.h"
namespace Graphics {
static const Uint32 TOTAL_NUM_LIGHTS = 4U;
class Light {
public:
enum LightType {
LIGHT_POINT,
LIGHT_SPOT,
LIGHT_DIRECTIONAL
};
Light();
Light(LightType t, const vector3f &position, const Color &diffuse, const Color &specular);
void SetType(LightType t) { m_type = t; }
void SetPosition(const vector3f &p) { m_position = p; }
void SetDiffuse(const Color &c) { m_diffuse = c; }
void SetSpecular(const Color &c) { m_specular = c; }
void SetIntensity(const float &i) { m_intensity = i; }
LightType GetType() const { return m_type; }
const vector3f &GetPosition() const { return m_position; }
const Color &GetDiffuse() const { return m_diffuse; }
const Color &GetSpecular() const { return m_specular; }
float GetIntensity() const { return m_intensity; }
private:
LightType m_type;
vector3f m_position;
float m_intensity;
Color m_diffuse;
Color m_specular;
};
} // namespace Graphics
#endif