Documentation
    Preparing search index...

    Class Scheduler

    Index
    onFixedStep?: SchedulerCallback

    Fixed-step callback (§10 fixedUpdate). Assignable after construction so a composition root can attach the §39 system registry (plan D5) to an already-built scheduler; nothing else about the loop is configurable.

    Render callback (§10 render).

    Variable-step callback (§10 update).

    • get accumulator(): number

      Unconsumed simulation time in seconds (diagnostics; interpolationAlpha is its normalized form).

      Returns number

    • get fixedDeltaTime(): number

      Fixed simulation step in seconds. Immutable: changing it mid-run would break replay.

      Returns number

    • get fixedStepsLastFrame(): number

      Fixed steps executed by the most recent step call (§10 clamp diagnostics, §34 replay).

      Returns number

    • get maximumSubSteps(): number

      Substep clamp (§10). Immutable for the same reason.

      Returns number

    • get paused(): boolean

      Pause flag (§10). Equivalent to timeScale = 0 while set, without clobbering timeScale.

      Returns boolean

    • set paused(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • Advances the loop by elapsedRealSeconds of injected wall-clock time.

      One call is one frame: frame increments, the accumulator absorbs the scaled delta, up to maximumSubSteps fixed steps run (each invoking onFixedStep), the clamp drops any remaining excess into droppedTime, interpolationAlpha is recomputed, and finally onUpdate then onRender are invoked. That ordering — onFixedStep* → onUpdate → onRender — is the §10 contract and holds even when zero fixed steps run.

      simulationStep and simulationTime are advanced before each onFixedStep invocation, so inside the callback they describe the state the step is producing (WP-1.9 decision). interpolationAlpha is only meaningful in onUpdate/onRender; during a fixed step it still holds the previous frame's value and must not be read (§42: interpolation never feeds back into simulation).

      Parameters

      • elapsedRealSeconds: number

      Returns void

      RangeError if elapsedRealSeconds is not a finite number >= 0.