#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 | 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 | ProcessAnimVehicle (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 } |
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 195 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 SetIgnoreHero().
void CarlaReplayer::Disable | ( | void | ) |
void CarlaReplayer::Enable | ( | void | ) |
|
private |
Definition at line 75 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 709 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 526 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 546 of file CarlaReplayer.cpp.
References CarlaRecorderAnimWalker::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimWalker(), and CarlaRecorderAnimWalker::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 415 of file CarlaReplayer.cpp.
References CarlaRecorderActorDescription::Attributes, bReplaySensors, CarlaRecorderEventAdd::DatabaseId, CarlaRecorderEventAdd::Description, EventAdd, File, Helper, IgnoreHero, IsHeroMap, CarlaRecorderEventAdd::Location, MappedId, CarlaReplayerHelper::ProcessReplayerEventAdd(), CarlaRecorderEventAdd::Read(), and CarlaRecorderEventAdd::Rotation.
Referenced by ProcessToTime().
|
private |
Definition at line 473 of file CarlaReplayer.cpp.
References CarlaRecorderEventDel::DatabaseId, EventDel, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerEventDel(), and CarlaRecorderEventDel::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 488 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 585 of file CarlaReplayer.cpp.
References File, Helper, CarlaReplayerHelper::ProcessReplayerLightScene(), and CarlaRecorderLightScene::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 566 of file CarlaReplayer.cpp.
References CarlaRecorderLightVehicle::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerLightVehicle(), and CarlaRecorderLightVehicle::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 599 of file CarlaReplayer.cpp.
References CurrPos, CarlaRecorderPosition::DatabaseId, File, MappedId, PrevPos, and CarlaRecorderPosition::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 503 of file CarlaReplayer.cpp.
References CarlaRecorderStateTrafficLight::DatabaseId, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerStateTrafficLight(), and CarlaRecorderStateTrafficLight::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 256 of file CarlaReplayer.cpp.
References AnimVehicle, AnimWalker, Collision, CurrentTime, CarlaRecorderFrame::DurationThis, CarlaRecorderFrame::Elapsed, Enabled, EventAdd, EventDel, EventParent, File, Frame, FrameEnd, FrameStart, CarlaReplayer::Header::Id, Position, ProcessAnimVehicle(), 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 406 of file CarlaReplayer.cpp.
References Episode, File, CarlaRecorderVisualTime::Read(), UCarlaEpisode::SetVisualGameTime(), CarlaRecorderVisualTime::Time, and VisualTime.
Referenced by ProcessToTime().
|
private |
Definition at line 632 of file CarlaReplayer.cpp.
References CarlaRecorderWalkerBones::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerWalkerBones(), and CarlaRecorderWalkerBones::Read().
Referenced by ProcessToTime().
|
private |
Definition at line 36 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 105 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, 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 54 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 CheckPlayAfterMapLoaded(), IgnoreHero, and Tick().
Referenced by ACarlaRecorder::SetReplayerIgnoreHero().
|
inline |
Definition at line 78 of file CarlaReplayer.h.
References TimeFactor.
Referenced by ACarlaRecorder::SetReplayerTimeFactor().
|
private |
Definition at line 49 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 720 of file CarlaReplayer.cpp.
References Enabled, ProcessToTime(), and TimeFactor.
Referenced by SetIgnoreHero(), and ACarlaRecorder::Ticking().
|
private |
Definition at line 652 of file CarlaReplayer.cpp.
References CurrPos, FollowId, Helper, IgnoreHero, 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 98 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ProcessEventsAdd(), and ReplayFile().
|
private |
Definition at line 111 of file CarlaReplayer.h.
Referenced by ProcessToTime(), and Rewind().
|
private |
Definition at line 106 of file CarlaReplayer.h.
Referenced by ProcessPositions(), and UpdatePositions().
|
private |
Definition at line 97 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), IsEnabled(), ProcessToTime(), ReplayFile(), Stop(), and Tick().
|
private |
Definition at line 99 of file CarlaReplayer.h.
Referenced by ProcessVisualTime(), ReplayFile(), and SetEpisode().
|
private |
Definition at line 101 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), GetTotalTime(), ProcessAnimVehicle(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessToTime(), ProcessVisualTime(), ProcessWalkerBones(), ReadHeader(), ReplayFile(), Rewind(), SkipPacket(), and Stop().
|
private |
Definition at line 117 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), UpdatePositions(), and ~CarlaReplayer().
|
private |
Definition at line 104 of file CarlaReplayer.h.
Referenced by GetTotalTime(), ProcessToTime(), and Rewind().
|
private |
Definition at line 102 of file CarlaReplayer.h.
|
private |
Definition at line 115 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), InterpolatePosition(), ProcessAnimVehicle(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessStates(), ProcessWalkerBones(), ReplayFile(), SetEpisode(), Stop(), and UpdatePositions().
|
private |
Definition at line 121 of file CarlaReplayer.h.
Referenced by ProcessAnimVehicle(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessLightVehicle(), ProcessWalkerBones(), SetIgnoreHero(), Stop(), and UpdatePositions().
|
private |
Definition at line 122 of file CarlaReplayer.h.
Referenced by ProcessAnimVehicle(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessLightVehicle(), ProcessWalkerBones(), Rewind(), Stop(), and UpdatePositions().
|
private |
Definition at line 109 of file CarlaReplayer.h.
Referenced by ProcessAnimVehicle(), ProcessAnimWalker(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessWalkerBones(), Rewind(), and UpdatePositions().
|
private |
Definition at line 107 of file CarlaReplayer.h.
Referenced by ProcessPositions(), and UpdatePositions().
|
private |
Definition at line 103 of file CarlaReplayer.h.
Referenced by ReplayFile(), and Rewind().
|
private |
Definition at line 119 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), SetTimeFactor(), Tick(), and UpdatePositions().
|
private |
Definition at line 112 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ProcessToTime(), ReplayFile(), and Rewind().
|
private |
Definition at line 113 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), Rewind(), and Stop().