@web-engine-dev/time / FixedTime
Interface: FixedTime
Fixed timestep state
Example
typescript
// Use alpha for smooth interpolation between physics states
const alpha = fixedTime.alpha;
const renderX = prevX + (currX - prevX) * alpha;
console.log(`Steps this frame: ${fixedTime.stepsThisFrame}`);Properties
accumulator
readonlyaccumulator:number
Accumulated time waiting to be processed
alpha
readonlyalpha:number
Interpolation alpha for rendering (0-1)
stepsThisFrame
readonlystepsThisFrame:number
Number of fixed steps this frame
timestep
readonlytimestep:number
Fixed timestep in seconds