Skip to content

@web-engine-dev/time


@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 ​

readonly accumulator: number

Accumulated time waiting to be processed


alpha ​

readonly alpha: number

Interpolation alpha for rendering (0-1)


stepsThisFrame ​

readonly stepsThisFrame: number

Number of fixed steps this frame


timestep ​

readonly timestep: number

Fixed timestep in seconds

Proprietary software. All rights reserved.