Pioneer
Loading...
Searching...
No Matches
Light.h
Go to the documentation of this file.
1// Copyright © 2008-2023 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
10namespace 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
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 void SetIntensity(const float &i) { m_intensity = i; }
29
30 LightType GetType() const { return m_type; }
31 const vector3f &GetPosition() const { return m_position; }
32 const Color &GetDiffuse() const { return m_diffuse; }
33 const Color &GetSpecular() const { return m_specular; }
34 float GetIntensity() const { return m_intensity; }
35
36 private:
37 LightType m_type;
38 vector3f m_position;
39 float m_intensity;
40 Color m_diffuse;
41 Color m_specular;
42 };
43
44} // namespace Graphics
45
46#endif
Definition Light.h:14
void SetDiffuse(const Color &c)
Definition Light.h:26
const vector3f & GetPosition() const
Definition Light.h:31
Light()
Definition Light.cpp:8
LightType
Definition Light.h:16
@ LIGHT_POINT
Definition Light.h:17
@ LIGHT_SPOT
Definition Light.h:18
@ LIGHT_DIRECTIONAL
Definition Light.h:19
void SetSpecular(const Color &c)
Definition Light.h:27
LightType GetType() const
Definition Light.h:30
const Color & GetSpecular() const
Definition Light.h:33
void SetIntensity(const float &i)
Definition Light.h:28
void SetPosition(const vector3f &p)
Definition Light.h:25
const Color & GetDiffuse() const
Definition Light.h:32
void SetType(LightType t)
Definition Light.h:24
float GetIntensity() const
Definition Light.h:34
Definition Background.h:14
Definition Color.h:66