diff options
Diffstat (limited to 'servers/physics_2d/space_2d_sw.cpp')
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 29f879d8e9..9b2e586993 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "space_2d_sw.h" + #include "collision_solver_2d_sw.h" #include "physics_2d_server_sw.h" @@ -532,11 +533,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co cbk.amount = 0; cbk.ptr = sr; - CollisionSolver2DSW::CallbackResult cbkres = NULL; - - Physics2DServerSW::CollCbkData *cbkptr = NULL; - cbkptr = &cbk; - cbkres = Physics2DServerSW::_shape_col_cbk; + Physics2DServerSW::CollCbkData *cbkptr = &cbk; + CollisionSolver2DSW::CallbackResult cbkres = Physics2DServerSW::_shape_col_cbk; bool collided = false; @@ -578,21 +576,6 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co Vector2 a = sr[i * 2 + 0]; Vector2 b = sr[i * 2 + 1]; - -#if 0 - Vector2 rel = b-a; - real_t d = rel.length(); - if (d==0) - continue; - - Vector2 n = rel/d; - real_t traveled = n.dot(recover_motion); - a+=n*traveled; - - real_t d = a.distance_to(b); - if (d<margin) - continue; -#endif recover_motion += (b - a) * 0.4; } |