Class SimulationClock
- Namespace
- TDMaker.Core
- Assembly
- TDMaker.Core.dll
A bounded frame accumulator implementing the product catch-up policy without engine dependencies.
public sealed class SimulationClock
- Inheritance
-
SimulationClock
- Inherited Members
Constructors
SimulationClock(Simulation, int)
Creates a frame clock; the default allowance is eight ticks per unit speed.
public SimulationClock(Simulation simulation, int baseMaxTicksPerFrame = 8)
Parameters
simulationSimulationbaseMaxTicksPerFrameint
Properties
BaseMaxTicksPerFrame
Default catch-up allowance before multiplying by speed.
public int BaseMaxTicksPerFrame { get; }
Property Value
Interpolation
Interpolation fraction after the last frame advance.
public float Interpolation { get; }
Property Value
Simulation
The simulation advanced by this clock.
public Simulation Simulation { get; }
Property Value
Methods
Advance(float, float)
Advances a frame at any nonnegative speed; zero pauses. Excess backlog is discarded.
public int Advance(float elapsedSeconds, float speed = 1)