Quantum 3 3.1.0

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Quantum.QuantumEntityViewTransformHistory Class Reference

Per-tick transform history of the QuantumEntityViews, driven by the QuantumEntityViewUpdater. It replaces the three frame copies the session used to keep for the view, recording only the transforms of the registered views at the moments the simulator reports the corresponding frame:

Predicted and verified ticks cannot share a ring, the same tick exists in both versions and predicted ticks run ahead by up to the rollback window. More...

Public Member Functions

bool TryGetPredicted (QuantumEntityView view, int tick, QuantumEntityViewTransformType type, out QuantumEntityViewTransformData data)
 The transform recorded for the predicted tick , i.e. the state a displayed tick advanced from. More...
 
bool TryGetPreviousUpdatePredicted (QuantumEntityView view, int tick, QuantumEntityViewTransformType type, out QuantumEntityViewTransformData data)
 The latest version of the tick the view displayed since the previous update, when the simulator re-simulated or verified that tick. Compared against what the view showed, the difference is the misprediction to correct. More...
 
bool TryGetVerified (QuantumEntityView view, int tick, QuantumEntityViewTransformType type, out QuantumEntityViewTransformData data)
 The transform recorded for the verified tick . More...
 

Public Attributes

long AllocatedBytes => _predicted.AllocatedBytes + _verified.AllocatedBytes
 Bytes held by the buffers of both registries, registered views or not. O(1). Zero until the first view registers, then InitialSlots slots per registry, growing with the number of registered views. More...
 

Static Public Attributes

const int InitialSlots = 32
 Slots a registry allocates when its first view registers. Nothing is allocated before that. More...
 
const int PredictedCapacity = 4
 Ticks per view in the predicted registry. One From tick is written per update and read back until the next one. More...
 
const int VerifiedCapacity = 32
 Ticks per view in the verified registry. The snapshot timer reads at most QuantumSnapshotInterpolationTimer.SnapshotReferenceLatencyTicks + 3 ticks behind the verified frame. More...
 

Detailed Description

Per-tick transform history of the QuantumEntityViews, driven by the QuantumEntityViewUpdater. It replaces the three frame copies the session used to keep for the view, recording only the transforms of the registered views at the moments the simulator reports the corresponding frame:

Predicted and verified ticks cannot share a ring, the same tick exists in both versions and predicted ticks run ahead by up to the rollback window.

Member Function Documentation

◆ TryGetPredicted()

bool Quantum.QuantumEntityViewTransformHistory.TryGetPredicted ( QuantumEntityView  view,
int  tick,
QuantumEntityViewTransformType  type,
out QuantumEntityViewTransformData  data 
)
inline

The transform recorded for the predicted tick , i.e. the state a displayed tick advanced from.

Parameters
viewThe view to read.
tickThe tick to read.
typeThe expected transform type, guards against reading the union as the wrong component.
dataThe recorded entry.
Returns
false when the view does not record predicted ticks of type or the tick is gone.

◆ TryGetVerified()

bool Quantum.QuantumEntityViewTransformHistory.TryGetVerified ( QuantumEntityView  view,
int  tick,
QuantumEntityViewTransformType  type,
out QuantumEntityViewTransformData  data 
)
inline

The transform recorded for the verified tick .

Parameters
viewThe view to read.
tickThe tick to read.
typeThe expected transform type, guards against reading the union as the wrong component.
dataThe recorded entry.
Returns
false when the view does not record verified ticks of type or the tick is gone.

◆ TryGetPreviousUpdatePredicted()

bool Quantum.QuantumEntityViewTransformHistory.TryGetPreviousUpdatePredicted ( QuantumEntityView  view,
int  tick,
QuantumEntityViewTransformType  type,
out QuantumEntityViewTransformData  data 
)
inline

The latest version of the tick the view displayed since the previous update, when the simulator re-simulated or verified that tick. Compared against what the view showed, the difference is the misprediction to correct.

Parameters
viewThe view to read.
tickThe tick the view displayed, only that tick can be read.
typeThe expected transform type, guards against reading the union as the wrong component.
dataThe corrected entry.
Returns
false when the view does not record predicted ticks of type or the copy holds another tick.

Member Data Documentation

◆ PredictedCapacity

const int Quantum.QuantumEntityViewTransformHistory.PredictedCapacity = 4
static

Ticks per view in the predicted registry. One From tick is written per update and read back until the next one.

◆ VerifiedCapacity

const int Quantum.QuantumEntityViewTransformHistory.VerifiedCapacity = 32
static

Ticks per view in the verified registry. The snapshot timer reads at most QuantumSnapshotInterpolationTimer.SnapshotReferenceLatencyTicks + 3 ticks behind the verified frame.

◆ InitialSlots

const int Quantum.QuantumEntityViewTransformHistory.InitialSlots = 32
static

Slots a registry allocates when its first view registers. Nothing is allocated before that.

◆ AllocatedBytes

long Quantum.QuantumEntityViewTransformHistory.AllocatedBytes => _predicted.AllocatedBytes + _verified.AllocatedBytes

Bytes held by the buffers of both registries, registered views or not. O(1). Zero until the first view registers, then InitialSlots slots per registry, growing with the number of registered views.