Skip to main content

MAX_FRAME_DT

Constant MAX_FRAME_DT 

Source
pub const MAX_FRAME_DT: f64 = 0.100;
Expand description

The longest step on_frame is ever handed, in seconds.

A tick can take arbitrarily long - a slow first frame, a stalled thread, a machine that went to sleep - and an animation integrating the real elapsed time would jump across the whole gap. The cap turns the worst case into a slow frame instead of a teleport, at the cost of an animation running slightly behind wall-clock after a stall, which is the trade every game loop makes.