| 229 | } |
| 230 | |
| 231 | void 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 | |
| 260 | void LightTest::SwitchLight(Object* sender, LightType lightType) |
| 261 | { |
nothing calls this directly
no test coverage detected