From 738d2ab96997faa1e13b91e38cf8a0000d829f70 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Mon, 21 Aug 2017 15:15:36 -0400 Subject: Removed unnecessary assignments --- servers/physics/broad_phase_octree.cpp | 1 - servers/physics/space_sw.cpp | 10 +++------- servers/physics_2d/joints_2d_sw.cpp | 6 ++++-- servers/physics_2d/space_2d_sw.cpp | 7 ++----- 4 files changed, 9 insertions(+), 15 deletions(-) (limited to 'servers') diff --git a/servers/physics/broad_phase_octree.cpp b/servers/physics/broad_phase_octree.cpp index e1aaf4e31a..fb2144bd03 100644 --- a/servers/physics/broad_phase_octree.cpp +++ b/servers/physics/broad_phase_octree.cpp @@ -124,6 +124,5 @@ BroadPhaseOctree::BroadPhaseOctree() { octree.set_unpair_callback(_unpair_callback, this); pair_callback = NULL; pair_userdata = NULL; - pair_callback = NULL; unpair_userdata = NULL; } diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index 094cfa4656..fc52aa45aa 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -474,8 +474,7 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_ Vector3 PhysicsDirectSpaceStateSW::get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const { - CollisionObjectSW *obj = NULL; - obj = PhysicsServerSW::singleton->area_owner.getornull(p_object); + CollisionObjectSW *obj = PhysicsServerSW::singleton->area_owner.getornull(p_object); if (!obj) { obj = PhysicsServerSW::singleton->body_owner.getornull(p_object); } @@ -598,11 +597,8 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve cbk.amount = 0; cbk.ptr = sr; - CollisionSolverSW::CallbackResult cbkres = NULL; - - PhysicsServerSW::CollCbkData *cbkptr = NULL; - cbkptr = &cbk; - cbkres = PhysicsServerSW::_shape_col_cbk; + PhysicsServerSW::CollCbkData *cbkptr = &cbk; + CollisionSolverSW::CallbackResult cbkres = PhysicsServerSW::_shape_col_cbk; bool collided = false; diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp index 449765621e..93091f55cf 100644 --- a/servers/physics_2d/joints_2d_sw.cpp +++ b/servers/physics_2d/joints_2d_sw.cpp @@ -408,8 +408,10 @@ bool GrooveJoint2DSW::setup(real_t p_step) { //joint->bias = cpvclamp(cpvmult(delta, -joint->constraint.biasCoef*dt_inv), joint->constraint.maxBias); Vector2 delta = (B->get_transform().get_origin() + rB) - (A->get_transform().get_origin() + rA); - real_t _b = get_bias(); - _b = 0.001; + + // FIXME: We used to do this assignment and then override it with 0.001 right after. Investigate why. + //real_t _b = get_bias(); + real_t _b = 0.001; gbias = (delta * -(_b == 0 ? space->get_constraint_bias() : _b) * (1.0 / p_step)).clamped(get_max_bias()); // apply accumulated impulse diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 29f879d8e9..718669988c 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -532,11 +532,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; -- cgit v1.2.3