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