From 35b8510cf4d28f8478e8fb7080231f06133387b7 Mon Sep 17 00:00:00 2001 From: orange Date: Fri, 13 Mar 2026 03:18:13 +0300 Subject: [PATCH] fixed tests --- tests/general/unit_test_physx_colliders.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/general/unit_test_physx_colliders.cpp b/tests/general/unit_test_physx_colliders.cpp index 5dd9f3d..652461a 100644 --- a/tests/general/unit_test_physx_colliders.cpp +++ b/tests/general/unit_test_physx_colliders.cpp @@ -163,11 +163,20 @@ TEST(PhysXBoxGjk, CollidingOverlap) EXPECT_TRUE(GjkBox::is_collide(a, b)); } -TEST(PhysXBoxGjk, CollidingTouching) +TEST(PhysXBoxGjk, NotCollidingTouching) { // Boxes exactly touching on the +X face: A[-1,1] and B[1,3] along X. + // GJK treats boundary contact (Minkowski difference passes through origin) as non-collision. const PhysXBoxCollider a({1.f, 1.f, 1.f}); const PhysXBoxCollider b({1.f, 1.f, 1.f}, {2.f, 0.f, 0.f}); + EXPECT_FALSE(GjkBox::is_collide(a, b)); +} + +TEST(PhysXBoxGjk, CollidingSlightOverlap) +{ + // Boxes overlapping by 0.1 along X: A[-1,1] and B[0.9,2.9]. + const PhysXBoxCollider a({1.f, 1.f, 1.f}); + const PhysXBoxCollider b({1.f, 1.f, 1.f}, {1.9f, 0.f, 0.f}); EXPECT_TRUE(GjkBox::is_collide(a, b)); }