From 0046d320bb80600d38395c7622a2c5d9be2ed811 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 4 Dec 2021 05:19:06 +0000 Subject: Fix Geometry3D::get_closest_points_between_segments() returns NaN Also fix: - Geometry3D::get_closest_distance_between_segments() returning incorrect values. - Test for Geometry3D::get_closest_distance_between_segments() testing for an incorrect value. --- tests/core/math/test_geometry_3d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/core/math/test_geometry_3d.h b/tests/core/math/test_geometry_3d.h index 99a4ef2d46..23bbf1e183 100644 --- a/tests/core/math/test_geometry_3d.h +++ b/tests/core/math/test_geometry_3d.h @@ -63,7 +63,7 @@ TEST_CASE("[Geometry3D] Closest Distance Between Segments") { p_1(p_p_1), p_2(p_p_2), p_3(p_p_3), p_4(p_p_4), want(p_want){}; }; Vector tt; - tt.push_back(Case(Vector3(1, -2, 0), Vector3(1, 2, 0), Vector3(-1, 2, 0), Vector3(-1, -2, 0), 0.0f)); + tt.push_back(Case(Vector3(1, -2, 0), Vector3(1, 2, 0), Vector3(-1, 2, 0), Vector3(-1, -2, 0), 2.0f)); for (int i = 0; i < tt.size(); ++i) { Case current_case = tt[i]; float out = Geometry3D::get_closest_distance_between_segments(current_case.p_1, current_case.p_2, current_case.p_3, current_case.p_4); -- cgit v1.2.3