summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Admiraal <madmiraal@users.noreply.github.com>2020-10-03 12:55:12 +0100
committerMarcel Admiraal <madmiraal@users.noreply.github.com>2020-10-03 12:59:34 +0100
commit7e44682c0382779a6142a3cfa7c712d85d8ec928 (patch)
tree6b21bfa17e03db9119094213be3ce53f3031c310
parent9b1c9cef17ef06e5ae80309189464ca6afe7e551 (diff)
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.
-rw-r--r--servers/physics_2d/collision_solver_2d_sw.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp
index beba709807..0e056691c7 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;