Switched scene update to state event
This commit is contained in:
@ -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);
|
||||
}
|
Reference in New Issue
Block a user