Add game speed controls to the embedded game window

This commit is contained in:
DexterFstone 2025-06-07 21:47:43 -07:00
parent abbe792575
commit 7ddce8ab26
10 changed files with 173 additions and 11 deletions

View file

@ -71,7 +71,7 @@ Vector3 VelocityTracker3D::get_tracked_linear_velocity() const {
if (position_history_len) {
if (physics_step) {
uint64_t base = Engine::get_singleton()->get_physics_frames();
base_time = double(base - position_history[0].frame) / Engine::get_singleton()->get_physics_ticks_per_second();
base_time = double(base - position_history[0].frame) / Engine::get_singleton()->get_user_physics_ticks_per_second();
} else {
uint64_t base = Engine::get_singleton()->get_frame_ticks();
base_time = double(base - position_history[0].frame) / 1000000.0;
@ -84,7 +84,7 @@ Vector3 VelocityTracker3D::get_tracked_linear_velocity() const {
Vector3 distance = position_history[i].position - position_history[i + 1].position;
if (physics_step) {
delta = double(diff) / Engine::get_singleton()->get_physics_ticks_per_second();
delta = double(diff) / Engine::get_singleton()->get_user_physics_ticks_per_second();
} else {
delta = double(diff) / 1000000.0;
}