summaryrefslogtreecommitdiff
path: root/servers/physics_2d/godot_step_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics_2d/godot_step_2d.cpp')
-rw-r--r--servers/physics_2d/godot_step_2d.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/servers/physics_2d/godot_step_2d.cpp b/servers/physics_2d/godot_step_2d.cpp
index 3010315571..00d11acdab 100644
--- a/servers/physics_2d/godot_step_2d.cpp
+++ b/servers/physics_2d/godot_step_2d.cpp
@@ -152,6 +152,9 @@ void GodotStep2D::step(GodotSpace2D *p_space, real_t p_delta, int p_iterations)
p_space->set_active_objects(active_count);
+ // Update the broadphase to register collision pairs.
+ p_space->update();
+
{ //profile
profile_endtime = OS::get_singleton()->get_ticks_usec();
p_space->set_elapsed_time(GodotSpace2D::ELAPSED_TIME_INTEGRATE_FORCES, profile_endtime - profile_begtime);
@@ -255,11 +258,7 @@ void GodotStep2D::step(GodotSpace2D *p_space, real_t p_delta, int p_iterations)
// Warning: _solve_island modifies the constraint islands for optimization purpose,
// their content is not reliable after these calls and shouldn't be used anymore.
- if (island_count > 1) {
- work_pool.do_work(island_count, this, &GodotStep2D::_solve_island, nullptr);
- } else if (island_count > 0) {
- _solve_island(0);
- }
+ work_pool.do_work(island_count, this, &GodotStep2D::_solve_island, nullptr);
{ //profile
profile_endtime = OS::get_singleton()->get_ticks_usec();
@@ -290,7 +289,6 @@ void GodotStep2D::step(GodotSpace2D *p_space, real_t p_delta, int p_iterations)
all_constraints.clear();
- p_space->update();
p_space->unlock();
_step++;
}