Switched scene update to state event

This commit is contained in:
2023-03-01 09:40:57 -08:00
parent 1d26228cb5
commit b9625e7f14
10 changed files with 438 additions and 473 deletions

View File

@ -28,11 +28,11 @@ ExampleSpin::ExampleSpin(SceneItem *item) :
}
void ExampleSpin::onStart() {
useEventLegacy([&]{
useEvent([&](float_t delta){
auto quat = this->transform->getLocalRotation();
quat = glm::rotate(quat, getGame()->timeManager.delta, glm::vec3(0, 1, 0));
quat = glm::rotate(quat, getGame()->timeManager.delta / 2.0f, glm::vec3(1, 0, 0));
quat = glm::rotate(quat, getGame()->timeManager.delta / 4.0f, glm::vec3(0, 0, 1));
quat = glm::rotate(quat, delta, glm::vec3(0, 1, 0));
quat = glm::rotate(quat, delta / 2.0f, glm::vec3(1, 0, 0));
quat = glm::rotate(quat, delta / 4.0f, glm::vec3(0, 0, 1));
this->transform->setLocalRotation(quat);
}, getScene()->eventSceneUnpausedUpdate);
}