summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2017-08-21 15:15:36 -0400
committerWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2017-08-21 15:15:55 -0400
commit738d2ab96997faa1e13b91e38cf8a0000d829f70 (patch)
treee33258663017edb924695e68224ba836e5fc9f08 /servers
parent4717d37bfa867d8cdcd4805967324978da6701b7 (diff)
Removed unnecessary assignments
Diffstat (limited to 'servers')
-rw-r--r--servers/physics/broad_phase_octree.cpp1
-rw-r--r--servers/physics/space_sw.cpp10
-rw-r--r--servers/physics_2d/joints_2d_sw.cpp6
-rw-r--r--servers/physics_2d/space_2d_sw.cpp7
4 files changed, 9 insertions, 15 deletions
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;