API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classTimeStepper

@codexo/exojs-physics / physics / stable

Fixed-timestep accumulator (package-owned; no engine clock dependency). Each frame, advance adds the variable frame delta to an internal accumulator and reports how many whole fixed sub-steps to run (`floor(accumulator / fixedDelta)`), clamped to maxSubSteps. When the clamp trips, the backlog beyond the clamp is discarded so a slow frame cannot cascade into an unbounded catch-up (the "spiral of death"). alpha is the leftover fraction of a step `[0, 1)`, for interpolating bound transforms between sub-steps. The stepper holds no mutable module-level state - two stepper instances are fully independent (world isolation).

4
props
2
methods
0
events
Import
import { TimeStepper } from '@codexo/exojs-physics'

Fixed-timestep accumulator (package-owned; no engine clock dependency). Each frame, advance adds the variable frame delta to an internal accumulator and reports how many whole fixed sub-steps to run (`floor(accumulator / fixedDelta)`), clamped to maxSubSteps. When the clamp trips, the backlog beyond the clamp is discarded so a slow frame cannot cascade into an unbounded catch-up (the "spiral of death").

alpha is the leftover fraction of a step `[0, 1)`, for interpolating bound transforms between sub-steps.

The stepper holds no mutable module-level state - two stepper instances are fully independent (world isolation).

Constructors1
Methods2
advance(frameDeltaSeconds: number): number
Accumulate frameDeltaSeconds and return the number of fixed sub-steps to run this frame. Non-finite or non-positive deltas contribute nothing and return 0.
reset(): void
Clear the accumulator (e.g. after a teleport or a pause).
Properties4
fixedDelta: number
maxSubSteps: number
accumulator: number
Unconsumed accumulated time (seconds) currently held, always < fixedDelta after an advance.
alpha: number
Interpolation fraction in [0, 1) = accumulator / fixedDelta.
Source