From 7e44682c0382779a6142a3cfa7c712d85d8ec928 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 3 Oct 2020 12:55:12 +0100 Subject: [PATCH] Fix how Line2D obtains the other object's supports Measure the distance from the line against the rotated object, not the rotated line, when obtaining the object's supports against a line. --- servers/physics_2d/collision_solver_2d_sw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index beba709807d..0e056691c7c 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -47,7 +47,7 @@ bool CollisionSolver2DSW::solve_static_line(const Shape2DSW *p_shape_A, const Tr Vector2 supports[2]; int support_count; - p_shape_B->get_supports(p_transform_A.affine_inverse().basis_xform(-n).normalized(), supports, support_count); + p_shape_B->get_supports(p_transform_B.affine_inverse().basis_xform(-n).normalized(), supports, support_count); bool found = false;