summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-03-06 09:09:17 +0100
committerGitHub <noreply@github.com>2017-03-06 09:09:17 +0100
commit4d8840bba7d796b8417a3ebea9153c0aa1c78a58 (patch)
treeea2a010d51c905195614a67c48da5d8a5e0a7e0a
parent616334311875da66e1a28a4d92efa1df245815c9 (diff)
parent32eb2cc61ec68446e398e91dd1ef4a23f1397ee8 (diff)
Merge pull request #7963 from RandomShaper/fix-kb-2d-motion
Complement KinematicBody2D fix
-rw-r--r--servers/physics_2d/space_2d_sw.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index 93df0a00f6..a858a20f2c 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -557,6 +557,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
body_aabb = body_aabb.merge(p_body->get_shape_aabb(i));
}
+ // Undo the currently transform the physics server is aware of and apply the provided one
+ body_aabb = p_from.xform(p_body->get_inv_transform().xform(body_aabb));
body_aabb = body_aabb.grow(p_margin);
Transform2D body_transform = p_from;