diff options
Diffstat (limited to 'servers/physics_3d/step_3d_sw.cpp')
-rw-r--r-- | servers/physics_3d/step_3d_sw.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/servers/physics_3d/step_3d_sw.cpp b/servers/physics_3d/step_3d_sw.cpp index d0604b0aa0..6572d58c91 100644 --- a/servers/physics_3d/step_3d_sw.cpp +++ b/servers/physics_3d/step_3d_sw.cpp @@ -47,8 +47,8 @@ void Step3DSW::_populate_island(Body3DSW *p_body, LocalVector<Body3DSW *> &p_bod p_body_island.push_back(p_body); } - for (Map<Constraint3DSW *, int>::Element *E = p_body->get_constraint_map().front(); E; E = E->next()) { - Constraint3DSW *constraint = (Constraint3DSW *)E->key(); + for (const KeyValue<Constraint3DSW *, int> &E : p_body->get_constraint_map()) { + Constraint3DSW *constraint = (Constraint3DSW *)E.key; if (constraint->get_island_step() == _step) { continue; // Already processed. } @@ -59,7 +59,7 @@ void Step3DSW::_populate_island(Body3DSW *p_body, LocalVector<Body3DSW *> &p_bod // Find connected rigid bodies. for (int i = 0; i < constraint->get_body_count(); i++) { - if (i == E->get()) { + if (i == E.value) { continue; } Body3DSW *other_body = constraint->get_body_ptr()[i]; @@ -407,8 +407,6 @@ void Step3DSW::step(Space3DSW *p_space, real_t p_delta, int p_iterations) { } Step3DSW::Step3DSW() { - _step = 1; - body_islands.reserve(BODY_ISLAND_COUNT_RESERVE); constraint_islands.reserve(ISLAND_COUNT_RESERVE); all_constraints.reserve(CONSTRAINT_COUNT_RESERVE); |