diff options
author | Juan Linietsky <juan@godotengine.org> | 2018-11-03 13:23:25 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2018-11-03 13:23:38 -0300 |
commit | 3a62f29eef174872c3d4d18e97a8ae790480ee65 (patch) | |
tree | 6defc79299b64c9114a01610787be2ab95f4fe7e | |
parent | f84893f70901dfca356d949ea1585a56154cb59f (diff) |
Fix condition test
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 244a67b70e..0abbf6aa45 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -740,8 +740,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) { const Body2DSW *b = static_cast<const Body2DSW *>(col_obj); - if ((Physics2DServer::BODY_MODE_KINEMATIC || Physics2DServer::BODY_MODE_RIGID)) { - //fix for moving platforms, margin is increased by how much it moved in the given direction + if (b->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC || b->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC) { + //fix for moving platforms (kinematic and dynamic), margin is increased by how much it moved in the given direction Vector2 lv = b->get_linear_velocity(); //compute displacement from linear velocity Vector2 motion = lv * Physics2DDirectBodyStateSW::singleton->step; |