159 bool IsNewerUShort(std::uint16_t incoming, std::uint16_t previous);
166 double elapsedSeconds,
bool hasAuthoritativePresentation);
174 void Reset(
int identity,
int reference,
int parentSlot,
bool requireLowBootstrapSequence);
179 std::size_t
Depth()
const;
194 std::uint16_t
ForwardDelta(std::uint16_t incoming)
const;
197 std::array<MotionSnapshot, SnapshotCapacity>
snapshots_ = {};
227 void ResetVehicle(std::size_t slot,
int identity,
int reference,
int parentSlot,
bool identityChanged);
243 std::array<SnapshotChannel, EntityCapacity>
weapons_;
double InterpolationDelay() const
void Configure(SequenceMode sequenceMode, const ChannelConfig &config)
std::uint32_t packetWindowCount_
double sourceIntervalSeconds_
PresentationState Extrapolate(const MotionSnapshot &snapshot, double seconds) const
std::array< MotionSnapshot, SnapshotCapacity > snapshots_
PresentationState lastPresentation_
Acceptance Push(MotionSnapshot snapshot, double receiptSeconds)
PresentationState Evaluate(double presentationSeconds) const
SequenceMode sequenceMode_
ChannelMetrics GetMetrics(double nowSeconds) const
const MotionSnapshot & SnapshotAt(std::size_t logicalIndex) const
void Reset(int identity, int reference, int parentSlot, bool requireLowBootstrapSequence)
double sourcePhaseSeconds_
void UpdateSourceCadence(double sourceIntervalSeconds)
PresentationState Sample(double nowSeconds, double elapsedSeconds)
double lastRawReceiptSeconds_
bool hasSourceObservation_
std::size_t PhysicalIndex(std::size_t logicalIndex) const
std::uint16_t lastObservedSourceRevision_
PresentationState Interpolate(const MotionSnapshot &first, const MotionSnapshot &second, double amount) const
bool sourceIntervalInitialized_
void UpdateCadence(double rawIntervalSeconds)
std::uint16_t lastObservedSampleTimeMs_
std::uint16_t ForwardDelta(std::uint16_t incoming) const
bool lastPresentationWasExtrapolated_
bool requireLowBootstrapSequence_
double ExtrapolationCap() const
bool intervalInitialized_
double packetWindowStartSeconds_
void RecordIncoming(double receiptSeconds)
void AdvanceCorrection(double elapsedSeconds)
std::size_t Depth() const
bool HasVehicleSamples(std::size_t slot) const
bool HasWeaponSamples(std::size_t slot) const
void ResetWeapon(std::size_t slot, int identity)
ChannelMetrics VehicleMetrics(std::size_t slot, double nowSeconds) const
void ResetVehicle(std::size_t slot, int identity, int reference, int parentSlot, bool identityChanged)
void RemoveVehicle(std::size_t slot)
Acceptance PushVehicle(std::size_t slot, MotionSnapshot snapshot, double receiptSeconds)
std::array< SnapshotChannel, EntityCapacity > vehicles_
void RemoveWeapon(std::size_t slot)
int ClosestWeaponSlot(const Vec3 &worldObserverPosition, const Vec3 &dockObserverPosition) const
PresentationState SampleVehicle(std::size_t slot, double nowSeconds, double elapsedSeconds)
std::array< SnapshotChannel, EntityCapacity > weapons_
Acceptance PushWeapon(std::size_t slot, MotionSnapshot snapshot, double receiptSeconds)
PresentationState SampleWeapon(std::size_t slot, double nowSeconds, double elapsedSeconds)
ChannelMetrics WeaponMetrics(std::size_t slot, double nowSeconds) const
Quaternion Slerp(const Quaternion &aValue, const Quaternion &bValue, double amount)
double MonotonicSeconds()
Quaternion IntegrateAngularVelocity(const Quaternion &orientation, const Vec3 &angularVelocity, double seconds)
bool HasExactPayloadLength(std::size_t actualBytes, std::size_t expectedBytes)
double QuaternionLength(const Quaternion &value)
double Length(const Vec3 &value)
constexpr std::size_t SnapshotCapacity
constexpr std::size_t EntityCapacity
bool IsNewerModulo255(std::uint8_t incoming, std::uint8_t previous)
std::uint16_t SourceTimeDeltaMilliseconds(std::uint16_t incoming, std::uint16_t previous)
bool IsNewerUShort(std::uint16_t incoming, std::uint16_t previous)
Vec3 WeaponFrameEndpoint(const Vec3 &presentationPosition, const Vec3 &velocity, double elapsedSeconds, bool hasAuthoritativePresentation)
SnapshotSystem gSnapshotSystem
bool ShouldBufferVehicleReference(int reference)
bool NormalizeQuaternion(Quaternion &value)
bool IsFinite(const Vec3 &value)
double sourcePhaseCorrectionAlpha
double teleportBaseDistanceKm
double maximumInterpolationDelaySeconds
double maximumSourcePhaseCorrectionPerPacketSeconds
double maximumSparseInterpolationDelaySeconds
double frequentIntervalThresholdSeconds
double jitterMarginMultiplier
double minimumTimelineSegmentSeconds
double sourceTimelineSilenceResetSeconds
double sparseExtrapolationCapSeconds
double maximumSourceDeltaSeconds
double minimumInterpolationDelaySeconds
double teleportVelocityIntervalMultiplier
double frequentExtrapolationCapSeconds
double maximumBurstTimelineSegmentSeconds
double sparseInterpolationSafetyMarginSeconds
std::uint16_t maximumBootstrapSequence
double correctionHalfLifeSeconds
double newestSnapshotAgeSeconds
std::uint16_t lastDeliverySequenceDelta
std::uint16_t lastSampleTimeMs
std::uint32_t coalescedSourceRevisions
double incomingPacketsPerSecond
std::uint16_t lastAcceptedSequence
std::uint32_t duplicateCount
double interpolationDelaySeconds
std::uint16_t lastSourceRevision
std::uint32_t sequenceGaps
double expectedIntervalSeconds
std::uint32_t invalidCount
std::uint32_t duplicateSourceRevisionCount
std::uint16_t lastSourceDeltaMs
double extrapolationSeconds
std::uint32_t outOfOrderCount
double measuredIntervalSeconds
std::size_t snapshotDepth
double correctionMagnitudeKm
std::uint16_t sourceRevision
double expectedIntervalSeconds
std::uint16_t sampleTimeMs
bool hasPositionDerivative
double extrapolationSeconds
Vec3 & operator+=(const Vec3 &rhs)
Vec3 operator-(const Vec3 &rhs) const
Vec3 operator+(const Vec3 &rhs) const
Vec3 operator*(double scalar) const
Vec3 operator/(double scalar) const