diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vegetation/VegetationManager.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vegetation/VegetationManager.cpp index d4c8bdd13..4c74f5dc5 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vegetation/VegetationManager.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vegetation/VegetationManager.cpp @@ -488,7 +488,7 @@ void AVegetationManager::FreeTileCache(ULevel* InLevel) void AVegetationManager::UpdateMaterials(FTileData* Tile) { TRACE_CPUPROFILER_EVENT_SCOPE(AVegetationManager::UpdateMaterials); - const FTransform GlobalTransform = LargeMap->LocalToGlobalTransform(HeroVehicle->GetActorTransform()); + const FTransform GlobalTransform = HeroVehicle->GetActorTransform(); const FLinearColor Position = GlobalTransform.GetLocation(); Tile->UpdateMaterialCache(Position, DebugMaterials); } @@ -541,7 +541,7 @@ TArray AVegetationManager::GetElementsToSpawn(FTileData* Tile) void AVegetationManager::SpawnSkeletalFoliages(TArray& ElementsToSpawn) { TRACE_CPUPROFILER_EVENT_SCOPE(AVegetationManager::SpawnSkeletalFoliages); - const FTransform HeroTransform = LargeMap->LocalToGlobalTransform(HeroVehicle->GetActorTransform()); + const FTransform HeroTransform = HeroVehicle->GetActorTransform(); const FVector HeroLocation = HeroTransform.GetLocation(); const float HeroDetectionSizeSquared = HeroVehicle->GetDetectionSize() * HeroVehicle->GetDetectionSize(); @@ -589,7 +589,7 @@ void AVegetationManager::SpawnSkeletalFoliages(TArray& Element void AVegetationManager::ActivePooledActors() { TRACE_CPUPROFILER_EVENT_SCOPE(AVegetationManager::ActivePooledActors); - const FTransform HeroTransform = LargeMap->LocalToGlobalTransform(HeroVehicle->GetActorTransform()); + const FTransform HeroTransform = HeroVehicle->GetActorTransform(); const FVector HeroLocation = HeroTransform.GetLocation(); const float SquaredActiveActorDistance = ActiveActorDistance * ActiveActorDistance; @@ -615,7 +615,7 @@ void AVegetationManager::ActivePooledActors() void AVegetationManager::DestroySkeletalFoliages() { TRACE_CPUPROFILER_EVENT_SCOPE(AVegetationManager::DestroySkeletalFoliages); - const FTransform HeroTransform = LargeMap->LocalToGlobalTransform(HeroVehicle->GetActorTransform()); + const FTransform HeroTransform = HeroVehicle->GetActorTransform(); const FVector HeroLocation = HeroTransform.GetLocation(); const float HeroDetectionSizeSquared = HeroVehicle->GetDetectionSize() * HeroVehicle->GetDetectionSize(); @@ -799,8 +799,7 @@ TArray AVegetationManager::GetTilesInUse() const FBox Box = Procedural->ProceduralComponent->GetBounds(); if (!Box.IsValid) continue; - const FTransform GlobalTransform = LargeMap->LocalToGlobalTransform(HeroVehicle->GetActorTransform()); - if (Box.IsInside(GlobalTransform.GetLocation())) + if (Box.IsInside(HeroVehicle->GetActorTransform().GetLocation())) Results.Emplace(Element.Key); } return Results; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp index 96675c010..2eb5925c7 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp @@ -211,10 +211,7 @@ bool ACarlaWheeledVehicle::IsInVehicleRange(const FVector& Location) const void ACarlaWheeledVehicle::UpdateDetectionBox() { - ALargeMapManager* LargeMap = UCarlaStatics::GetLargeMapManager(GetWorld()); - if (!IsValid(LargeMap)) - return; - const FTransform GlobalTransform = LargeMap->LocalToGlobalTransform(GetActorTransform()); + const FTransform GlobalTransform = GetActorTransform(); const FVector Vec { DetectionSize, DetectionSize, DetectionSize }; FBox Box = FBox(-Vec, Vec); const FTransform NonScaledTransform(GlobalTransform.GetRotation(), GlobalTransform.GetLocation(), {1.0f, 1.0f, 1.0f});