FixedAccumulatorTickSource
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:38
Fixed-timestep tick source with an interpolation factor. Consumes real
elapsed frame time via advance(frameDeltaMs) and emits zero or more ticks,
each advancing the world by a constant fixedDtMs. Suitable for:
- Physics that must be frame-rate-independent and deterministic while the display refresh rate varies.
- Render loops that want to draw between the last two simulation states.
Caller-pumped: advance() is called from the app’s existing render loop
(typically an AnimationFrameTickSource subscriber), so this source owns no
timer of its own. start() / stop() are no-ops for interface parity with
time-driven sources, mirroring ManualTickSource.
Emits TickInfo { kind: 'fixed', deltaMs: fixedDtMs, tickNumber }. The
leftover time is exposed as alpha (in [0, 1)), which the renderer
reads at draw time to interpolate between simulation states.
maxStepsPerFrame caps catch-up ticks per call; excess accumulated time is
dropped, not carried, so a slow frame cannot cascade into an ever-growing
backlog.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FixedAccumulatorTickSource(
options):FixedAccumulatorTickSource
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:45
Parameters
Section titled “Parameters”options
Section titled “options”FixedAccumulatorTickSourceOptions
Returns
Section titled “Returns”FixedAccumulatorTickSource
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get alpha():
number
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:79
Leftover accumulated time as a fraction of fixedDtMs, in [0, 1).
Returns
Section titled “Returns”number
tickNumber
Section titled “tickNumber”Get Signature
Section titled “Get Signature”get tickNumber():
number
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:101
Returns
Section titled “Returns”number
Methods
Section titled “Methods”advance()
Section titled “advance()”advance(
frameDeltaMs):void
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:62
Fold real elapsed frame time into the accumulator and emit up to
maxStepsPerFrame fixed steps. Non-finite or non-positive deltas are
ignored.
Parameters
Section titled “Parameters”frameDeltaMs
Section titled “frameDeltaMs”number
Returns
Section titled “Returns”void
start()
Section titled “start()”start():
void
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:92
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”stop()
Section titled “stop()”stop():
void
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:94
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”subscribe()
Section titled “subscribe()”subscribe(
handler): () =>void
Defined in: src/modules/tick/fixed-accumulator-tick-source.ts:96
Parameters
Section titled “Parameters”handler
Section titled “handler”(info) => void
Returns
Section titled “Returns”() => void