TDME2  1.9.200
SceneLight.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tdme/tdme.h>
5 #include <tdme/engine/Color4.h>
7 #include <tdme/math/fwd-tdme.h>
8 #include <tdme/math/Vector3.h>
9 #include <tdme/math/Vector4.h>
10 
14 
15 /**
16  * Scene light definition
17  * @author Andreas Drewke
18  */
20 {
21 private:
22  int id;
23  bool enabled;
30  float spotExponent;
31  float spotCutOff;
35 
36 public:
37  // forbid class copy
39 
40  /**
41  * Public default constructor
42  * @param id id
43  */
44  SceneLight(int id);
45 
46  /**
47  * @return light id
48  */
49  inline int getId() {
50  return id;
51  }
52 
53  /**
54  * @return enabled
55  */
56  inline bool isEnabled() const {
57  return enabled;
58  }
59 
60  /**
61  * Set enabled
62  * @param enabled enabled
63  */
64  inline void setEnabled(bool enabled) {
65  this->enabled = enabled;
66  }
67 
68  /**
69  * @return ambient light component
70  */
71  inline const Color4& getAmbient() const {
72  return ambient;
73  }
74 
75  /**
76  * Set ambient light component
77  * @param ambient ambient light component
78  */
79  inline void setAmbient(const Color4& ambient) {
80  this->ambient = ambient;
81  }
82 
83  /**
84  * @return diffuse light component
85  */
86  inline const Color4& getDiffuse() const {
87  return diffuse;
88  }
89 
90  /**
91  * Set diffuse light component
92  * @param diffuse diffuse light
93  */
94  inline void setDiffuse(const Color4& diffuse) {
95  this->diffuse = diffuse;
96  }
97 
98  /**
99  * @return specular light component
100  */
101  inline const Color4& getSpecular() const {
102  return specular;
103  }
104 
105  /**
106  * Set specular light component
107  * @param specular specular light
108  */
109  inline void setSpecular(const Color4& specular) {
110  this->specular = specular;
111  }
112 
113  /**
114  * @return position of light
115  */
116  inline const Vector4& getPosition() const {
117  return position;
118  }
119 
120  /**
121  * Set light position
122  * @param position position of light
123  */
124  inline void setPosition(const Vector4& position) {
125  this->position = position;
126  }
127 
128  /**
129  * @return spot direction
130  */
131  inline const Vector3& getSpotDirection() const {
132  return spotDirection;
133  }
134 
135  /**
136  * Set spot direction
137  * @param spotDirection spot direction
138  */
139  inline void setSpotDirection(const Vector3& spotDirection) {
140  this->spotDirection = spotDirection;
141  }
142 
143  /**
144  * @return spot exponent
145  */
146  inline float getSpotExponent() const {
147  return spotExponent;
148  }
149 
150  /**
151  * Set up spot exponent
152  * @param spotExponent spot exponent
153  */
154  inline void setSpotExponent(float spotExponent) {
155  this->spotExponent = spotExponent;
156  }
157 
158  /**
159  * @return spot cutoff
160  */
161  inline float getSpotCutOff() const {
162  return spotCutOff;
163  }
164 
165  /**
166  * Set spot cut off
167  * @param spotCutOff spot cut off
168  */
169  inline void setSpotCutOff(float spotCutOff) {
170  this->spotCutOff = spotCutOff;
171  }
172 
173  /**
174  * @return constant attenuation
175  */
176  inline float getConstantAttenuation() const {
177  return constantAttenuation;
178  }
179 
180  /**
181  * Set up constant attenuation
182  * @param constantAttenuation constant attenuation
183  */
185  this->constantAttenuation = constantAttenuation;
186  }
187 
188  /**
189  * @return linear attenuation
190  */
191  inline float getLinearAttenuation() const {
192  return linearAttenuation;
193  }
194 
195  /**
196  * Set up linear attenuation
197  * @param linearAttenuation linear attenuation
198  */
200  this->linearAttenuation = linearAttenuation;
201  }
202 
203  /**
204  * @return quadratic attenuation
205  */
206  inline float getQuadraticAttenuation() const {
207  return quadraticAttenuation;
208  }
209 
210  /**
211  * Set up quadratic attenuation
212  * @param quadraticAttenuation quadraticAttenuation
213  */
215  this->quadraticAttenuation = quadraticAttenuation;
216  }
217 
218 };
Color 4 definition class.
Definition: Color4.h:18
Scene light definition.
Definition: SceneLight.h:20
float getQuadraticAttenuation() const
Definition: SceneLight.h:206
void setEnabled(bool enabled)
Set enabled.
Definition: SceneLight.h:64
void setSpecular(const Color4 &specular)
Set specular light component.
Definition: SceneLight.h:109
void setConstantAttenuation(float constantAttenuation)
Set up constant attenuation.
Definition: SceneLight.h:184
void setSpotDirection(const Vector3 &spotDirection)
Set spot direction.
Definition: SceneLight.h:139
const Color4 & getSpecular() const
Definition: SceneLight.h:101
const Vector3 & getSpotDirection() const
Definition: SceneLight.h:131
void setAmbient(const Color4 &ambient)
Set ambient light component.
Definition: SceneLight.h:79
float getLinearAttenuation() const
Definition: SceneLight.h:191
void setQuadraticAttenuation(float quadraticAttenuation)
Set up quadratic attenuation.
Definition: SceneLight.h:214
void setSpotCutOff(float spotCutOff)
Set spot cut off.
Definition: SceneLight.h:169
const Color4 & getAmbient() const
Definition: SceneLight.h:71
void setPosition(const Vector4 &position)
Set light position.
Definition: SceneLight.h:124
const Vector4 & getPosition() const
Definition: SceneLight.h:116
void setDiffuse(const Color4 &diffuse)
Set diffuse light component.
Definition: SceneLight.h:94
void setLinearAttenuation(float linearAttenuation)
Set up linear attenuation.
Definition: SceneLight.h:199
void setSpotExponent(float spotExponent)
Set up spot exponent.
Definition: SceneLight.h:154
float getConstantAttenuation() const
Definition: SceneLight.h:176
SceneLight(int id)
Public default constructor.
Definition: SceneLight.cpp:13
const Color4 & getDiffuse() const
Definition: SceneLight.h:86
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20
Vector4 class representing vector4 mathematical structure and operations with x, y,...
Definition: Vector4.h:22
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6