diff --git a/tests/Engine/Physics2D/RigidBody2D.cpp b/tests/Engine/Physics2D/RigidBody2D.cpp index d524c07fd..c2b05438a 100644 --- a/tests/Engine/Physics2D/RigidBody2D.cpp +++ b/tests/Engine/Physics2D/RigidBody2D.cpp @@ -1,6 +1,7 @@ #include #include #include +#include Nz::RigidBody2D CreateBody(Nz::PhysWorld2D& world); void EQUALITY(const Nz::RigidBody2D& left, const Nz::RigidBody2D& right); @@ -11,6 +12,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") GIVEN("A physic world and a rigid body") { Nz::PhysWorld2D world; + world.SetMaxStepCount(std::numeric_limits::max()); Nz::Vector2f positionAABB(3.f, 4.f); Nz::Rectf aabb(positionAABB.x, positionAABB.y, 1.f, 2.f); @@ -82,6 +84,8 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") GIVEN("A physic world") { Nz::PhysWorld2D world; + world.SetMaxStepCount(std::numeric_limits::max()); + Nz::Rectf aabb(3.f, 4.f, 1.f, 2.f); WHEN("We get a rigid body from a function") @@ -102,6 +106,8 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") GIVEN("A physic world and a rigid body") { Nz::PhysWorld2D world; + world.SetMaxStepCount(std::numeric_limits::max()); + Nz::Vector2f positionAABB(3.f, 4.f); Nz::Rectf aabb(positionAABB.x, positionAABB.y, 1.f, 2.f); Nz::Collider2DRef box = Nz::BoxCollider2D::New(aabb); @@ -200,6 +206,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") GIVEN("A physic world and a rigid body of circle") { Nz::PhysWorld2D world; + world.SetMaxStepCount(std::numeric_limits::max()); Nz::Vector2f position(3.f, 4.f); float radius = 5.f; @@ -221,6 +228,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") GIVEN("A physic world and a rigid body of compound") { Nz::PhysWorld2D world; + world.SetMaxStepCount(std::numeric_limits::max()); Nz::Rectf aabb(0.f, 0.f, 1.f, 1.f); Nz::BoxCollider2DRef box1 = Nz::BoxCollider2D::New(aabb); @@ -249,6 +257,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") GIVEN("A physic world and a rigid body of circle") { Nz::PhysWorld2D world; + world.SetMaxStepCount(std::numeric_limits::max()); std::vector vertices; vertices.push_back(Nz::Vector2f(0.f, 0.f)); @@ -275,6 +284,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") GIVEN("A physic world and a rigid body of segment") { Nz::PhysWorld2D world; + world.SetMaxStepCount(std::numeric_limits::max()); Nz::Vector2f positionA(3.f, 4.f); Nz::Vector2f positionB(1.f, -4.f); diff --git a/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp b/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp index 6090be082..53808dc42 100644 --- a/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp +++ b/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp @@ -4,6 +4,7 @@ #include #include #include +#include Ndk::EntityHandle CreateBaseEntity(Ndk::World& world, const Nz::Vector2f& position, const Nz::Rectf AABB); @@ -20,7 +21,8 @@ SCENARIO("PhysicsSystem2D", "[NDK][PHYSICSSYSTEM2D]") Ndk::PhysicsComponent2D& physicsComponent2D = movingEntity->AddComponent(); world.GetSystem().SetMaximumUpdateRate(0.f); - + world.GetSystem().GetWorld().SetMaxStepCount(std::numeric_limits::max()); + WHEN("We update the world") { world.Update(1.f);