Core/ApplicationBase: Add support for updaters with intervals

This commit is contained in:
SirLynix
2023-04-23 19:45:33 +02:00
parent a55560d1ca
commit de5e7bd8a8
17 changed files with 253 additions and 39 deletions

View File

@@ -68,7 +68,7 @@ int main()
character.emplace(physSytem.GetPhysWorld(), playerCollider, Nz::Vector3f::Up() * 5.f);
app.AddUpdater([&](Nz::Time /*elapsedTime*/)
app.AddUpdaterFunc([&]
{
auto [position, rotation] = character->GetPositionAndRotation();
@@ -417,7 +417,7 @@ int main()
playerRotNode.SetRotation(camAngles);
});
app.AddUpdater([&](Nz::Time /*elapsedTime*/)
app.AddUpdaterFunc([&]
{
if (std::optional<Nz::Time> deltaTime = updateClock.RestartIfOver(Nz::Time::TickDuration(60)))
{