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

simulation Simulation
baseMaxTicksPerFrame int

Properties

BaseMaxTicksPerFrame

Default catch-up allowance before multiplying by speed.

public int BaseMaxTicksPerFrame { get; }

Property Value

int

Interpolation

Interpolation fraction after the last frame advance.

public float Interpolation { get; }

Property Value

float

Simulation

The simulation advanced by this clock.

public Simulation Simulation { get; }

Property Value

Simulation

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)

Parameters

elapsedSeconds float
speed float

Returns

int