|
CARLA
|
#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 |
Definition at line 28 of file CarlaReplayer.h.
|
inline |
Definition at line 55 of file CarlaReplayer.h.
|
inline |
Definition at line 56 of file CarlaReplayer.h.
References Stop().
| void CarlaReplayer::CheckPlayAfterMapLoaded | ( | void | ) |
Definition at line 230 of file CarlaReplayer.cpp.
References Autoplay, bReplaySensors, bReplayWeather, CarlaReplayer::PlayAfterLoadMap::Duration, Enabled, CarlaReplayer::PlayAfterLoadMap::Enabled, File, CarlaReplayer::PlayAfterLoadMap::Filename, FollowId, CarlaReplayer::PlayAfterLoadMap::FollowId, FollowOffset, CarlaReplayer::PlayAfterLoadMap::FollowOffset, GetTotalTime(), Helper, ProcessToTime(), CarlaReplayerHelper::RemoveStaticProps(), CarlaReplayer::PlayAfterLoadMap::ReplaySensors, CarlaReplayer::PlayAfterLoadMap::ReplayWeather, Rewind(), Stop(), CarlaReplayer::PlayAfterLoadMap::TimeFactor, TimeFactor, CarlaReplayer::PlayAfterLoadMap::TimeStart, TimeToStop, and TotalTime.
Referenced by ACarlaGameModeBase::BeginPlay(), and FCarlaEngine::NotifyBeginEpisode().
| 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().
| void CarlaReplayer::Disable | ( | void | ) |
| void CarlaReplayer::Enable | ( | 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().
|
private |
Definition at line 90 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 910 of file CarlaReplayer.cpp.
References Helper, and CarlaReplayerHelper::ProcessReplayerPosition().
Referenced by UpdatePositions().
|
inline |
Definition at line 81 of file CarlaReplayer.h.
References Enabled.
Referenced by UCarlaEpisode::EndPlay(), ACarlaRecorder::Start(), and ACarlaRecorder::Ticking().
|
private |
Definition at line 667 of file CarlaReplayer.cpp.
References CarlaRecorderAnimBiker::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimBiker(), CarlaRecorderAnimBiker::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 602 of file CarlaReplayer.cpp.
References File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimVehicle(), ReadValue(), and Vehicle.
Referenced by ProcessToTime().
|
private |
Definition at line 622 of file CarlaReplayer.cpp.
References CurrWheels, File, MappedId, PrevWheels, ReadValue(), and Vehicle.
Referenced by ProcessToTime().
|
private |
Definition at line 647 of file CarlaReplayer.cpp.
References CarlaRecorderAnimWalker::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimWalker(), CarlaRecorderAnimWalker::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 704 of file CarlaReplayer.cpp.
References CarlaRecorderDoorVehicle::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerDoorVehicle(), CarlaRecorderDoorVehicle::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 482 of file CarlaReplayer.cpp.
References bReplaySensors, EventAdd, File, Helper, IgnoreHero, IgnoreSpectator, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerEventAdd(), ReadValue(), and SpawnedIds.
Referenced by ProcessToTime().
|
private |
Definition at line 548 of file CarlaReplayer.cpp.
References EventDel, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerEventDel(), ReadValue(), and SpawnedIds.
Referenced by ProcessToTime().
|
private |
Definition at line 564 of file CarlaReplayer.cpp.
References EventParent, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerEventParent(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 740 of file CarlaReplayer.cpp.
References File, Helper, CarlaReplayerHelper::ProcessReplayerLightScene(), CarlaRecorderLightScene::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 685 of file CarlaReplayer.cpp.
References CarlaRecorderLightVehicle::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerLightVehicle(), CarlaRecorderLightVehicle::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 754 of file CarlaReplayer.cpp.
References CurrPos, CarlaRecorderPosition::DatabaseId, File, MappedId, PrevPos, CarlaRecorderPosition::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 579 of file CarlaReplayer.cpp.
References CarlaRecorderStateTrafficLight::DatabaseId, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerStateTrafficLight(), CarlaRecorderStateTrafficLight::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 293 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(), ProcessDoorVehicle(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessVisualTime(), ProcessWalkerBones(), ProcessWeather(), CarlaRecorderFrame::Read(), ReadHeader(), SceneLight, SkipPacket(), State, Stop(), TimeToStop, UpdatePositions(), UpdateWheels(), VehicleDoor, VehicleLight, VisualTime, WalkerBones, and Weather.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), Stop(), and Tick().
|
private |
Definition at line 473 of file CarlaReplayer.cpp.
References Episode, File, UCarlaEpisode::SetVisualGameTime(), and VisualTime.
Referenced by ProcessToTime().
|
private |
Definition at line 787 of file CarlaReplayer.cpp.
References CarlaRecorderWalkerBones::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerWalkerBones(), CarlaRecorderWalkerBones::Read(), and ReadValue().
Referenced by ProcessToTime().
|
private |
Definition at line 723 of file CarlaReplayer.cpp.
References bReplayWeather, File, Helper, CarlaReplayerHelper::ProcessReplayerWeather(), ReadValue(), and Weather.
Referenced by ProcessToTime().
|
private |
Definition at line 51 of file CarlaReplayer.cpp.
References File, CarlaReplayer::Header::Id, ReadValue(), 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, | ||
| const FTransform & | Offset = FTransform(), | ||
| bool | ReplaySensors = false, | ||
| bool | ReplayWeather = false, | ||
| std::string | MapOverride = "" ) |
Definition at line 120 of file CarlaReplayer.cpp.
References Autoplay, bReplaySensors, bReplayWeather, CarlaReplayer::PlayAfterLoadMap::Duration, Enabled, CarlaReplayer::PlayAfterLoadMap::Enabled, Episode, File, CarlaReplayer::PlayAfterLoadMap::Filename, FollowId, CarlaReplayer::PlayAfterLoadMap::FollowId, FollowOffset, CarlaReplayer::PlayAfterLoadMap::FollowOffset, UCarlaEpisode::GetMapName(), GetRecorderFilename(), GetTotalTime(), Helper, IgnoreHero, IgnoreSpectator, UCarlaEpisode::LoadNewEpisode(), CarlaRecorderInfo::Mapfile, CarlaReplayer::PlayAfterLoadMap::Mapfile, ProcessToTime(), RecInfo, CarlaReplayerHelper::RemoveStaticProps(), CarlaReplayer::PlayAfterLoadMap::ReplaySensors, CarlaReplayer::PlayAfterLoadMap::ReplayWeather, Rewind(), Stop(), CarlaReplayer::PlayAfterLoadMap::TimeFactor, TimeFactor, CarlaReplayer::PlayAfterLoadMap::TimeStart, TimeToStop, and TotalTime.
Referenced by ACarlaRecorder::ReplayFile().
|
private |
Definition at line 69 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 87 of file CarlaReplayer.h.
References Episode, Helper, CarlaReplayerHelper::SetEpisode(), and SpawnedIds.
|
inline |
Definition at line 102 of file CarlaReplayer.h.
References IgnoreHero.
Referenced by ACarlaRecorder::SetReplayerIgnoreHero().
|
inline |
Definition at line 108 of file CarlaReplayer.h.
References IgnoreSpectator.
Referenced by ACarlaRecorder::SetReplayerIgnoreSpectator().
|
inline |
Definition at line 96 of file CarlaReplayer.h.
References TimeFactor.
Referenced by ACarlaRecorder::SetReplayerTimeFactor().
|
private |
Definition at line 64 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 921 of file CarlaReplayer.cpp.
References Enabled, ProcessToTime(), Tick(), and TimeFactor.
Referenced by Tick(), and ACarlaRecorder::Ticking().
|
private |
Definition at line 807 of file CarlaReplayer.cpp.
References CurrPos, FollowId, FollowOffset, Helper, IgnoreHero, IgnoreSpectator, InterpolatePosition(), IsHeroMap, MappedId, PrevPos, CarlaReplayerHelper::SetCameraPosition(), and TimeFactor.
Referenced by ProcessToTime().
|
private |
Definition at line 863 of file CarlaReplayer.cpp.
References CurrPos, CurrWheels, Helper, IgnoreHero, IsHeroMap, PrevPos, PrevWheels, CarlaReplayerHelper::ProcessReplayerAnimVehicleWheels(), and TimeFactor.
Referenced by ProcessToTime().
|
static |
Definition at line 15 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().
|
private |
Definition at line 122 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ProcessEventsAdd(), and ReplayFile().
|
private |
Definition at line 123 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ProcessWeather(), and ReplayFile().
|
private |
Definition at line 142 of file CarlaReplayer.h.
Referenced by ProcessToTime(), and Rewind().
|
private |
Definition at line 131 of file CarlaReplayer.h.
Referenced by ProcessPositions(), UpdatePositions(), and UpdateWheels().
|
private |
Definition at line 134 of file CarlaReplayer.h.
Referenced by ProcessAnimVehicleWheels(), and UpdateWheels().
|
private |
Definition at line 121 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), IsEnabled(), ProcessToTime(), ReplayFile(), Stop(), and Tick().
|
private |
Definition at line 124 of file CarlaReplayer.h.
Referenced by DestroySpawnedActors(), ProcessVisualTime(), ReplayFile(), and SetEpisode().
|
private |
Definition at line 126 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), GetTotalTime(), ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessDoorVehicle(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessToTime(), ProcessVisualTime(), ProcessWalkerBones(), ProcessWeather(), ReadHeader(), ReplayFile(), Rewind(), SkipPacket(), and Stop().
|
private |
Definition at line 148 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), and UpdatePositions().
|
private |
Definition at line 150 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), and UpdatePositions().
|
private |
Definition at line 129 of file CarlaReplayer.h.
Referenced by GetTotalTime(), ProcessToTime(), and Rewind().
|
private |
Definition at line 127 of file CarlaReplayer.h.
|
private |
Definition at line 146 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), DestroySpawnedActors(), InterpolatePosition(), ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimWalker(), ProcessDoorVehicle(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightScene(), ProcessLightVehicle(), ProcessStates(), ProcessWalkerBones(), ProcessWeather(), ReplayFile(), SetEpisode(), Stop(), UpdatePositions(), and UpdateWheels().
|
private |
Definition at line 154 of file CarlaReplayer.h.
Referenced by ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimWalker(), ProcessDoorVehicle(), ProcessEventsAdd(), ProcessLightVehicle(), ProcessWalkerBones(), ReplayFile(), SetIgnoreHero(), Stop(), UpdatePositions(), and UpdateWheels().
|
private |
Definition at line 155 of file CarlaReplayer.h.
Referenced by ProcessEventsAdd(), ReplayFile(), SetIgnoreSpectator(), and UpdatePositions().
|
private |
Definition at line 156 of file CarlaReplayer.h.
Referenced by ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimWalker(), ProcessDoorVehicle(), ProcessEventsAdd(), ProcessLightVehicle(), ProcessWalkerBones(), Rewind(), Stop(), UpdatePositions(), and UpdateWheels().
|
private |
Definition at line 137 of file CarlaReplayer.h.
Referenced by ProcessAnimBiker(), ProcessAnimVehicle(), ProcessAnimVehicleWheels(), ProcessAnimWalker(), ProcessDoorVehicle(), ProcessEventsAdd(), ProcessEventsDel(), ProcessEventsParent(), ProcessLightVehicle(), ProcessPositions(), ProcessStates(), ProcessWalkerBones(), Rewind(), and UpdatePositions().
|
private |
Definition at line 132 of file CarlaReplayer.h.
Referenced by ProcessPositions(), UpdatePositions(), and UpdateWheels().
|
private |
Definition at line 135 of file CarlaReplayer.h.
Referenced by ProcessAnimVehicleWheels(), and UpdateWheels().
|
private |
Definition at line 128 of file CarlaReplayer.h.
Referenced by ReplayFile(), and Rewind().
|
private |
Definition at line 140 of file CarlaReplayer.h.
Referenced by DestroySpawnedActors(), ForgetSpawnedActors(), ProcessEventsAdd(), ProcessEventsDel(), and SetEpisode().
|
private |
Definition at line 152 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), SetTimeFactor(), Tick(), UpdatePositions(), and UpdateWheels().
|
private |
Definition at line 143 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ProcessToTime(), ReplayFile(), and Rewind().
|
private |
Definition at line 144 of file CarlaReplayer.h.
Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), Rewind(), and Stop().