Sdk/System: Fix time loss when using max update rate

This commit is contained in:
Jérôme Leclercq
2018-02-08 11:43:15 +01:00
parent 15fb338e36
commit 7366d92818
3 changed files with 78 additions and 19 deletions

View File

@@ -19,7 +19,7 @@ SCENARIO("PhysicsSystem2D", "[NDK][PHYSICSSYSTEM2D]")
Ndk::NodeComponent& nodeComponent = movingEntity->GetComponent<Ndk::NodeComponent>();
Ndk::PhysicsComponent2D& physicsComponent2D = movingEntity->AddComponent<Ndk::PhysicsComponent2D>();
world.GetSystem<Ndk::PhysicsSystem2D>().SetFixedUpdateRate(30.f);
world.GetSystem<Ndk::PhysicsSystem2D>().SetMaximumUpdateRate(0.f);
WHEN("We update the world")
{
@@ -43,7 +43,7 @@ SCENARIO("PhysicsSystem2D", "[NDK][PHYSICSSYSTEM2D]")
world.Update(1.f);
THEN("It should moved freely")
THEN("It should move freely")
{
REQUIRE(nodeComponent.GetPosition() == position);
movingAABB.Translate(position);