SceneTicker
- Namespace: Turian.Engine.Core
- Source File: SceneTicker.cs
Drives the per-frame lifecycle of every loaded scene: the fixed-timestep pass (OnFixedUpdate), the variable pass (OnUpdate) and the late pass (OnLateUpdate). The ticker is deliberately render-agnostic so that the standalone runtime and the Studio's in-editor play mode share the exact same update semantics.
Remarks
Instances are not thread-safe and are expected to be driven from a single loop thread.
Fields
FixedTimestep (double) = 1.0 / 60.0: The fixed-update interval, in seconds.
Properties
InputSource
(IInputSource?) : Gets the input source advanced once per tick, or null when input is not routed.
Actions
(InputActionService?) : Gets the action maps recomputed at the start of every tick, or null when no action asset is in force. Updated before the passes so OnUpdate reads this frame.
Public Methods
Tick
public void Tick(double deltaTime)
Advances every loaded scene by deltaTime seconds. Runs as many fixed steps as the accumulated time allows, then a single variable and late pass.
Parameters:
deltaTime(double): The time elapsed since the previous tick, in seconds.
StepFrame
public void StepFrame(double deltaTime = FixedTimestep)
Advances every loaded scene by exactly one frame, running a single fixed step regardless of the accumulator. Used by the editor's frame-step control.
Parameters:
deltaTime(double): The delta time to report to the update callbacks, in seconds. (Default:FixedTimestep)
ResetAccumulator
public void ResetAccumulator()
Discards accumulated fixed-step time, e.g. after resuming from a pause.