Refactor Fixed to Physics

This commit is contained in:
Poommetee Ketson
2017-10-21 21:28:08 +07:00
parent b302084395
commit 9b634180aa
11 changed files with 15 additions and 15 deletions

View File

@@ -1633,7 +1633,7 @@ bool Main::iteration() {
while (time_accum > frame_slice) {
uint64_t fixed_begin = OS::get_singleton()->get_ticks_usec();
uint64_t physics_begin = OS::get_singleton()->get_ticks_usec();
PhysicsServer::get_singleton()->sync();
PhysicsServer::get_singleton()->flush_queries();
@@ -1656,8 +1656,8 @@ bool Main::iteration() {
time_accum -= frame_slice;
message_queue->flush();
physics_process_ticks = MAX(physics_process_ticks, OS::get_singleton()->get_ticks_usec() - fixed_begin); // keep the largest one for reference
physics_process_max = MAX(OS::get_singleton()->get_ticks_usec() - fixed_begin, physics_process_max);
physics_process_ticks = MAX(physics_process_ticks, OS::get_singleton()->get_ticks_usec() - physics_begin); // keep the largest one for reference
physics_process_max = MAX(OS::get_singleton()->get_ticks_usec() - physics_begin, physics_process_max);
iters++;
Engine::get_singleton()->_physics_frames++;
}