mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add game speed controls to the embedded game window
This commit is contained in:
parent
abbe792575
commit
7ddce8ab26
10 changed files with 173 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue