TDME2  1.9.200
SkyRenderShader.cpp
Go to the documentation of this file.
2 
3 #include <memory>
4 #include <string>
5 
6 #include <tdme/tdme.h>
11 #include <tdme/engine/Camera.h>
12 #include <tdme/engine/Color4.h>
13 #include <tdme/engine/Engine.h>
15 #include <tdme/engine/Light.h>
16 #include <tdme/engine/Texture.h>
17 #include <tdme/engine/Timing.h>
18 #include <tdme/math/Math.h>
19 #include <tdme/math/Vector3.h>
20 #include <tdme/math/Vector4.h>
21 
22 using std::string;
23 using std::make_unique;
24 
26 
38 using tdme::math::Math;
41 
42 SkyRenderShader::SkyRenderShader(Renderer* renderer)
43 {
44  this->renderer = renderer;
45 }
46 
48 {
49 }
50 
52 {
53  return initialized;
54 }
55 
57 {
58  //
59  auto shaderVersion = renderer->getShaderVersion();
60 
61  //
64  "shader/" + shaderVersion + "/framebuffer",
65  "render_vertexshader.vert"
66  );
67  if (vertexShaderId == 0) return;
68 
71  "shader/" + shaderVersion + "/framebuffer/sky",
72  "render_fragmentshader.frag"
73  );
74  if (fragmentShaderId == 0) return;
75 
82  }
83  if (renderer->linkProgram(programId) == false) return;
84 
85  //
87  if (uniformLIGHT0_ENABLED == -1) return;
89  if (uniformLIGHT0_DIRECTION == -1) return;
91  if (uniformLIGHT1_ENABLED == -1) return;
93  if (uniformLIGHT1_DIRECTION == -1) return;
95  if (uniformStarsTexture == -1) return;
97  if (uniformLightScatteringPass == -1) return;
99  if (uniformTime == -1) return;
101  if (uniformAspectRatio == -1) return;
103  if (uniformForwardVector == -1) return;
105  if (uniformSideVector == -1) return;
107  if (uniformUpVector == -1) return;
108  //
109  // sky
111  if (uniformDayTopColor == -1) return;
113  if (uniformDayBottomColor == -1) return;
115  if (uniformSunsetTopColor == -1) return;
117  if (uniformSunsetBottomColor == -1) return;
119  if (uniformNightTopColor == -1) return;
121  if (uniformNightBottomColor == -1) return;
122  // horizon
124  if (uniformHorizonColor == -1) return;
126  if (uniformHorizonBlur == -1) return;
127  // sun
129  if (uniformSunColorFactor == -1) return;
131  if (uniformSunColor == -1) return;
133  if (uniformSunSunsetColor == -1) return;
135  if (uniformSunSize == -1) return;
137  if (uniformSunBlur == -1) return;
138  // moon
140  if (uniformMoonColorFactor == -1) return;
142  if (uniformMoonColor == -1) return;
144  if (uniformMoonSize == -1) return;
146  if (uniformMoonBlur == -1) return;
147  // clouds
149  if (uniformCloudsEdgeColor == -1) return;
151  if (uniformCloudsTopColor == -1) return;
153  if (uniformCloudsMiddleColor == -1) return;
155  if (uniformCloudsBottomColor == -1) return;
157  if (uniformCloudsSpeed == -1) return;
159  if (uniformCloudsDirection == -1) return;
161  if (uniformCloudsScale == -1) return;
163  if (uniformCloudsCutoff == -1) return;
165  if (uniformCloudsFuzziness == -1) return;
167  if (uniformCloudsWeight == -1) return;
169  if (uniformCloudsBlur == -1) return;
171  if (uniformStarsSpeed == -1) return;
172 
173  //
174  loadTextures(".");
175 
176  //
178  Engine::ShaderType::SHADERTYPE_SKY,
179  "sky",
180  {
181  // manual placing of sun and moon via shader parameters
182  { "manual_t", ShaderParameter(false) },
183  { "t", ShaderParameter(0.15f), ShaderParameter(0.0f), ShaderParameter(1.0f), ShaderParameter(0.05f) },
184  // sky
185  { "day_top_color", ShaderParameter(Color4(0.1f, 0.6f, 1.0f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
186  { "day_bottom_color", ShaderParameter(Color4(0.4f, 0.8f, 1.0f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
187  { "sunset_top_color", ShaderParameter(Color4(0.7f, 0.75f, 1.0f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
188  { "sunset_bottom_color", ShaderParameter(Color4(1.0f, 0.5f, 0.7f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
189  { "night_top_color", ShaderParameter(Color4(0.02f, 0.0f, 0.04f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
190  { "night_bottom_color", ShaderParameter(Color4( 0.1f, 0.0f, 0.2f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
191  // horizon
192  { "horizon_color", ShaderParameter(Color4(0.0f, 0.7f, 0.8f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
193  { "horizon_blur", ShaderParameter(0.05f), ShaderParameter(0.0f), ShaderParameter(1.0f), ShaderParameter(0.05f) },
194  // sun
195  { "sun_color_factor", ShaderParameter(200.0f), ShaderParameter(0.0f), ShaderParameter(200.0f), ShaderParameter(10.0f) },
196  { "sun_color", ShaderParameter(Color4(1.0f, 0.8f, 0.1f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
197  { "sun_sunset_color", ShaderParameter(Color4(10.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
198  { "sun_size", ShaderParameter(0.2f), ShaderParameter(0.05f), ShaderParameter(1.0f), ShaderParameter(0.0475f) },
199  { "sun_blur", ShaderParameter(10.0f), ShaderParameter(0.05f), ShaderParameter(20.0f), ShaderParameter(0.9975f) },
200  // moon
201  { "moon_color_factor", ShaderParameter(20.0f), ShaderParameter(0.0f), ShaderParameter(20.0f), ShaderParameter(1.0f) },
202  { "moon_color", ShaderParameter(Color4(1.0f, 0.95f, 0.7f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
203  { "moon_size", ShaderParameter(0.06f), ShaderParameter(0.05f), ShaderParameter(1.00f), ShaderParameter(0.0475f) },
204  { "moon_blur", ShaderParameter(0.1f), ShaderParameter(0.05f), ShaderParameter(10.00f), ShaderParameter(0.475f) },
205  // clouds
206  { "clouds_edge_color", ShaderParameter(Color4(0.8f, 0.8f, 0.98f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
207  { "clouds_top_color", ShaderParameter(Color4(1.0f, 1.0f, 1.00f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
208  { "clouds_middle_color", ShaderParameter(Color4(0.92f, 0.92f, 0.98f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
209  { "clouds_bottom_color", ShaderParameter(Color4(0.83f, 0.83f, 0.94f, 1.0f)), ShaderParameter(Color4(0.0f, 0.0f, 0.0f, 1.0f)), ShaderParameter(Color4(1.0f, 1.0f, 1.0f, 1.0f)), ShaderParameter(Color4(0.1f, 0.1f, 0.1f, 0.0f)) },
210  { "clouds_speed", ShaderParameter(2.0f), ShaderParameter(0.0f), ShaderParameter(20.0f), ShaderParameter(1.0f) },
211  { "clouds_direction", ShaderParameter(0.2f), ShaderParameter(-0.5f), ShaderParameter(0.5f), ShaderParameter(0.05f) },
212  { "clouds_scale", ShaderParameter(1.0f), ShaderParameter(0.0f), ShaderParameter(4.0f), ShaderParameter(0.2f) },
213  { "clouds_cutoff", ShaderParameter(0.3f), ShaderParameter(0.0f), ShaderParameter(1.0f), ShaderParameter(0.05f) },
214  { "clouds_fuzziness", ShaderParameter(0.5f), ShaderParameter(0.0f), ShaderParameter(2.0f), ShaderParameter(0.1f) },
215  { "clouds_weight", ShaderParameter(0.0f), ShaderParameter(0.0f), ShaderParameter(1.0f), ShaderParameter(0.05f) },
216  { "clouds_blur", ShaderParameter(0.25f), ShaderParameter(0.0f), ShaderParameter(1.0f), ShaderParameter(0.05f) },
217  { "stars_speed", ShaderParameter(1.0f), ShaderParameter(0.0f), ShaderParameter(1.0f), ShaderParameter(0.05f) },
218  }
219  );
220 
221  //
222  initialized = true;
223 }
224 
226  unloadTextures();
227 }
228 
230  if (starsTexture != nullptr) {
233  starsTexture = nullptr;
235  }
236 }
237 
238 void SkyRenderShader::loadTextures(const string& pathName) {
239  unloadTextures();
240  starsTextureId = Engine::getInstance()->getTextureManager()->addTexture(starsTexture = TextureReader::read(pathName + "/resources/engine/textures", "stars.png"), renderer->CONTEXTINDEX_DEFAULT);
241 }
242 
243 void SkyRenderShader::render(Engine* engine, bool lightScatteringPass, Camera* camera) {
244  // use default context
245  auto contextIdx = renderer->CONTEXTINDEX_DEFAULT;
246 
247  // camera, use engine camera if no camera given
248  if (camera == nullptr) camera = engine->getCamera();
249 
250  //
251  renderer->useProgram(contextIdx, programId);
253 
254  //
255  auto sunLight = engine->getLightAt(Engine::LIGHTIDX_SUN);
256  auto moonLight = engine->getLightAt(Engine::LIGHTIDX_MOON);
257 
258  // manual placing of sun and moon, by t 0 <= t < 1.0
259  if (engine->getShaderParameter("sky", "manual_t").getBooleanValue() == true) {
260  auto t = engine->getShaderParameter("sky", "t").getFloatValue();
261  sunLight->setupSun(t);
262  moonLight->setupMoon(t);
263  }
264 
265  //
266  auto sunLightPosition4 = sunLight->getPosition().clone().scale(1.0f / (Math::abs(sunLight->getPosition().getW()) < Math::EPSILON?1.0:sunLight->getPosition().getW()));
267  auto sunLightPosition = Vector3(sunLightPosition4[0], sunLightPosition4[1], sunLightPosition4[2]);
268  auto sunLightDirection = sunLightPosition.clone().normalize().scale(-1.0f);
269  //
270  auto moonLightPosition4 = moonLight->getPosition().clone().scale(1.0f / (Math::abs(moonLight->getPosition().getW()) < Math::EPSILON?1.0:moonLight->getPosition().getW()));
271  auto moonLightPosition = Vector3(moonLightPosition4[0], moonLightPosition4[1], moonLightPosition4[2]);
272  auto moonLightDirection = moonLightPosition.clone().normalize().scale(-1.0f);
273  //
274  renderer->setProgramUniformInteger(contextIdx, uniformLIGHT0_ENABLED, sunLight->isEnabled() == true?1:0);
275  renderer->setProgramUniformFloatVec3(contextIdx, uniformLIGHT0_DIRECTION, sunLightDirection.getArray());
276  renderer->setProgramUniformInteger(contextIdx, uniformLIGHT1_ENABLED, moonLight->isEnabled() == true?1:0);
277  renderer->setProgramUniformFloatVec3(contextIdx, uniformLIGHT1_DIRECTION, moonLightDirection.getArray());
278  renderer->setProgramUniformInteger(contextIdx, uniformLightScatteringPass, lightScatteringPass == false?0:1);
279  renderer->setProgramUniformFloat(contextIdx, uniformTime, static_cast<float>(engine->getTiming()->getTotalTime()) / 1000.0f);
280  renderer->setProgramUniformFloat(contextIdx, uniformAspectRatio, static_cast<float>(camera->getWidth()) / static_cast<float>(camera->getHeight()));
284  //
285  renderer->setTextureUnit(contextIdx, 0);
286  renderer->bindTexture(contextIdx, starsTextureId);
287  // sky
288  renderer->setProgramUniformFloatVec3(contextIdx, uniformDayTopColor, engine->getShaderParameter("sky", "day_top_color").getColor3ValueArray());
289  renderer->setProgramUniformFloatVec3(contextIdx, uniformDayBottomColor, engine->getShaderParameter("sky", "day_bottom_color").getColor3ValueArray());
290  renderer->setProgramUniformFloatVec3(contextIdx, uniformSunsetTopColor, engine->getShaderParameter("sky", "sunset_top_color").getColor3ValueArray());
291  renderer->setProgramUniformFloatVec3(contextIdx, uniformSunsetBottomColor, engine->getShaderParameter("sky", "sunset_bottom_color").getColor3ValueArray());
292  renderer->setProgramUniformFloatVec3(contextIdx, uniformNightTopColor, engine->getShaderParameter("sky", "night_top_color").getColor3ValueArray());
293  renderer->setProgramUniformFloatVec3(contextIdx, uniformNightBottomColor, engine->getShaderParameter("sky", "night_bottom_color").getColor3ValueArray());
294  // horizon
295  renderer->setProgramUniformFloatVec3(contextIdx, uniformHorizonColor, engine->getShaderParameter("sky", "horizon_color").getColor3ValueArray());
296  renderer->setProgramUniformFloat(contextIdx, uniformHorizonBlur, engine->getShaderParameter("sky", "horizon_blur").getFloatValue());
297  // sun
298  renderer->setProgramUniformFloat(contextIdx, uniformSunColorFactor, engine->getShaderParameter("sky", "sun_color_factor").getFloatValue());
300  renderer->setProgramUniformFloatVec3(contextIdx, uniformSunSunsetColor, engine->getShaderParameter("sky", "sun_sunset_color").getColor3ValueArray());
301  renderer->setProgramUniformFloat(contextIdx, uniformSunSize, engine->getShaderParameter("sky", "sun_size").getFloatValue());
302  renderer->setProgramUniformFloat(contextIdx, uniformSunBlur, engine->getShaderParameter("sky", "sun_blur").getFloatValue());
303  // moon
304  renderer->setProgramUniformFloat(contextIdx, uniformMoonColorFactor, engine->getShaderParameter("sky", "moon_color_factor").getFloatValue());
305  renderer->setProgramUniformFloatVec3(contextIdx, uniformMoonColor, engine->getShaderParameter("sky", "moon_color").getColor3ValueArray());
306  renderer->setProgramUniformFloat(contextIdx, uniformMoonSize, engine->getShaderParameter("sky", "moon_size").getFloatValue());
307  renderer->setProgramUniformFloat(contextIdx, uniformMoonBlur, engine->getShaderParameter("sky", "moon_blur").getFloatValue());
308  // clouds
309  renderer->setProgramUniformFloatVec3(contextIdx, uniformCloudsEdgeColor, engine->getShaderParameter("sky", "clouds_edge_color").getColor3ValueArray());
310  renderer->setProgramUniformFloatVec3(contextIdx, uniformCloudsTopColor, engine->getShaderParameter("sky", "clouds_top_color").getColor3ValueArray());
311  renderer->setProgramUniformFloatVec3(contextIdx, uniformCloudsMiddleColor, engine->getShaderParameter("sky", "clouds_middle_color").getColor3ValueArray());
312  renderer->setProgramUniformFloatVec3(contextIdx, uniformCloudsBottomColor, engine->getShaderParameter("sky", "clouds_bottom_color").getColor3ValueArray());
313  renderer->setProgramUniformFloat(contextIdx, uniformCloudsSpeed, engine->getShaderParameter("sky", "clouds_speed").getFloatValue());
314  renderer->setProgramUniformFloat(contextIdx, uniformCloudsDirection, engine->getShaderParameter("sky", "clouds_direction").getFloatValue());
315  renderer->setProgramUniformFloat(contextIdx, uniformCloudsScale, engine->getShaderParameter("sky", "clouds_scale").getFloatValue());
316  renderer->setProgramUniformFloat(contextIdx, uniformCloudsCutoff, engine->getShaderParameter("sky", "clouds_cutoff").getFloatValue());
317  renderer->setProgramUniformFloat(contextIdx, uniformCloudsFuzziness, engine->getShaderParameter("sky", "clouds_fuzziness").getFloatValue());
318  renderer->setProgramUniformFloat(contextIdx, uniformCloudsWeight, engine->getShaderParameter("sky", "clouds_weight").getFloatValue());
319  renderer->setProgramUniformFloat(contextIdx, uniformCloudsBlur, engine->getShaderParameter("sky", "clouds_blur").getFloatValue());
320  renderer->setProgramUniformFloat(contextIdx, uniformStarsSpeed, engine->getShaderParameter("sky", "stars_speed").getFloatValue());
321  //
324  renderer->disableCulling(contextIdx);
325 
326  // use frame buffer render shader
327  auto frameBufferRenderShader = Engine::getFrameBufferRenderShader();
328 
329  //
330  renderer->bindVerticesBufferObject(contextIdx, frameBufferRenderShader->getVBOVertices());
331  renderer->bindTextureCoordinatesBufferObject(contextIdx, frameBufferRenderShader->getVBOTextureCoordinates());
332 
333  // draw
334  renderer->drawTrianglesFromBufferObjects(contextIdx, 2, 0);
335 
336  // unbind buffers
337  renderer->unbindBufferObjects(contextIdx);
338 
339  //
340  renderer->setTextureUnit(contextIdx, 0);
341  renderer->bindTexture(contextIdx, renderer->ID_NONE);
342 
343  // unset
344  renderer->enableCulling(contextIdx);
347 }
const Vector3 & getSideVector() const
Definition: Camera.h:204
const Vector3 & getForwardVector() const
Definition: Camera.h:189
const Vector3 & getUpVector() const
Definition: Camera.h:174
Color 4 definition class.
Definition: Color4.h:18
Engine main class.
Definition: Engine.h:131
Light * getLightAt(int32_t idx)
Returns light at idx (0 <= idx < 8)
Definition: Engine.h:1143
static Engine * getInstance()
Returns engine instance.
Definition: Engine.h:612
Camera * getCamera()
Definition: Engine.h:1071
static FrameBufferRenderShader * getFrameBufferRenderShader()
Definition: Engine.h:490
static TextureManager * getTextureManager()
Definition: Engine.h:627
const ShaderParameter getShaderParameter(const string &shaderId, const string &parameterName)
Returns shader parameter for given shader id and parameter name, if the value does not exist,...
Definition: Engine.h:941
static void registerShader(ShaderType type, const string &shaderId, const vector< Shader::ParameterDefaults > &parameterDefaults={}, bool internal=false)
Register shader.
Definition: Engine.h:856
Timing * getTiming()
Definition: Engine.h:1064
Frame buffer class.
Definition: FrameBuffer.h:22
Light representation.
Definition: Light.h:33
Shader parameter model class.
const array< float, 3 > getColor3ValueArray() const
Texture entity.
Definition: Texture.h:24
Timing class.
Definition: Timing.h:16
int64_t getTotalTime()
Definition: Timing.h:63
void render(Engine *engine, bool lightScatteringPass, Camera *camera=nullptr)
Render.
void loadTextures(const string &pathName)
Load textures.
void removeTexture(Texture *texture)
Removes a texture from manager.
TextureManager_TextureManaged * addTexture(const string &id, bool &created)
Adds a texture to manager.
virtual void setTextureUnit(int contextIdx, int32_t textureUnit)=0
Sets up texture unit.
virtual int32_t loadShader(int32_t type, const string &pathName, const string &fileName, const string &definitions=string(), const string &functions=string())=0
Loads a shader.
virtual void enableCulling(int contextIdx)=0
Enable culling.
virtual void enableDepthBufferTest()=0
Enable depth buffer test.
virtual void enableDepthBufferWriting()=0
Enable depth buffer writing.
virtual void unbindBufferObjects(int contextIdx)=0
Unbind buffer objects.
virtual int32_t createProgram(int type)=0
Creates a shader program.
virtual void setProgramAttributeLocation(int32_t programId, int32_t location, const string &name)=0
Bind attribute to a input location.
virtual void setProgramUniformInteger(int contextIdx, int32_t uniformId, int32_t value)=0
Set up a integer uniform value.
virtual bool linkProgram(int32_t programId)=0
Links attached shaders to a program.
virtual void bindTexture(int contextIdx, int32_t textureId)=0
Binds a texture with given id or unbinds when using ID_NONE.
virtual void disableDepthBufferWriting()=0
Disable depth buffer writing.
void setLighting(int contextIdx, int32_t lighting)
Set current lighting model.
Definition: Renderer.h:504
virtual void attachShaderToProgram(int32_t programId, int32_t shaderId)=0
Attaches a shader to a program.
virtual int32_t getProgramUniformLocation(int32_t programId, const string &name)=0
Returns location of given uniform variable.
virtual void drawTrianglesFromBufferObjects(int contextIdx, int32_t triangles, int32_t trianglesOffset)=0
Draw triangles from buffer objects.
virtual void disableCulling(int contextIdx)=0
Disable culling.
virtual void bindTextureCoordinatesBufferObject(int contextIdx, int32_t bufferObjectId)=0
Bind texture coordinates buffer object.
virtual void useProgram(int contextIdx, int32_t programId)=0
Use shader program.
virtual void setProgramUniformFloatVec3(int contextIdx, int32_t uniformId, const array< float, 3 > &data)=0
Set up a float vec3 uniform value.
virtual void bindVerticesBufferObject(int contextIdx, int32_t bufferObjectId)=0
Bind vertices buffer object.
virtual void disableDepthBufferTest()=0
Disable depth buffer test.
virtual void setProgramUniformFloat(int contextIdx, int32_t uniformId, float value)=0
Set up a float uniform value.
Standard math functions.
Definition: Math.h:19
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20
const array< float, 3 > & getArray() const
Definition: Vector3.h:366
Vector4 class representing vector4 mathematical structure and operations with x, y,...
Definition: Vector4.h:22
virtual void releaseReference()
Releases a reference, thus decrementing the counter and delete it if reference counter is zero.
Definition: Reference.h:38