summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorCamille Mohr-Daurat <pouleyKetchoup@gmail.com>2021-11-16 17:59:21 -0700
committerGitHub <noreply@github.com>2021-11-16 17:59:21 -0700
commit7d1b454b679a0a10a38dc4dee150bb433ff4979d (patch)
treec811316b203fe7ba3ff88bf69a6fb3cf0b72ce6b /servers/physics_3d
parent184b5244ba501d2323c4bf8631695bd873da9bd9 (diff)
parentafb9e2d9b7ed624a416329246dd265ac5f2d4254 (diff)
Merge pull request #55036 from nekomatata/bvh-fix-update
Fix physics BVH pairing for teleported or fast moving objects
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/godot_step_3d.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/physics_3d/godot_step_3d.cpp b/servers/physics_3d/godot_step_3d.cpp
index 331d65df49..5453c4415c 100644
--- a/servers/physics_3d/godot_step_3d.cpp
+++ b/servers/physics_3d/godot_step_3d.cpp
@@ -220,6 +220,9 @@ void GodotStep3D::step(GodotSpace3D *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(GodotSpace3D::ELAPSED_TIME_INTEGRATE_FORCES, profile_endtime - profile_begtime);
@@ -398,7 +401,6 @@ void GodotStep3D::step(GodotSpace3D *p_space, real_t p_delta, int p_iterations)
all_constraints.clear();
- p_space->update();
p_space->unlock();
_step++;
}