From 9586cd24d55c7d3231ec02eaf01ec75066eabfde Mon Sep 17 00:00:00 2001 From: Axel1092 <35765780+Axel1092@users.noreply.github.com> Date: Mon, 21 Sep 2020 14:42:18 +0200 Subject: [PATCH] Existing actors in replayer are positioned to the initial position. (#3328) --- .../Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp index 11c1fcb0e..01090ba5e 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp @@ -54,6 +54,10 @@ std::pairCarlaReplayerHelper::TryToCreateReplayerActor( if (desc->Id == ActorDesc.Id) { // we don't need to create, actor of same type already exist + // relocate + FRotator Rot = FRotator::MakeFromEuler(Rotation); + FTransform Trans2(Rot, Location, FVector(1, 1, 1)); + view.GetActor()->SetActorTransform(Trans2, false, nullptr, ETeleportType::TeleportPhysics); return std::pair(2, view); } }