Skip to content

Commit

Permalink
Merge pull request #55036 from nekomatata/bvh-fix-update
Browse files Browse the repository at this point in the history
Fix physics BVH pairing for teleported or fast moving objects
  • Loading branch information
pouleyKetchoupp authored Nov 17, 2021
2 parents 184b524 + afb9e2d commit 7d1b454
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion servers/physics_2d/godot_step_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -286,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++;
}
Expand Down
4 changes: 3 additions & 1 deletion servers/physics_3d/godot_step_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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++;
}
Expand Down

0 comments on commit 7d1b454

Please sign in to comment.