diff options
Diffstat (limited to 'servers/physics/collision_solver_sat.cpp')
-rw-r--r-- | servers/physics/collision_solver_sat.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index fd919343f0..3073cc8b11 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -98,7 +98,7 @@ static void _generate_contacts_edge_edge(const Vector3 *p_points_A, int p_point_ Vector3 c = rel_A.cross(rel_B).cross(rel_B); - if (Math::abs(rel_A.dot(c)) < CMP_EPSILON) { + if (Math::is_zero_approx(rel_A.dot(c))) { // should handle somehow.. //ERR_PRINT("TODO FIX"); @@ -678,7 +678,7 @@ static void _collision_box_box(const ShapeSW *p_a, const Transform &p_transform_ Vector3 axis = p_transform_a.basis.get_axis(i).cross(p_transform_b.basis.get_axis(j)); - if (axis.length_squared() < CMP_EPSILON) + if (Math::is_zero_approx(axis.length_squared())) continue; axis.normalize(); @@ -767,7 +767,7 @@ static void _collision_box_capsule(const ShapeSW *p_a, const Transform &p_transf // cylinder Vector3 box_axis = p_transform_a.basis.get_axis(i); Vector3 axis = box_axis.cross(cyl_axis); - if (axis.length_squared() < CMP_EPSILON) + if (Math::is_zero_approx(axis.length_squared())) continue; if (!separator.test_axis(axis.normalized())) @@ -821,9 +821,9 @@ static void _collision_box_capsule(const ShapeSW *p_a, const Transform &p_transf // test edges of A - for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { - Vector3 axis = point_axis.cross(p_transform_a.basis.get_axis(i)).cross(p_transform_a.basis.get_axis(i)).normalized(); + Vector3 axis = point_axis.cross(p_transform_a.basis.get_axis(j)).cross(p_transform_a.basis.get_axis(j)).normalized(); if (!separator.test_axis(axis)) return; @@ -1337,7 +1337,7 @@ static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a, const T return; } } - //edge-vertex( hsell) + //edge-vertex (shell) for (int i = 0; i < edge_count_A; i++) { @@ -1438,7 +1438,7 @@ static void _collision_convex_polygon_face(const ShapeSW *p_a, const Transform & return; } } - //edge-vertex( hsell) + //edge-vertex (shell) for (int i = 0; i < edge_count; i++) { |