You've already forked godot
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user