Pioneer
Light.h
Go to the documentation of this file.
1 // Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
2 // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3 
4 #ifndef _LIGHT_H
5 #define _LIGHT_H
6 
7 #include "Color.h"
8 #include "vector3.h"
9 
10 namespace Graphics {
11 
12  static const Uint32 TOTAL_NUM_LIGHTS = 4U;
13 
14  class Light {
15  public:
16  enum LightType {
20  };
21  Light();
22  Light(LightType t, const vector3f &position, const Color &diffuse, const Color &specular);
23  virtual ~Light() {}
24  void SetType(LightType t) { m_type = t; }
25  void SetPosition(const vector3f &p) { m_position = p; }
26  void SetDiffuse(const Color &c) { m_diffuse = c; }
27  void SetSpecular(const Color &c) { m_specular = c; }
28 
29  LightType GetType() const { return m_type; }
30  const vector3f &GetPosition() const { return m_position; }
31  const Color &GetDiffuse() const { return m_diffuse; }
32  const Color &GetSpecular() const { return m_specular; }
33 
34  private:
35  LightType m_type;
36  vector3f m_position;
37  Color m_diffuse;
38  Color m_specular;
39  };
40 
41 } // namespace Graphics
42 
43 #endif
Definition: Light.h:14
void SetDiffuse(const Color &c)
Definition: Light.h:26
Light()
Definition: Light.cpp:8
const vector3f & GetPosition() const
Definition: Light.h:30
LightType
Definition: Light.h:16
@ LIGHT_POINT
Definition: Light.h:17
@ LIGHT_SPOT
Definition: Light.h:18
@ LIGHT_DIRECTIONAL
Definition: Light.h:19
virtual ~Light()
Definition: Light.h:23
void SetSpecular(const Color &c)
Definition: Light.h:27
LightType GetType() const
Definition: Light.h:29
const Color & GetDiffuse() const
Definition: Light.h:31
void SetPosition(const vector3f &p)
Definition: Light.h:25
const Color & GetSpecular() const
Definition: Light.h:32
void SetType(LightType t)
Definition: Light.h:24
Definition: Background.h:13
Definition: Color.h:66