Merge pull request #54925 from nekomatata/bvh-fix-update-3.x

This commit is contained in:
Rémi Verschelde 2021-11-16 21:23:11 +01:00 committed by GitHub
commit 45088780be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -162,6 +162,9 @@ void StepSW::step(SpaceSW *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(SpaceSW::ELAPSED_TIME_INTEGRATE_FORCES, profile_endtime - profile_begtime);
@ -278,7 +281,6 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
profile_begtime = profile_endtime;
}
p_space->update();
p_space->unlock();
_step++;
}

View File

@ -151,6 +151,9 @@ void Step2DSW::step(Space2DSW *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(Space2DSW::ELAPSED_TIME_INTEGRATE_FORCES, profile_endtime - profile_begtime);
@ -294,7 +297,6 @@ void Step2DSW::step(Space2DSW *p_space, real_t p_delta, int p_iterations) {
//profile_begtime=profile_endtime;
}
p_space->update();
p_space->unlock();
_step++;
}