CARLA
Loading...
Searching...
No Matches
CarlaReplayer Class Reference

#include <CarlaReplayer.h>

Classes

struct  Header
struct  PlayAfterLoadMap

Public Member Functions

 CarlaReplayer ()
void CheckPlayAfterMapLoaded (void)
void DestroySpawnedActors (void)
 Destroys the actors this replayer spawned that are still alive, even when the replay already ended by itself (which keeps them).
void Disable (void)
void Enable (void)
void ForgetSpawnedActors (void)
 Forgets the spawned actors, so a later DestroySpawnedActors() leaves them alone.
bool IsEnabled (void)
std::string ReplayFile (std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, const FTransform &Offset=FTransform(), bool ReplaySensors=false, bool ReplayWeather=false, std::string MapOverride="")
void SetEpisode (UCarlaEpisode *ThisEpisode)
void SetIgnoreHero (bool InIgnoreHero)
void SetIgnoreSpectator (bool InIgnoreSpectator)
void SetTimeFactor (double NewTimeFactor)
void Stop (bool KeepActors=false)
void Tick (float Time)
 ~CarlaReplayer ()

Static Public Attributes

static PlayAfterLoadMap Autoplay { false, "", "", 0.0, 0.0, 0, FTransform(), 1.0, false }

Private Member Functions

double GetTotalTime (void)
void InterpolatePosition (const CarlaRecorderPosition &Start, const CarlaRecorderPosition &End, double Per, double DeltaTime)
void ProcessAnimBiker (void)
void ProcessAnimVehicle (void)
void ProcessAnimVehicleWheels (bool IsFirstTime=false)
void ProcessAnimWalker (void)
void ProcessDoorVehicle (void)
void ProcessEventsAdd (void)
void ProcessEventsDel (void)
void ProcessEventsParent (void)
void ProcessLightScene (void)
void ProcessLightVehicle (void)
void ProcessPositions (bool IsFirstTime=false)
void ProcessStates (void)
void ProcessToTime (double Time, bool IsFirstTime=false)
void ProcessVisualTime (void)
void ProcessWalkerBones (void)
void ProcessWeather (void)
bool ReadHeader ()
void Rewind (void)
void SkipPacket ()
void UpdatePositions (double Per, double DeltaTime)
void UpdateWheels (double Per)

Private Attributes

bool bReplaySensors = false
bool bReplayWeather = false
double CurrentTime
std::vector< CarlaRecorderPosition > CurrPos
std::vector< CarlaRecorderAnimWheels > CurrWheels
bool Enabled
UCarlaEpisode * Episode = nullptr
std::ifstream File
uint32_t FollowId
FTransform FollowOffset
CarlaRecorderFrame Frame
Header Header
CarlaReplayerHelper Helper
bool IgnoreHero { false }
bool IgnoreSpectator { true }
std::unordered_map< uint32_t, bool > IsHeroMap
std::unordered_map< uint32_t, uint32_t > MappedId
std::vector< CarlaRecorderPosition > PrevPos
std::vector< CarlaRecorderAnimWheels > PrevWheels
CarlaRecorderInfo RecInfo
std::unordered_set< uint32_t > SpawnedIds
double TimeFactor { 1.0 }
double TimeToStop
double TotalTime

Detailed Description

Definition at line 28 of file CarlaReplayer.h.

Constructor & Destructor Documentation

◆ CarlaReplayer()

CarlaReplayer::CarlaReplayer ( )
inline

Definition at line 55 of file CarlaReplayer.h.

◆ ~CarlaReplayer()

CarlaReplayer::~CarlaReplayer ( )
inline

Definition at line 56 of file CarlaReplayer.h.

References Stop().

Member Function Documentation

◆ CheckPlayAfterMapLoaded()

◆ DestroySpawnedActors()

void CarlaReplayer::DestroySpawnedActors ( void )

Destroys the actors this replayer spawned that are still alive, even when the replay already ended by itself (which keeps them).

Called by stop_replayer(keep_actors=False).

Definition at line 37 of file CarlaReplayer.cpp.

References Episode, Helper, CarlaReplayerHelper::ProcessReplayerEventDel(), and SpawnedIds.

Referenced by ACarlaRecorder::StopReplayer().

◆ Disable()

void CarlaReplayer::Disable ( void )

◆ Enable()

void CarlaReplayer::Enable ( void )

◆ ForgetSpawnedActors()

void CarlaReplayer::ForgetSpawnedActors ( void )
inline

Forgets the spawned actors, so a later DestroySpawnedActors() leaves them alone.

Called by stop_replayer(keep_actors=True).

Definition at line 72 of file CarlaReplayer.h.

References SpawnedIds.

Referenced by ACarlaRecorder::StopReplayer().

◆ GetTotalTime()

double CarlaReplayer::GetTotalTime ( void )
private

◆ InterpolatePosition()

void CarlaReplayer::InterpolatePosition ( const CarlaRecorderPosition & Start,
const CarlaRecorderPosition & End,
double Per,
double DeltaTime )
private

Definition at line 910 of file CarlaReplayer.cpp.

References Helper, and CarlaReplayerHelper::ProcessReplayerPosition().

Referenced by UpdatePositions().

◆ IsEnabled()

bool CarlaReplayer::IsEnabled ( void )
inline

Definition at line 81 of file CarlaReplayer.h.

References Enabled.

Referenced by UCarlaEpisode::EndPlay(), ACarlaRecorder::Start(), and ACarlaRecorder::Ticking().

◆ ProcessAnimBiker()

void CarlaReplayer::ProcessAnimBiker ( void )
private

◆ ProcessAnimVehicle()

void CarlaReplayer::ProcessAnimVehicle ( void )
private

◆ ProcessAnimVehicleWheels()

void CarlaReplayer::ProcessAnimVehicleWheels ( bool IsFirstTime = false)
private

Definition at line 622 of file CarlaReplayer.cpp.

References CurrWheels, File, MappedId, PrevWheels, ReadValue(), and Vehicle.

Referenced by ProcessToTime().

◆ ProcessAnimWalker()

void CarlaReplayer::ProcessAnimWalker ( void )
private

◆ ProcessDoorVehicle()

void CarlaReplayer::ProcessDoorVehicle ( void )
private

◆ ProcessEventsAdd()

void CarlaReplayer::ProcessEventsAdd ( void )
private

◆ ProcessEventsDel()

void CarlaReplayer::ProcessEventsDel ( void )
private

◆ ProcessEventsParent()

void CarlaReplayer::ProcessEventsParent ( void )
private

◆ ProcessLightScene()

void CarlaReplayer::ProcessLightScene ( void )
private

◆ ProcessLightVehicle()

void CarlaReplayer::ProcessLightVehicle ( void )
private

◆ ProcessPositions()

void CarlaReplayer::ProcessPositions ( bool IsFirstTime = false)
private

◆ ProcessStates()

◆ ProcessToTime()

◆ ProcessVisualTime()

void CarlaReplayer::ProcessVisualTime ( void )
private

Definition at line 473 of file CarlaReplayer.cpp.

References Episode, File, UCarlaEpisode::SetVisualGameTime(), and VisualTime.

Referenced by ProcessToTime().

◆ ProcessWalkerBones()

void CarlaReplayer::ProcessWalkerBones ( void )
private

◆ ProcessWeather()

void CarlaReplayer::ProcessWeather ( void )
private

◆ ReadHeader()

bool CarlaReplayer::ReadHeader ( )
private

◆ ReplayFile()

◆ Rewind()

◆ SetEpisode()

void CarlaReplayer::SetEpisode ( UCarlaEpisode * ThisEpisode)
inline

Definition at line 87 of file CarlaReplayer.h.

References Episode, Helper, CarlaReplayerHelper::SetEpisode(), and SpawnedIds.

◆ SetIgnoreHero()

void CarlaReplayer::SetIgnoreHero ( bool InIgnoreHero)
inline

Definition at line 102 of file CarlaReplayer.h.

References IgnoreHero.

Referenced by ACarlaRecorder::SetReplayerIgnoreHero().

◆ SetIgnoreSpectator()

void CarlaReplayer::SetIgnoreSpectator ( bool InIgnoreSpectator)
inline

Definition at line 108 of file CarlaReplayer.h.

References IgnoreSpectator.

Referenced by ACarlaRecorder::SetReplayerIgnoreSpectator().

◆ SetTimeFactor()

void CarlaReplayer::SetTimeFactor ( double NewTimeFactor)
inline

Definition at line 96 of file CarlaReplayer.h.

References TimeFactor.

Referenced by ACarlaRecorder::SetReplayerTimeFactor().

◆ SkipPacket()

void CarlaReplayer::SkipPacket ( void )
private

Definition at line 64 of file CarlaReplayer.cpp.

References File, and CarlaReplayer::Header::Size.

Referenced by GetTotalTime(), and ProcessToTime().

◆ Stop()

◆ Tick()

void CarlaReplayer::Tick ( float Time)

Definition at line 921 of file CarlaReplayer.cpp.

References Enabled, ProcessToTime(), Tick(), and TimeFactor.

Referenced by Tick(), and ACarlaRecorder::Ticking().

◆ UpdatePositions()

void CarlaReplayer::UpdatePositions ( double Per,
double DeltaTime )
private

◆ UpdateWheels()

void CarlaReplayer::UpdateWheels ( double Per)
private

Member Data Documentation

◆ Autoplay

CarlaReplayer::PlayAfterLoadMap CarlaReplayer::Autoplay { false, "", "", 0.0, 0.0, 0, FTransform(), 1.0, false }
static

Definition at line 15 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().

◆ bReplaySensors

bool CarlaReplayer::bReplaySensors = false
private

Definition at line 122 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ProcessEventsAdd(), and ReplayFile().

◆ bReplayWeather

bool CarlaReplayer::bReplayWeather = false
private

Definition at line 123 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ProcessWeather(), and ReplayFile().

◆ CurrentTime

double CarlaReplayer::CurrentTime
private

Definition at line 142 of file CarlaReplayer.h.

Referenced by ProcessToTime(), and Rewind().

◆ CurrPos

std::vector<CarlaRecorderPosition> CarlaReplayer::CurrPos
private

Definition at line 131 of file CarlaReplayer.h.

Referenced by ProcessPositions(), UpdatePositions(), and UpdateWheels().

◆ CurrWheels

std::vector<CarlaRecorderAnimWheels> CarlaReplayer::CurrWheels
private

Definition at line 134 of file CarlaReplayer.h.

Referenced by ProcessAnimVehicleWheels(), and UpdateWheels().

◆ Enabled

bool CarlaReplayer::Enabled
private

◆ Episode

UCarlaEpisode* CarlaReplayer::Episode = nullptr
private

Definition at line 124 of file CarlaReplayer.h.

Referenced by DestroySpawnedActors(), ProcessVisualTime(), ReplayFile(), and SetEpisode().

◆ File

◆ FollowId

uint32_t CarlaReplayer::FollowId
private

Definition at line 148 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), and UpdatePositions().

◆ FollowOffset

FTransform CarlaReplayer::FollowOffset
private

Definition at line 150 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), and UpdatePositions().

◆ Frame

CarlaRecorderFrame CarlaReplayer::Frame
private

Definition at line 129 of file CarlaReplayer.h.

Referenced by GetTotalTime(), ProcessToTime(), and Rewind().

◆ Header

Header CarlaReplayer::Header
private

Definition at line 127 of file CarlaReplayer.h.

◆ Helper

◆ IgnoreHero

◆ IgnoreSpectator

bool CarlaReplayer::IgnoreSpectator { true }
private

Definition at line 155 of file CarlaReplayer.h.

Referenced by ProcessEventsAdd(), ReplayFile(), SetIgnoreSpectator(), and UpdatePositions().

◆ IsHeroMap

std::unordered_map<uint32_t, bool> CarlaReplayer::IsHeroMap
private

◆ MappedId

◆ PrevPos

std::vector<CarlaRecorderPosition> CarlaReplayer::PrevPos
private

Definition at line 132 of file CarlaReplayer.h.

Referenced by ProcessPositions(), UpdatePositions(), and UpdateWheels().

◆ PrevWheels

std::vector<CarlaRecorderAnimWheels> CarlaReplayer::PrevWheels
private

Definition at line 135 of file CarlaReplayer.h.

Referenced by ProcessAnimVehicleWheels(), and UpdateWheels().

◆ RecInfo

CarlaRecorderInfo CarlaReplayer::RecInfo
private

Definition at line 128 of file CarlaReplayer.h.

Referenced by ReplayFile(), and Rewind().

◆ SpawnedIds

std::unordered_set<uint32_t> CarlaReplayer::SpawnedIds
private

◆ TimeFactor

double CarlaReplayer::TimeFactor { 1.0 }
private

◆ TimeToStop

double CarlaReplayer::TimeToStop
private

Definition at line 143 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ProcessToTime(), ReplayFile(), and Rewind().

◆ TotalTime

double CarlaReplayer::TotalTime
private

Definition at line 144 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), Rewind(), and Stop().


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