MCPcopy Create free account
hub / github.com/axmolengine/axmol / update

Method update

tests/cpp-tests/Source/LightTest/LightTest.cpp:231–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231void LightTest::update(float delta)
232{
233 static float angleDelta = 0.0;
234
235 if (_directionalLight)
236 {
237 _directionalLight->setRotation3D(Vec3(-45.0, -AX_RADIANS_TO_DEGREES(angleDelta), 0.0f));
238 }
239
240 if (_pointLight)
241 {
242 _pointLight->setPositionX(100.0f * cosf(angleDelta + 2.0 * delta));
243 _pointLight->setPositionY(100.0f);
244 _pointLight->setPositionZ(100.0f * sinf(angleDelta + 2.0 * delta));
245 }
246
247 if (_spotLight)
248 {
249 _spotLight->setPositionX(100.0f * cosf(angleDelta + 4.0 * delta));
250 _spotLight->setPositionY(100.0f);
251 _spotLight->setPositionZ(100.0f * sinf(angleDelta + 4.0 * delta));
252 _spotLight->setDirection(-Vec3(cosf(angleDelta + 4.0 * delta), 1.0, sinf(angleDelta + 4.0 * delta)));
253 }
254
255 angleDelta += delta;
256
257 TestCase::update(delta);
258}
259
260void LightTest::SwitchLight(Object* sender, LightType lightType)
261{

Callers

nothing calls this directly

Calls 7

Vec3Function · 0.50
updateFunction · 0.50
setRotation3DMethod · 0.45
setPositionXMethod · 0.45
setPositionYMethod · 0.45
setPositionZMethod · 0.45
setDirectionMethod · 0.45

Tested by

no test coverage detected