1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add access to interpolation fraction for fixed timestep interpolation

Addresses #30068

This is a prerequisite for allowing proper support for fixed timestep interpolation, exposing the interpolation fraction to the engine, modules and gdscript.

The interpolation fraction is the fraction through the current physics tick at the time of the current frame.
This commit is contained in:
lawnjelly
2019-07-01 17:42:02 +01:00
parent d40dbd6d11
commit bf6c301b9c
8 changed files with 22 additions and 0 deletions

View File

@@ -178,6 +178,10 @@ MainFrameTime MainTimerSync::advance_checked(float p_frame_slice, int p_iteratio
// track deficit
time_deficit = p_idle_step - ret.idle_step;
// p_frame_slice is 1.0 / iterations_per_sec
// i.e. the time in seconds taken by a physics tick
ret.interpolation_fraction = time_accum / p_frame_slice;
return ret;
}