coastline 0.0.4
Loading...
Searching...
No Matches
FrameSnapshot Class Reference

Captured race geometry, cameras, and particles for interpolation between simulation steps. More...

#include <snapshot.h>

Public Member Functions

unsigned GetSequence () const
void SetSequence (unsigned value)
 Assign a capture sequence without modifying the stored race frame.
const CameraFrame & GetPrimaryCamera () const
const Vehicle & GetVehicle (int index) const
Vehicle * GetVehicles ()
const ParticleSnapshot & GetParticles () const
void Capture ()
 Capture active vehicles, racers, the primary viewport, and particles from the race.
void RenderRacingScreen ()
 Render the racing screen from this snapshot using the active renderer.
void InterpolateFrom (const FrameSnapshot &from, const FrameSnapshot &to, long double share)
 Interpolate vehicle poses and cameras while copying racers, viewport, and particles.

Detailed Description

Captured race geometry, cameras, and particles for interpolation between simulation steps.

Member Function Documentation

◆ GetSequence()

unsigned FrameSnapshot::GetSequence ( ) const
inline
Returns
The monotonically assigned capture sequence for this pool slot.

◆ SetSequence()

void FrameSnapshot::SetSequence ( unsigned value)
inline

Assign a capture sequence without modifying the stored race frame.

Parameters
valueThe capture sequence, or zero when the slot pool is initialised.

◆ GetPrimaryCamera()

const CameraFrame & FrameSnapshot::GetPrimaryCamera ( ) const
inline
Returns
The captured first vehicle's active camera; its camera pointer must be valid.

◆ GetVehicle()

const Vehicle & FrameSnapshot::GetVehicle ( int index) const
inline
Parameters
indexThe vehicle index, from 0 through MAX_VEHICLES - 1.
Returns
The captured vehicle, valid for this snapshot's lifetime and replaced by capture.

◆ GetVehicles()

Vehicle * FrameSnapshot::GetVehicles ( )
inline
Returns
Mutable storage for MAX_VEHICLES captured vehicles, valid for this snapshot's lifetime.

◆ GetParticles()

const ParticleSnapshot & FrameSnapshot::GetParticles ( ) const
inline
Returns
Captured particles, valid for this snapshot's lifetime and replaced by capture.

◆ Capture()

void FrameSnapshot::Capture ( )

Capture active vehicles, racers, the primary viewport, and particles from the race.

◆ RenderRacingScreen()

void FrameSnapshot::RenderRacingScreen ( )
inline

Render the racing screen from this snapshot using the active renderer.

◆ InterpolateFrom()

void FrameSnapshot::InterpolateFrom ( const FrameSnapshot & from,
const FrameSnapshot & to,
long double share )
inline

Interpolate vehicle poses and cameras while copying racers, viewport, and particles.

Parameters
fromThe earlier captured frame.
toThe later captured frame.
shareThe interpolation fraction, from 0 for from through 1 for to.

The documentation for this class was generated from the following file: