From 16d414be685f95ffe8f9183ec705e1e7532b4132 Mon Sep 17 00:00:00 2001 From: William Linna Date: Sun, 15 Sep 2024 17:16:18 +0300 Subject: [PATCH] Check the result in triangle_vertex_touches_triangle_edge_epa --- crates/parry3d/tests/geometry/epa3.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/parry3d/tests/geometry/epa3.rs b/crates/parry3d/tests/geometry/epa3.rs index e497d7da..9836612b 100644 --- a/crates/parry3d/tests/geometry/epa3.rs +++ b/crates/parry3d/tests/geometry/epa3.rs @@ -51,6 +51,12 @@ fn triangle_vertex_touches_triangle_edge_epa() { None, ); - assert!(!matches!(gjk_result, query::gjk::GJKResult::NoIntersection(_)), - "PARTIAL SUCCESS: contact_support_map_support_map_with_params did not crash but did not produce the desired result"); + let query::gjk::GJKResult::ClosestPoints(a, _b, _normal) = &gjk_result else { + panic!("PARTIAL SUCCESS: contact_support_map_support_map_with_params did not crash but did not produce the desired result"); + }; + + // The upper triangle (mesh1) lines on plane where y = 1 + assert_abs_diff_eq!(a.y, 1.0, epsilon = 0.001); + // The bottom triangle touches the upper triangle in one point where x = -2.349647. + assert_abs_diff_eq!(a.x, -2.349647, epsilon = 0.001); }