CARLA
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ALargeMapManager Class Reference

#include <LargeMapManager.h>

+ Inheritance diagram for ALargeMapManager:
+ Collaboration diagram for ALargeMapManager:

Public Types

using TileID = uint64
 

Public Member Functions

void AddActorToUnloadedList (const FCarlaActor &CarlaActor, const FTransform &Transform)
 
 ALargeMapManager ()
 
void ClearWorldAndTiles ()
 
void GenerateLargeMap ()
 
void GenerateMap (FString InAssetsPath)
 
void GenerateMap (TArray< TPair< FString, FIntVector >> MapPathsIds)
 
void GenerateMap_Editor ()
 
float GetActorStreamingDistance () const
 
FCarlaMapTileGetCarlaMapTile (FVector Location)
 
FCarlaMapTileGetCarlaMapTile (ULevel *InLevel)
 
FCarlaMapTileGetCarlaMapTile (FIntVector TileVectorID)
 
FCarlaMapTileGetCarlaMapTile (TileID TileID)
 
ACarlaWheeledVehicleGetHeroVehicle ()
 
float GetLayerStreamingDistance () const
 
int GetNumTiles () const
 
FIntVector GetNumTilesInXY () const
 
FVector GetTile0Offset ()
 
TileID GetTileID (FVector TileLocation) const
 From a given location it retrieves the TileID that covers that area. More...
 
TileID GetTileID (FDVector TileLocation) const
 
TileID GetTileID (FIntVector TileVectorID) const
 
FVector GetTileLocation (TileID TileID) const
 
FVector GetTileLocation (FIntVector TileVectorID) const
 
FDVector GetTileLocationD (TileID TileID) const
 
FDVector GetTileLocationD (FIntVector TileVectorID) const
 
float GetTileSize ()
 
FIntVector GetTileVectorID (FVector TileLocation) const
 
FIntVector GetTileVectorID (FDVector TileLocation) const
 
FIntVector GetTileVectorID (TileID TileID) const
 
FVector GlobalToLocalLocation (const FVector &InLocation) const
 
FTransform GlobalToLocalTransform (const FTransform &InTransform) const
 
bool IsLevelOfTileLoaded (FIntVector InTileID) const
 
bool IsTileLoaded (TileID TileId) const
 
bool IsTileLoaded (FVector Location) const
 
bool IsTileLoaded (FDVector Location) const
 
FCarlaMapTileLoadCarlaMapTile (FString TileMapPath, TileID TileId)
 
FVector LocalToGlobalLocation (const FVector &InLocation) const
 
FTransform LocalToGlobalTransform (const FTransform &InTransform) const
 
void OnActorDestroyed (AActor *DestroyedActor)
 
void OnActorSpawned (const FCarlaActor &CarlaActor)
 
void RegisterInitialObjects ()
 
void SetActorStreamingDistance (float Distance)
 
void SetLayerStreamingDistance (float Distance)
 
void SetTile0Offset (const FVector &Offset)
 
void SetTileSize (float Size)
 
void Tick (float DeltaTime) override
 
 ~ALargeMapManager ()
 

Public Attributes

FString LargeMapName = "testmap"
 
FString LargeMapTilePath = "/Game/Carla/Maps/testmap"
 

Protected Member Functions

virtual void BeginPlay () override
 
void CheckActiveActors ()
 
void CheckDormantActors ()
 
void CheckIfRebaseIsNeeded ()
 
void ConvertActiveToDormantActors ()
 
void ConvertDormantToActiveActors ()
 
void DumpTilesTable () const
 
FString GenerateTileName (TileID TileID)
 
void GetTilesThatNeedToChangeState (const TSet< TileID > &InTilesToConsider, TSet< TileID > &OutTilesToBeVisible, TSet< TileID > &OutTilesToHidde)
 
void GetTilesToConsider (const AActor *ActorToConsider, TSet< TileID > &OutTilesToConsider)
 
void OnLevelAddedToWorld (ULevel *InLevel, UWorld *InWorld)
 
void OnLevelRemovedFromWorld (ULevel *InLevel, UWorld *InWorld)
 
void PostWorldOriginOffset (UWorld *InWorld, FIntVector InSrcOrigin, FIntVector InDstOrigin)
 
void PreWorldOriginOffset (UWorld *InWorld, FIntVector InSrcOrigin, FIntVector InDstOrigin)
 
void PrintMapInfo ()
 
void RegisterTilesInWorldComposition ()
 
void RemoveLandscapeCollisionIfHaveTerraMechanics (ULevel *InLevel)
 
void RemovePendingActorsToRemove ()
 
FString TileIDToString (TileID TileID)
 
void UpdateCurrentTilesLoaded (const TSet< TileID > &InTilesToBeVisible, const TSet< TileID > &InTilesToHidde)
 
void UpdateTilesState ()
 
void UpdateTileState (const TSet< TileID > &InTilesToUpdate, bool InShouldBlockOnLoad, bool InShouldBeLoaded, bool InShouldBeVisible)
 

Protected Attributes

TArray< FCarlaActor::IdTypeActiveActors
 
TSet< FCarlaActor::IdTypeActivesToRemove
 
TSet< FCarlaActor::IdTypeActiveToDormantActors
 
TArray< AActor * > ActorsToConsider
 
TSet< AActor * > ActorsToRemove
 
float ActorStreamingDistance = 2.0f * 1000.0f * 100.0f
 
float ActorStreamingDistanceSquared = ActorStreamingDistance * ActorStreamingDistance
 
FString AssetsPath = ""
 
FString BaseTileMapPath = "/Game/Carla/Maps/LargeMap/EmptyTileBase"
 
bool bHasTerramechanics = false
 
bool bPrintErrors = false
 
bool bPrintMapInfo = true
 
const int32 ClientLocMsgIndex = 200
 
FDVector CurrentOriginD
 
FIntVector CurrentOriginInt { 0 }
 
TSet< uint64 > CurrentTilesLoaded
 
TArray< FCarlaActor::IdTypeDormantActors
 
TSet< FCarlaActor::IdTypeDormantsToRemove
 
TSet< FCarlaActor::IdTypeDormantToActiveActors
 
float LayerStreamingDistance = 3.0f * 1000.0f * 100.0f
 
float LayerStreamingDistanceSquared = LayerStreamingDistance * LayerStreamingDistance
 
FVector LocalTileOffset = FVector(0,0,0)
 
TMap< uint64, FCarlaMapTileMapTiles
 
const int32 MaxClientLocMsgIndex = ClientLocMsgIndex + 10
 
const int32 MaxTilesDistMsgIndex = TilesDistMsgIndex + 10
 
float MsgTime = 1.0f
 
FColor PositonMsgColor = FColor::Purple
 
float RebaseOriginDistance = 2.0f * 1000.0f * 100.0f
 
float RebaseOriginDistanceSquared = RebaseOriginDistance * RebaseOriginDistance
 
bool ShouldTilesBlockOnLoad = false
 
float TickInterval = 0.0f
 
FVector Tile0Offset = FVector(0,0,0)
 
const int32 TilesDistMsgIndex = 100
 
float TileSide = 2.0f * 1000.0f * 100.0f
 

Detailed Description

Definition at line 61 of file LargeMapManager.h.

Member Typedef Documentation

◆ TileID

using ALargeMapManager::TileID = uint64

Definition at line 67 of file LargeMapManager.h.

Constructor & Destructor Documentation

◆ ALargeMapManager()

ALargeMapManager::ALargeMapManager ( )

Definition at line 32 of file LargeMapManager.cpp.

◆ ~ALargeMapManager()

ALargeMapManager::~ALargeMapManager ( )

Remove delegates

Definition at line 38 of file LargeMapManager.cpp.

Member Function Documentation

◆ AddActorToUnloadedList()

void ALargeMapManager::AddActorToUnloadedList ( const FCarlaActor CarlaActor,
const FTransform &  Transform 
)

Definition at line 468 of file LargeMapManager.cpp.

◆ BeginPlay()

void ALargeMapManager::BeginPlay ( )
overrideprotectedvirtual

Setup delegates

Definition at line 51 of file LargeMapManager.cpp.

References ActorStreamingDistance, ActorStreamingDistanceSquared, bHasTerramechanics, LayerStreamingDistance, LayerStreamingDistanceSquared, OnLevelAddedToWorld(), OnLevelRemovedFromWorld(), PostWorldOriginOffset(), PreWorldOriginOffset(), RebaseOriginDistance, RebaseOriginDistanceSquared, and RegisterTilesInWorldComposition().

+ Here is the call graph for this function:

◆ CheckActiveActors()

void ALargeMapManager::CheckActiveActors ( )
protected

Definition at line 733 of file LargeMapManager.cpp.

References ActiveActors, ActivesToRemove, ActiveToDormantActors, ActorsToConsider, ActorStreamingDistanceSquared, CurrentOriginD, UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActor(), UCarlaStatics::GetCurrentEpisode(), IsTileLoaded(), and LM_LOG.

Referenced by Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckDormantActors()

void ALargeMapManager::CheckDormantActors ( )
protected

Definition at line 800 of file LargeMapManager.cpp.

References ActorsToConsider, ActorStreamingDistanceSquared, CurrentOriginD, DormantActors, DormantsToRemove, DormantToActiveActors, UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActorData(), FCarlaActor::GetActorId(), UCarlaStatics::GetCurrentEpisode(), FCarlaActor::IsDormant(), IsTileLoaded(), LM_LOG, and FActorData::Location.

Referenced by Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckIfRebaseIsNeeded()

void ALargeMapManager::CheckIfRebaseIsNeeded ( )
protected

Definition at line 883 of file LargeMapManager.cpp.

References ActorsToConsider, CurrentOriginD, GetTileID(), GetTileLocation(), IsValid(), and RebaseOriginDistance.

Referenced by OnActorSpawned(), and Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearWorldAndTiles()

void ALargeMapManager::ClearWorldAndTiles ( )

Definition at line 446 of file LargeMapManager.cpp.

References MapTiles.

Referenced by GenerateMap().

+ Here is the caller graph for this function:

◆ ConvertActiveToDormantActors()

void ALargeMapManager::ConvertActiveToDormantActors ( )
protected

Definition at line 778 of file LargeMapManager.cpp.

References ActiveToDormantActors, DormantActors, UCarlaStatics::GetCurrentEpisode(), LM_LOG, and UCarlaEpisode::PutActorToSleep().

Referenced by Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConvertDormantToActiveActors()

void ALargeMapManager::ConvertDormantToActiveActors ( )
protected

Definition at line 852 of file LargeMapManager.cpp.

References ActiveActors, CurrentOriginD, DormantActors, DormantToActiveActors, UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActor(), UCarlaStatics::GetCurrentEpisode(), FCarlaActor::IsActive(), LM_LOG, FDVector::ToString(), and UCarlaEpisode::WakeActorUp().

Referenced by Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DumpTilesTable()

void ALargeMapManager::DumpTilesTable ( ) const
protected

Definition at line 1008 of file LargeMapManager.cpp.

References AssetsPath, carla::client::detail::Get(), FCarlaMapTile::Location, MapTiles, and FCarlaMapTile::Name.

Referenced by GenerateMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateLargeMap()

void ALargeMapManager::GenerateLargeMap ( )

Definition at line 359 of file LargeMapManager.cpp.

References GenerateMap(), and LargeMapTilePath.

Referenced by ACarlaGameModeBase::InitGame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateMap() [1/2]

void ALargeMapManager::GenerateMap ( FString  InAssetsPath)

Retrive all the assets in the path

Generate tiles based on mesh positions

Definition at line 363 of file LargeMapManager.cpp.

References ActorsToConsider, AssetsPath, ClearWorldAndTiles(), DumpTilesTable(), GetTileID(), LM_LOG, LoadCarlaMapTile(), and MapTiles.

Referenced by GenerateLargeMap(), and GenerateMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateMap() [2/2]

void ALargeMapManager::GenerateMap ( TArray< TPair< FString, FIntVector >>  MapPathsIds)

Definition at line 427 of file LargeMapManager.cpp.

References ClearWorldAndTiles(), GenerateMap(), GetTileID(), LM_LOG, LoadCarlaMapTile(), and MapTiles.

+ Here is the call graph for this function:

◆ GenerateMap_Editor()

void ALargeMapManager::GenerateMap_Editor ( )
inline

Definition at line 108 of file LargeMapManager.h.

◆ GenerateTileName()

FString ALargeMapManager::GenerateTileName ( TileID  TileID)
protected

Definition at line 994 of file LargeMapManager.cpp.

◆ GetActorStreamingDistance()

float ALargeMapManager::GetActorStreamingDistance ( ) const

Definition at line 297 of file LargeMapManager.cpp.

References ActorStreamingDistance.

Referenced by FCarlaEngine::NotifyBeginEpisode().

+ Here is the caller graph for this function:

◆ GetCarlaMapTile() [1/4]

FCarlaMapTile& ALargeMapManager::GetCarlaMapTile ( FVector  Location)

Referenced by OnLevelRemovedFromWorld().

+ Here is the caller graph for this function:

◆ GetCarlaMapTile() [2/4]

FCarlaMapTile & ALargeMapManager::GetCarlaMapTile ( ULevel *  InLevel)

Definition at line 582 of file LargeMapManager.cpp.

References MapTiles, and FCarlaMapTile::StreamingLevel.

◆ GetCarlaMapTile() [3/4]

FCarlaMapTile * ALargeMapManager::GetCarlaMapTile ( FIntVector  TileVectorID)

Definition at line 599 of file LargeMapManager.cpp.

References GetTileID(), and MapTiles.

+ Here is the call graph for this function:

◆ GetCarlaMapTile() [4/4]

FCarlaMapTile * ALargeMapManager::GetCarlaMapTile ( TileID  TileID)

Definition at line 606 of file LargeMapManager.cpp.

References MapTiles.

◆ GetHeroVehicle()

ACarlaWheeledVehicle * ALargeMapManager::GetHeroVehicle ( )

Definition at line 232 of file LargeMapManager.cpp.

References ActorsToConsider, and IsValid().

+ Here is the call graph for this function:

◆ GetLayerStreamingDistance()

float ALargeMapManager::GetLayerStreamingDistance ( ) const

Definition at line 292 of file LargeMapManager.cpp.

References LayerStreamingDistance.

Referenced by FCarlaEngine::NotifyBeginEpisode().

+ Here is the caller graph for this function:

◆ GetNumTiles()

int ALargeMapManager::GetNumTiles ( ) const
inline

Definition at line 119 of file LargeMapManager.h.

Referenced by ACarlaGameModeBase::InitGame().

+ Here is the caller graph for this function:

◆ GetNumTilesInXY()

FIntVector ALargeMapManager::GetNumTilesInXY ( ) const

Definition at line 473 of file LargeMapManager.cpp.

References GetTileVectorID(), and MapTiles.

+ Here is the call graph for this function:

◆ GetTile0Offset()

FVector ALargeMapManager::GetTile0Offset ( )

Definition at line 273 of file LargeMapManager.cpp.

References Tile0Offset.

◆ GetTileID() [1/3]

ALargeMapManager::TileID ALargeMapManager::GetTileID ( FVector  TileLocation) const

From a given location it retrieves the TileID that covers that area.

Definition at line 570 of file LargeMapManager.cpp.

References GetTileVectorID().

Referenced by CheckIfRebaseIsNeeded(), GenerateMap(), GetCarlaMapTile(), GetTileID(), GetTilesToConsider(), IsLevelOfTileLoaded(), and ASoilTypeManager::Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTileID() [2/3]

ALargeMapManager::TileID ALargeMapManager::GetTileID ( FDVector  TileLocation) const

Definition at line 576 of file LargeMapManager.cpp.

References GetTileID(), and GetTileVectorID().

+ Here is the call graph for this function:

◆ GetTileID() [3/3]

ALargeMapManager::TileID ALargeMapManager::GetTileID ( FIntVector  TileVectorID) const

Definition at line 563 of file LargeMapManager.cpp.

◆ GetTileLocation() [1/2]

FVector ALargeMapManager::GetTileLocation ( TileID  TileID) const

Definition at line 539 of file LargeMapManager.cpp.

References GetTileVectorID().

Referenced by CheckIfRebaseIsNeeded(), and LoadCarlaMapTile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTileLocation() [2/2]

FVector ALargeMapManager::GetTileLocation ( FIntVector  TileVectorID) const

Definition at line 545 of file LargeMapManager.cpp.

References Tile0Offset, and TileSide.

◆ GetTileLocationD() [1/2]

FDVector ALargeMapManager::GetTileLocationD ( TileID  TileID) const

Definition at line 551 of file LargeMapManager.cpp.

References GetTileVectorID().

+ Here is the call graph for this function:

◆ GetTileLocationD() [2/2]

FDVector ALargeMapManager::GetTileLocationD ( FIntVector  TileVectorID) const

Definition at line 557 of file LargeMapManager.cpp.

References Tile0Offset, TileSide, and FDVector::Y.

◆ GetTileSize()

float ALargeMapManager::GetTileSize ( )

Definition at line 268 of file LargeMapManager.cpp.

References TileSide.

◆ GetTilesThatNeedToChangeState()

void ALargeMapManager::GetTilesThatNeedToChangeState ( const TSet< TileID > &  InTilesToConsider,
TSet< TileID > &  OutTilesToBeVisible,
TSet< TileID > &  OutTilesToHidde 
)
protected

Definition at line 946 of file LargeMapManager.cpp.

References CurrentTilesLoaded.

Referenced by UpdateTilesState().

+ Here is the caller graph for this function:

◆ GetTilesToConsider()

void ALargeMapManager::GetTilesToConsider ( const AActor ActorToConsider,
TSet< TileID > &  OutTilesToConsider 
)
protected

Definition at line 909 of file LargeMapManager.cpp.

References CurrentOriginD, GetTileID(), GetTileVectorID(), LayerStreamingDistance, and MapTiles.

Referenced by UpdateTilesState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTileVectorID() [1/3]

FIntVector ALargeMapManager::GetTileVectorID ( FVector  TileLocation) const

Definition at line 510 of file LargeMapManager.cpp.

References LocalTileOffset, Tile0Offset, and TileSide.

Referenced by GetNumTilesInXY(), ASoilTypeManager::GetTerrainPropertiesAtGlobalLocation(), GetTileID(), GetTileLocation(), GetTileLocationD(), GetTilesToConsider(), LoadCarlaMapTile(), and ASoilTypeManager::Tick().

+ Here is the caller graph for this function:

◆ GetTileVectorID() [2/3]

FIntVector ALargeMapManager::GetTileVectorID ( FDVector  TileLocation) const

Definition at line 520 of file LargeMapManager.cpp.

References LocalTileOffset, Tile0Offset, and TileSide.

◆ GetTileVectorID() [3/3]

FIntVector ALargeMapManager::GetTileVectorID ( TileID  TileID) const

Definition at line 530 of file LargeMapManager.cpp.

◆ GlobalToLocalLocation()

FVector ALargeMapManager::GlobalToLocalLocation ( const FVector &  InLocation) const

Definition at line 310 of file LargeMapManager.cpp.

References CurrentOriginD, and FDVector::ToFVector().

Referenced by FCarlaServer::FPimpl::BindActions(), FCarlaActor::GetActorLocalLocation(), FShapeVisitor::operator()(), and FCarlaActor::SetActorGlobalLocation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GlobalToLocalTransform()

FTransform ALargeMapManager::GlobalToLocalTransform ( const FTransform &  InTransform) const

Definition at line 302 of file LargeMapManager.cpp.

References CurrentOriginD, and FDVector::ToFVector().

Referenced by FShapeVisitor::operator()(), FCarlaActor::SetActorGlobalTransform(), and UCarlaEpisode::SpawnActorWithInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsLevelOfTileLoaded()

bool ALargeMapManager::IsLevelOfTileLoaded ( FIntVector  InTileID) const

Definition at line 491 of file LargeMapManager.cpp.

References bPrintErrors, GetTileID(), LM_LOG, MapTiles, and FCarlaMapTile::StreamingLevel.

+ Here is the call graph for this function:

◆ IsTileLoaded() [1/3]

bool ALargeMapManager::IsTileLoaded ( TileID  TileId) const
inline

Definition at line 127 of file LargeMapManager.h.

Referenced by CheckActiveActors(), and CheckDormantActors().

+ Here is the caller graph for this function:

◆ IsTileLoaded() [2/3]

bool ALargeMapManager::IsTileLoaded ( FVector  Location) const
inline

Definition at line 132 of file LargeMapManager.h.

◆ IsTileLoaded() [3/3]

bool ALargeMapManager::IsTileLoaded ( FDVector  Location) const
inline

Definition at line 137 of file LargeMapManager.h.

◆ LoadCarlaMapTile()

FCarlaMapTile & ALargeMapManager::LoadCarlaMapTile ( FString  TileMapPath,
TileID  TileId 
)

Definition at line 612 of file LargeMapManager.cpp.

References GetTileLocation(), GetTileVectorID(), LM_LOG, FCarlaMapTile::Location, MapTiles, FCarlaMapTile::Name, ShouldTilesBlockOnLoad, and FCarlaMapTile::StreamingLevel.

Referenced by GenerateMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LocalToGlobalLocation()

FVector ALargeMapManager::LocalToGlobalLocation ( const FVector &  InLocation) const

Definition at line 323 of file LargeMapManager.cpp.

References CurrentOriginD, and FDVector::ToFVector().

Referenced by FCarlaServer::FPimpl::BindActions(), URayTracer::CastRay(), FCarlaActor::GetActorGlobalLocation(), ASoilTypeManager::GetTerrainPropertiesAtLocalLocation(), OnActorSpawned(), AGnssSensor::PostPhysTick(), URayTracer::ProjectPoint(), FCarlaActor::SetActorLocalLocation(), and ASoilTypeManager::Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LocalToGlobalTransform()

FTransform ALargeMapManager::LocalToGlobalTransform ( const FTransform &  InTransform) const

Definition at line 315 of file LargeMapManager.cpp.

References CurrentOriginD, and FDVector::ToFVector().

Referenced by FCarlaServer::FPimpl::BindActions(), FCarlaActor::GetActorGlobalTransform(), ACarlaWheeledVehicle::GetBoxSphereBounds(), and FCarlaActor::SetActorLocalTransform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OnActorDestroyed()

void ALargeMapManager::OnActorDestroyed ( AActor DestroyedActor)

Definition at line 243 of file LargeMapManager.cpp.

References UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActorInfo(), UCarlaStatics::GetCurrentEpisode(), and LM_LOG.

Referenced by OnActorSpawned().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OnActorSpawned()

void ALargeMapManager::OnActorSpawned ( const FCarlaActor CarlaActor)

Definition at line 159 of file LargeMapManager.cpp.

References ActiveActors, ActorsToConsider, CheckIfRebaseIsNeeded(), FActorInfo::Description, DormantActors, FCarlaActor::GetActor(), FCarlaActor::GetActorId(), FCarlaActor::GetActorInfo(), UCarlaEpisode::GetActorRegistry(), FCarlaActor::GetActorType(), UCarlaStatics::GetCurrentEpisode(), IsValid(), LM_LOG, LocalToGlobalLocation(), OnActorDestroyed(), UpdateTilesState(), FActorAttribute::Value, FActorDescription::Variations, and FCarlaActor::Vehicle.

Referenced by FCarlaServer::FPimpl::BindActions(), RegisterInitialObjects(), CarlaReplayerHelper::TryToCreateReplayerActor(), and FFrameData::TryToCreateReplayerActor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OnLevelAddedToWorld()

void ALargeMapManager::OnLevelAddedToWorld ( ULevel *  InLevel,
UWorld *  InWorld 
)
protected

Definition at line 126 of file LargeMapManager.cpp.

References LM_LOG, and ATagger::TagActorsInLevel().

Referenced by BeginPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OnLevelRemovedFromWorld()

void ALargeMapManager::OnLevelRemovedFromWorld ( ULevel *  InLevel,
UWorld *  InWorld 
)
protected

Definition at line 135 of file LargeMapManager.cpp.

References GetCarlaMapTile(), LM_LOG, and FCarlaMapTile::TilesSpawned.

Referenced by BeginPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PostWorldOriginOffset()

void ALargeMapManager::PostWorldOriginOffset ( UWorld *  InWorld,
FIntVector  InSrcOrigin,
FIntVector  InDstOrigin 
)
protected

Definition at line 92 of file LargeMapManager.cpp.

References CurrentOriginD, CurrentOriginInt, UCarlaStatics::GetCurrentEpisode(), LM_LOG, FCarlaMapTile::Location, MapTiles, MsgTime, PositonMsgColor, UCarlaEpisode::SetCurrentMapOrigin(), and FCarlaMapTile::StreamingLevel.

Referenced by BeginPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PreWorldOriginOffset()

void ALargeMapManager::PreWorldOriginOffset ( UWorld *  InWorld,
FIntVector  InSrcOrigin,
FIntVector  InDstOrigin 
)
protected

Definition at line 87 of file LargeMapManager.cpp.

References LM_LOG.

Referenced by BeginPlay().

+ Here is the caller graph for this function:

◆ PrintMapInfo()

void ALargeMapManager::PrintMapInfo ( )
protected

Definition at line 1035 of file LargeMapManager.cpp.

References ActiveActors, ActorsToConsider, ClientLocMsgIndex, CurrentOriginD, CurrentOriginInt, CurrentTilesLoaded, FDVector::Dist(), DormantActors, IsValid(), FCarlaMapTile::Location, MapTiles, MaxClientLocMsgIndex, MaxTilesDistMsgIndex, MsgTime, PositonMsgColor, FCarlaMapTile::StreamingLevel, TileIDToString(), TilesDistMsgIndex, and TileSide.

Referenced by Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterInitialObjects()

void ALargeMapManager::RegisterInitialObjects ( )

Definition at line 143 of file LargeMapManager.cpp.

References UCarlaEpisode::GetActorRegistry(), UCarlaStatics::GetCurrentEpisode(), and OnActorSpawned().

Referenced by ACarlaGameModeBase::BeginPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterTilesInWorldComposition()

void ALargeMapManager::RegisterTilesInWorldComposition ( )
protected

Definition at line 451 of file LargeMapManager.cpp.

References MapTiles.

Referenced by BeginPlay().

+ Here is the caller graph for this function:

◆ RemoveLandscapeCollisionIfHaveTerraMechanics()

void ALargeMapManager::RemoveLandscapeCollisionIfHaveTerraMechanics ( ULevel *  InLevel)
protected

◆ RemovePendingActorsToRemove()

void ALargeMapManager::RemovePendingActorsToRemove ( )
protected

Definition at line 705 of file LargeMapManager.cpp.

References ActiveActors, ActivesToRemove, ActorsToConsider, ActorsToRemove, DormantActors, DormantsToRemove, and LM_LOG.

Referenced by Tick().

+ Here is the caller graph for this function:

◆ SetActorStreamingDistance()

void ALargeMapManager::SetActorStreamingDistance ( float  Distance)

Definition at line 285 of file LargeMapManager.cpp.

References ActorStreamingDistance, and ActorStreamingDistanceSquared.

Referenced by FCarlaEngine::OnEpisodeSettingsChanged().

+ Here is the caller graph for this function:

◆ SetLayerStreamingDistance()

void ALargeMapManager::SetLayerStreamingDistance ( float  Distance)

Definition at line 278 of file LargeMapManager.cpp.

References LayerStreamingDistance, and LayerStreamingDistanceSquared.

Referenced by FCarlaEngine::OnEpisodeSettingsChanged().

+ Here is the caller graph for this function:

◆ SetTile0Offset()

void ALargeMapManager::SetTile0Offset ( const FVector &  Offset)

Definition at line 258 of file LargeMapManager.cpp.

References Tile0Offset.

◆ SetTileSize()

void ALargeMapManager::SetTileSize ( float  Size)

Definition at line 263 of file LargeMapManager.cpp.

References TileSide.

◆ Tick()

void ALargeMapManager::Tick ( float  DeltaTime)
override

Definition at line 330 of file LargeMapManager.cpp.

References bPrintMapInfo, CheckActiveActors(), CheckDormantActors(), CheckIfRebaseIsNeeded(), ConvertActiveToDormantActors(), ConvertDormantToActiveActors(), PrintMapInfo(), RemovePendingActorsToRemove(), and UpdateTilesState().

+ Here is the call graph for this function:

◆ TileIDToString()

FString ALargeMapManager::TileIDToString ( TileID  TileID)
protected

Definition at line 1001 of file LargeMapManager.cpp.

Referenced by PrintMapInfo().

+ Here is the caller graph for this function:

◆ UpdateCurrentTilesLoaded()

void ALargeMapManager::UpdateCurrentTilesLoaded ( const TSet< TileID > &  InTilesToBeVisible,
const TSet< TileID > &  InTilesToHidde 
)
protected

Definition at line 978 of file LargeMapManager.cpp.

References CurrentTilesLoaded.

Referenced by UpdateTilesState().

+ Here is the caller graph for this function:

◆ UpdateTilesState()

void ALargeMapManager::UpdateTilesState ( )
protected

Definition at line 674 of file LargeMapManager.cpp.

References ActorsToConsider, ActorsToRemove, GetTilesThatNeedToChangeState(), GetTilesToConsider(), IsValid(), UpdateCurrentTilesLoaded(), and UpdateTileState().

Referenced by OnActorSpawned(), and Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateTileState()

void ALargeMapManager::UpdateTileState ( const TSet< TileID > &  InTilesToUpdate,
bool  InShouldBlockOnLoad,
bool  InShouldBeLoaded,
bool  InShouldBeVisible 
)
protected

Definition at line 956 of file LargeMapManager.cpp.

References MapTiles, and FCarlaMapTile::StreamingLevel.

Referenced by UpdateTilesState().

+ Here is the caller graph for this function:

Member Data Documentation

◆ ActiveActors

TArray<FCarlaActor::IdType> ALargeMapManager::ActiveActors
protected

◆ ActivesToRemove

TSet<FCarlaActor::IdType> ALargeMapManager::ActivesToRemove
protected

Definition at line 261 of file LargeMapManager.h.

Referenced by CheckActiveActors(), and RemovePendingActorsToRemove().

◆ ActiveToDormantActors

TSet<FCarlaActor::IdType> ALargeMapManager::ActiveToDormantActors
protected

Definition at line 265 of file LargeMapManager.h.

Referenced by CheckActiveActors(), and ConvertActiveToDormantActors().

◆ ActorsToConsider

TArray<AActor*> ALargeMapManager::ActorsToConsider
protected

◆ ActorsToRemove

TSet<AActor*> ALargeMapManager::ActorsToRemove
protected

Definition at line 260 of file LargeMapManager.h.

Referenced by RemovePendingActorsToRemove(), and UpdateTilesState().

◆ ActorStreamingDistance

float ALargeMapManager::ActorStreamingDistance = 2.0f * 1000.0f * 100.0f
protected

◆ ActorStreamingDistanceSquared

float ALargeMapManager::ActorStreamingDistanceSquared = ActorStreamingDistance * ActorStreamingDistance
protected

◆ AssetsPath

FString ALargeMapManager::AssetsPath = ""
protected

Definition at line 317 of file LargeMapManager.h.

Referenced by DumpTilesTable(), and GenerateMap().

◆ BaseTileMapPath

FString ALargeMapManager::BaseTileMapPath = "/Game/Carla/Maps/LargeMap/EmptyTileBase"
protected

Definition at line 319 of file LargeMapManager.h.

◆ bHasTerramechanics

bool ALargeMapManager::bHasTerramechanics = false
protected

Definition at line 339 of file LargeMapManager.h.

Referenced by BeginPlay().

◆ bPrintErrors

bool ALargeMapManager::bPrintErrors = false
protected

Definition at line 336 of file LargeMapManager.h.

Referenced by IsLevelOfTileLoaded().

◆ bPrintMapInfo

bool ALargeMapManager::bPrintMapInfo = true
protected

Definition at line 333 of file LargeMapManager.h.

Referenced by Tick().

◆ ClientLocMsgIndex

const int32 ALargeMapManager::ClientLocMsgIndex = 200
protected

Definition at line 326 of file LargeMapManager.h.

Referenced by PrintMapInfo().

◆ CurrentOriginD

FDVector ALargeMapManager::CurrentOriginD
protected

◆ CurrentOriginInt

FIntVector ALargeMapManager::CurrentOriginInt { 0 }
protected

Definition at line 273 of file LargeMapManager.h.

Referenced by PostWorldOriginOffset(), and PrintMapInfo().

◆ CurrentTilesLoaded

TSet<uint64> ALargeMapManager::CurrentTilesLoaded
protected

◆ DormantActors

TArray<FCarlaActor::IdType> ALargeMapManager::DormantActors
protected

◆ DormantsToRemove

TSet<FCarlaActor::IdType> ALargeMapManager::DormantsToRemove
protected

Definition at line 262 of file LargeMapManager.h.

Referenced by CheckDormantActors(), and RemovePendingActorsToRemove().

◆ DormantToActiveActors

TSet<FCarlaActor::IdType> ALargeMapManager::DormantToActiveActors
protected

Definition at line 266 of file LargeMapManager.h.

Referenced by CheckDormantActors(), and ConvertDormantToActiveActors().

◆ LargeMapName

FString ALargeMapManager::LargeMapName = "testmap"

Definition at line 151 of file LargeMapManager.h.

Referenced by ACarlaGameModeBase::InitGame().

◆ LargeMapTilePath

FString ALargeMapManager::LargeMapTilePath = "/Game/Carla/Maps/testmap"

Definition at line 149 of file LargeMapManager.h.

Referenced by GenerateLargeMap().

◆ LayerStreamingDistance

float ALargeMapManager::LayerStreamingDistance = 3.0f * 1000.0f * 100.0f
protected

◆ LayerStreamingDistanceSquared

float ALargeMapManager::LayerStreamingDistanceSquared = LayerStreamingDistance * LayerStreamingDistance
protected

Definition at line 292 of file LargeMapManager.h.

Referenced by BeginPlay(), and SetLayerStreamingDistance().

◆ LocalTileOffset

FVector ALargeMapManager::LocalTileOffset = FVector(0,0,0)
protected

Definition at line 300 of file LargeMapManager.h.

Referenced by GetTileVectorID().

◆ MapTiles

TMap<uint64, FCarlaMapTile> ALargeMapManager::MapTiles
protected

◆ MaxClientLocMsgIndex

const int32 ALargeMapManager::MaxClientLocMsgIndex = ClientLocMsgIndex + 10
protected

Definition at line 327 of file LargeMapManager.h.

Referenced by PrintMapInfo().

◆ MaxTilesDistMsgIndex

const int32 ALargeMapManager::MaxTilesDistMsgIndex = TilesDistMsgIndex + 10
protected

Definition at line 324 of file LargeMapManager.h.

Referenced by PrintMapInfo().

◆ MsgTime

float ALargeMapManager::MsgTime = 1.0f
protected

Definition at line 330 of file LargeMapManager.h.

Referenced by PostWorldOriginOffset(), and PrintMapInfo().

◆ PositonMsgColor

FColor ALargeMapManager::PositonMsgColor = FColor::Purple
protected

Definition at line 321 of file LargeMapManager.h.

Referenced by PostWorldOriginOffset(), and PrintMapInfo().

◆ RebaseOriginDistance

float ALargeMapManager::RebaseOriginDistance = 2.0f * 1000.0f * 100.0f
protected

Definition at line 290 of file LargeMapManager.h.

Referenced by BeginPlay(), and CheckIfRebaseIsNeeded().

◆ RebaseOriginDistanceSquared

float ALargeMapManager::RebaseOriginDistanceSquared = RebaseOriginDistance * RebaseOriginDistance
protected

Definition at line 294 of file LargeMapManager.h.

Referenced by BeginPlay().

◆ ShouldTilesBlockOnLoad

bool ALargeMapManager::ShouldTilesBlockOnLoad = false
protected

Definition at line 303 of file LargeMapManager.h.

Referenced by LoadCarlaMapTile().

◆ TickInterval

float ALargeMapManager::TickInterval = 0.0f
protected

Definition at line 281 of file LargeMapManager.h.

◆ Tile0Offset

FVector ALargeMapManager::Tile0Offset = FVector(0,0,0)
protected

◆ TilesDistMsgIndex

const int32 ALargeMapManager::TilesDistMsgIndex = 100
protected

Definition at line 323 of file LargeMapManager.h.

Referenced by PrintMapInfo().

◆ TileSide

float ALargeMapManager::TileSide = 2.0f * 1000.0f * 100.0f
protected

The documentation for this class was generated from the following files: