#include <CarlaReplayer.h>
Classes | |
struct | Header |
struct | PlayAfterLoadMap |
Public Member Functions | |
CarlaReplayer () | |
void | CheckPlayAfterMapLoaded (void) |
void | Disable (void) |
void | Enable (void) |
bool | IsEnabled (void) |
std::string | ReplayFile (std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, bool ReplaySensors=false) |
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, 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 (void) |
void | ProcessAnimWalker (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) |
bool | ReadHeader () |
void | Rewind (void) |
void | SkipPacket () |
void | UpdatePositions (double Per, double DeltaTime) |
Private Attributes | |
bool | bReplaySensors = false |
double | CurrentTime |
std::vector< CarlaRecorderPosition > | CurrPos |
bool | Enabled |
UCarlaEpisode * | Episode = nullptr |
std::ifstream | File |
uint32_t | FollowId |
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 |
CarlaRecorderInfo | RecInfo |
double | TimeFactor { 1.0 } |
double | TimeToStop |
double | TotalTime |
Definition at line 27 of file CarlaReplayer.h.
|
inline |
Definition at line 52 of file CarlaReplayer.h.
|
inline |
Definition at line 53 of file CarlaReplayer.h.
References Disable(), Enable(), FollowId, ReplayFile(), and Stop().
void CarlaReplayer::CheckPlayAfterMapLoaded | ( | void | ) |
Definition at line 202 of file CarlaReplayer.cpp.
References Autoplay, bReplaySensors, CarlaReplayer::PlayAfterLoadMap::Duration, CarlaReplayer::PlayAfterLoadMap::Enabled, Enabled, File, CarlaReplayer::PlayAfterLoadMap::Filename, CarlaReplayer::PlayAfterLoadMap::FollowId, FollowId, GetTotalTime(), Helper, ProcessToTime(), CarlaReplayerHelper::RemoveStaticProps(), CarlaReplayer::PlayAfterLoadMap::ReplaySensors, Rewind(), Stop(), CarlaReplayer::PlayAfterLoadMap::TimeFactor, TimeFactor, CarlaReplayer::PlayAfterLoadMap::TimeStart, TimeToStop, and TotalTime.
Referenced by ACarlaGameModeBase::BeginPlay(), FCarlaEngine::NotifyBeginEpisode(), and SetIgnoreSpectator().
void CarlaReplayer::Disable | ( | void | ) |
void CarlaReplayer::Enable | ( | void | ) |
|
private |
Definition at line 76 of file CarlaReplayer.cpp.
References CarlaRecorderFrame::Elapsed, File, Frame, FrameStart, CarlaReplayer::Header::Id, CarlaRecorderFrame::Read(), ReadHeader(), and SkipPacket().
Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().
|
private |
Definition at line 777 of file CarlaReplayer.cpp.
References Helper, and CarlaReplayerHelper::ProcessReplayerPosition().
Referenced by UpdatePositions().
|
inline |
Definition at line 65 of file CarlaReplayer.h.
References Enabled.
Referenced by UCarlaEpisode::EndPlay(), ACarlaRecorder::Start(), and ACarlaRecorder::Ticking().
|
private |
Definition at line 615 of file CarlaReplayer.cpp.
References CarlaRecorderAnimBiker::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimBiker(), and CarlaRecorderAnimBiker::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 556 of file CarlaReplayer.cpp.
References CarlaRecorderAnimVehicle::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimVehicle(), CarlaRecorderAnimVehicle::Read(), and Vehicle.
Referenced by ProcessToTime().
|
private |
Definition at line 576 of file CarlaReplayer.cpp.
References CarlaRecorderAnimWheels::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimVehicleWheels(), CarlaRecorderAnimWheels::Read(), and Vehicle.
Referenced by ProcessToTime().
|
private |
Definition at line 595 of file CarlaReplayer.cpp.
References CarlaRecorderAnimWalker::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimWalker(), and CarlaRecorderAnimWalker::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 438 of file CarlaReplayer.cpp.
References CarlaRecorderActorDescription::Attributes, bReplaySensors, CarlaRecorderEventAdd::DatabaseId, CarlaRecorderEventAdd::Description, EventAdd, File, Helper, IgnoreHero, IgnoreSpectator, IsHeroMap, CarlaRecorderEventAdd::Location, MappedId, CarlaReplayerHelper::ProcessReplayerEventAdd(), CarlaRecorderEventAdd::Read(), and CarlaRecorderEventAdd::Rotation.
Referenced by ProcessToTime().
|
private |
Definition at line 503 of file CarlaReplayer.cpp.
References CarlaRecorderEventDel::DatabaseId, EventDel, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerEventDel(), and CarlaRecorderEventDel::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 518 of file CarlaReplayer.cpp.
References CarlaRecorderEventParent::DatabaseId, CarlaRecorderEventParent::DatabaseIdParent, EventParent, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerEventParent(), and CarlaRecorderEventParent::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 652 of file CarlaReplayer.cpp.
References File, Helper, CarlaReplayerHelper::ProcessReplayerLightScene(), and CarlaRecorderLightScene::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 633 of file CarlaReplayer.cpp.
References CarlaRecorderLightVehicle::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerLightVehicle(), and CarlaRecorderLightVehicle::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 666 of file CarlaReplayer.cpp.
References CurrPos, CarlaRecorderPosition::DatabaseId, File, MappedId, PrevPos, and CarlaRecorderPosition::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 533 of file CarlaReplayer.cpp.
References CarlaRecorderStateTrafficLight::DatabaseId, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerStateTrafficLight(), and CarlaRecorderStateTrafficLight::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 263 of file CarlaReplayer.cpp.
References AnimBiker, AnimVehicle, AnimVehicleWheels, AnimWalker, Collision, CurrentTime, CarlaRecorderFrame::DurationThis, CarlaRecorderFrame::Elapsed, Enabled, EventAdd, EventDel, EventParent, File, Frame, FrameEnd, FrameStart, CarlaReplayer::Header::Id, Position, ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessVisualTime(), ProcessWalkerBones(), CarlaRecorderFrame::Read(), ReadHeader(), SceneLight, SkipPacket(), State, Stop(), TimeToStop, UpdatePositions(), VehicleLight, VisualTime, and WalkerBones.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), Stop(), and Tick().
|
private |
Definition at line 429 of file CarlaReplayer.cpp.
References Episode, File, CarlaRecorderVisualTime::Read(), UCarlaEpisode::SetVisualGameTime(), CarlaRecorderVisualTime::Time, and VisualTime.
Referenced by ProcessToTime().
|
private |
Definition at line 699 of file CarlaReplayer.cpp.
References CarlaRecorderWalkerBones::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerWalkerBones(), and CarlaRecorderWalkerBones::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 37 of file CarlaReplayer.cpp.
References File, CarlaReplayer::Header::Id, and CarlaReplayer::Header::Size.
Referenced by GetTotalTime(), and ProcessToTime().
std::string CarlaReplayer::ReplayFile | ( | std::string | Filename, |
double | TimeStart = 0.0f , |
||
double | Duration = 0.0f , |
||
uint32_t | FollowId = 0 , |
||
bool | ReplaySensors = false |
||
) |
Definition at line 106 of file CarlaReplayer.cpp.
References Autoplay, bReplaySensors, CarlaReplayer::PlayAfterLoadMap::Duration, CarlaReplayer::PlayAfterLoadMap::Enabled, Enabled, Episode, File, CarlaReplayer::PlayAfterLoadMap::Filename, CarlaReplayer::PlayAfterLoadMap::FollowId, FollowId, UCarlaEpisode::GetMapName(), GetRecorderFilename(), GetTotalTime(), Helper, IgnoreHero, IgnoreSpectator, UCarlaEpisode::LoadNewEpisode(), CarlaRecorderInfo::Mapfile, CarlaReplayer::PlayAfterLoadMap::Mapfile, ProcessToTime(), RecInfo, CarlaReplayerHelper::RemoveStaticProps(), CarlaReplayer::PlayAfterLoadMap::ReplaySensors, Rewind(), Stop(), CarlaReplayer::PlayAfterLoadMap::TimeFactor, TimeFactor, CarlaReplayer::PlayAfterLoadMap::TimeStart, TimeToStop, and TotalTime.
Referenced by ACarlaRecorder::ReplayFile(), and ~CarlaReplayer().
|
private |
Definition at line 55 of file CarlaReplayer.cpp.
References CurrentTime, CarlaRecorderFrame::DurationThis, CarlaRecorderFrame::Elapsed, File, Frame, IsHeroMap, MappedId, CarlaRecorderInfo::Read(), RecInfo, TimeToStop, and TotalTime.
Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().
|
inline |
Definition at line 71 of file CarlaReplayer.h.
References Episode, Helper, and CarlaReplayerHelper::SetEpisode().
|
inline |
Definition at line 84 of file CarlaReplayer.h.
References IgnoreHero.
Referenced by ACarlaRecorder::SetReplayerIgnoreHero().
|
inline |
Definition at line 90 of file CarlaReplayer.h.
References CheckPlayAfterMapLoaded(), IgnoreSpectator, and Tick().
Referenced by ACarlaRecorder::SetReplayerIgnoreSpectator().
|
inline |
Definition at line 78 of file CarlaReplayer.h.
References TimeFactor.
Referenced by ACarlaRecorder::SetReplayerTimeFactor().
|
private |
Definition at line 50 of file CarlaReplayer.cpp.
References File, and CarlaReplayer::Header::Size.
Referenced by GetTotalTime(), and ProcessToTime().
void CarlaReplayer::Stop | ( | bool | KeepActors = false | ) |
Definition at line 17 of file CarlaReplayer.cpp.
References Enabled, File, Helper, IgnoreHero, IsHeroMap, CarlaReplayerHelper::ProcessReplayerFinish(), ProcessToTime(), and TotalTime.
Referenced by CheckPlayAfterMapLoaded(), UCarlaEpisode::EndPlay(), ProcessToTime(), ReplayFile(), ACarlaRecorder::Start(), ACarlaRecorder::StopReplayer(), and ~CarlaReplayer().
void CarlaReplayer::Tick | ( | float | Time | ) |
Definition at line 788 of file CarlaReplayer.cpp.
References Enabled, ProcessToTime(), and TimeFactor.
Referenced by SetIgnoreSpectator(), and ACarlaRecorder::Ticking().
|
private |
Definition at line 719 of file CarlaReplayer.cpp.
References CurrPos, FollowId, Helper, IgnoreHero, IgnoreSpectator, InterpolatePosition(), IsHeroMap, MappedId, PrevPos, CarlaReplayerHelper::SetCameraPosition(), and TimeFactor.
Referenced by ProcessToTime().
|
static |
Definition at line 50 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().
|
private |
Definition at line 104 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ProcessEventsAdd(), and ReplayFile().
|
private |
Definition at line 117 of file CarlaReplayer.h.
Referenced by ProcessToTime(), and Rewind().
|
private |
Definition at line 112 of file CarlaReplayer.h.
Referenced by ProcessPositions(), and UpdatePositions().
|
private |
Definition at line 103 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), IsEnabled(), ProcessToTime(), ReplayFile(), Stop(), and Tick().
|
private |
Definition at line 105 of file CarlaReplayer.h.
Referenced by ProcessVisualTime(), ReplayFile(), and SetEpisode().
|
private |
Definition at line 107 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), GetTotalTime(), ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessToTime(), ProcessVisualTime(), ProcessWalkerBones(), ReadHeader(), ReplayFile(), Rewind(), SkipPacket(), and Stop().
|
private |
Definition at line 123 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), UpdatePositions(), and ~CarlaReplayer().
|
private |
Definition at line 110 of file CarlaReplayer.h.
Referenced by GetTotalTime(), ProcessToTime(), and Rewind().
|
private |
Definition at line 108 of file CarlaReplayer.h.
|
private |
Definition at line 121 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), InterpolatePosition(), ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessStates(), ProcessWalkerBones(), ReplayFile(), SetEpisode(), Stop(), and UpdatePositions().
|
private |
Definition at line 127 of file CarlaReplayer.h.
Referenced by ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessLightVehicle(), ProcessWalkerBones(), ReplayFile(), SetIgnoreHero(), Stop(), and UpdatePositions().
|
private |
Definition at line 128 of file CarlaReplayer.h.
Referenced by ProcessEventsAdd(), ReplayFile(), SetIgnoreSpectator(), and UpdatePositions().
|
private |
Definition at line 129 of file CarlaReplayer.h.
Referenced by ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessLightVehicle(), ProcessWalkerBones(), Rewind(), Stop(), and UpdatePositions().
|
private |
Definition at line 115 of file CarlaReplayer.h.
Referenced by ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessWalkerBones(), Rewind(), and UpdatePositions().
|
private |
Definition at line 113 of file CarlaReplayer.h.
Referenced by ProcessPositions(), and UpdatePositions().
|
private |
Definition at line 109 of file CarlaReplayer.h.
Referenced by ReplayFile(), and Rewind().
|
private |
Definition at line 125 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), SetTimeFactor(), Tick(), and UpdatePositions().
|
private |
Definition at line 118 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ProcessToTime(), ReplayFile(), and Rewind().
|
private |
Definition at line 119 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), Rewind(), and Stop().