CARLA
Public Member Functions | Public Attributes | List of all members
AVegetationManager Class Reference

#include <VegetationManager.h>

+ Inheritance diagram for AVegetationManager:
+ Collaboration diagram for AVegetationManager:

Public Member Functions

void AddVehicle (ACarlaWheeledVehicle *Vehicle)
 
void RemoveVehicle (ACarlaWheeledVehicle *Vehicle)
 
void UpdatePoolBasePosition ()
 

Public Attributes

float ActiveActorDistance {500.0f}
 
bool DebugMaterials {false}
 
float HideMaterialDistance {500.0f}
 
int32 InitialPoolSize {10}
 
bool SpawnBushes {true}
 
bool SpawnPlants {true}
 
bool SpawnRocks {true}
 
float SpawnScale {1.0f}
 
bool SpawnTrees {true}
 

Overriden from AActor

float PoolTranslationTimer {30.0f}
 
FTransform InactivePoolTransform { FQuat(1.0f, 1.0f, 1.0f, 1.0f), FVector(1.0f, 1.0f, 1.0f), FVector(1.0f, 1.0f, 1.0f)}
 
ALargeMapManagerLargeMap {nullptr}
 
ACarlaWheeledVehicleHeroVehicle {nullptr}
 
TMap< FString, FFoliageBlueprintFoliageBlueprintCache {}
 
TMap< FString, FTileDataTileCache {}
 
TMap< FString, TArray< FPooledActor > > ActorPool {}
 
FTimerHandle UpdatePoolInactiveTransformTimer
 
virtual void BeginPlay () override
 
virtual void Tick (float DeltaTime) override
 
bool IsFoliageTypeEnabled (const FString &Path) const
 
bool CheckForNewTiles () const
 
TArray< FString > GetTilesInUse ()
 
void UpdateMaterials (FTileData *Tile)
 
TArray< FElementsToSpawnGetElementsToSpawn (FTileData *Tile)
 
void SpawnSkeletalFoliages (TArray< FElementsToSpawn > &ElementsToSpawn)
 
void DestroySkeletalFoliages ()
 
void ActivePooledActors ()
 
bool EnableActorFromPool (const FTransform &Transform, int32 Index, std::shared_ptr< FTileMeshComponent > &TileMeshComponent, TArray< FPooledActor > &Pool)
 
void CreateOrUpdateTileCache (ULevel *InLevel)
 
void UpdateFoliageBlueprintCache (ULevel *InLevel)
 
void SetTileDataInternals (FTileData &TileData)
 
void SetInstancedStaticMeshComponentCache (FTileData &TileData)
 
void SetMaterialCache (FTileData &TileData)
 
void FreeTileCache (ULevel *InLevel)
 
void OnLevelAddedToWorld (ULevel *InLevel, UWorld *InWorld)
 
void OnLevelRemovedFromWorld (ULevel *InLevel, UWorld *InWorld)
 
void PostWorldOriginOffset (UWorld *, FIntVector, FIntVector InDstOrigin)
 
void CreatePoolForBPClass (const FFoliageBlueprint &BP)
 
AActorCreateFoliage (const FFoliageBlueprint &BP, const FTransform &Transform) const
 
void GetSketalTemplates ()
 

Detailed Description

Definition at line 89 of file VegetationManager.h.

Member Function Documentation

◆ ActivePooledActors()

void AVegetationManager::ActivePooledActors ( )
private

Definition at line 591 of file VegetationManager.cpp.

◆ AddVehicle()

void AVegetationManager::AddVehicle ( ACarlaWheeledVehicle Vehicle)

Definition at line 279 of file VegetationManager.cpp.

References IsValid(), and Vehicle.

Referenced by ACarlaWheeledVehicle::AddReferenceToManager().

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

◆ BeginPlay()

void AVegetationManager::BeginPlay ( )
overrideprotectedvirtual

Definition at line 231 of file VegetationManager.cpp.

References UCarlaStatics::GetLargeMapManager(), OnLevelAddedToWorld(), OnLevelRemovedFromWorld(), and PostWorldOriginOffset().

+ Here is the call graph for this function:

◆ CheckForNewTiles()

bool AVegetationManager::CheckForNewTiles ( ) const
private

Definition at line 771 of file VegetationManager.cpp.

References FTileData::InstancedFoliageActor, and IsValid().

+ Here is the call graph for this function:

◆ CreateFoliage()

AActor * AVegetationManager::CreateFoliage ( const FFoliageBlueprint BP,
const FTransform &  Transform 
) const
private

Definition at line 691 of file VegetationManager.cpp.

References FFoliageBlueprint::SpawnedClass.

◆ CreateOrUpdateTileCache()

void AVegetationManager::CreateOrUpdateTileCache ( ULevel *  InLevel)
private

Definition at line 300 of file VegetationManager.cpp.

References FTileData::InstancedFoliageActor, IsValid(), FTileData::MaterialInstanceDynamicCache, FTileData::ProceduralFoliageVolume, and FTileData::TileMeshesCache.

+ Here is the call graph for this function:

◆ CreatePoolForBPClass()

void AVegetationManager::CreatePoolForBPClass ( const FFoliageBlueprint BP)
private

Definition at line 666 of file VegetationManager.cpp.

References FPooledActor::Actor, FFoliageBlueprint::BPFullClassName, FPooledActor::DisableActor(), and IsValid().

+ Here is the call graph for this function:

◆ DestroySkeletalFoliages()

void AVegetationManager::DestroySkeletalFoliages ( )
private

Definition at line 617 of file VegetationManager.cpp.

◆ EnableActorFromPool()

bool AVegetationManager::EnableActorFromPool ( const FTransform &  Transform,
int32  Index,
std::shared_ptr< FTileMeshComponent > &  TileMeshComponent,
TArray< FPooledActor > &  Pool 
)
private

Definition at line 641 of file VegetationManager.cpp.

◆ FreeTileCache()

void AVegetationManager::FreeTileCache ( ULevel *  InLevel)
private

Definition at line 450 of file VegetationManager.cpp.

References FTileData::InstancedFoliageActor, IsValid(), FTileData::MaterialInstanceDynamicCache, FTileData::ProceduralFoliageVolume, and FTileData::TileMeshesCache.

+ Here is the call graph for this function:

◆ GetElementsToSpawn()

TArray< FElementsToSpawn > AVegetationManager::GetElementsToSpawn ( FTileData Tile)
private

◆ GetSketalTemplates()

void AVegetationManager::GetSketalTemplates ( )
private

◆ GetTilesInUse()

TArray< FString > AVegetationManager::GetTilesInUse ( )
private

Definition at line 789 of file VegetationManager.cpp.

References FTileData::InstancedFoliageActor, IsValid(), and FTileData::ProceduralFoliageVolume.

+ Here is the call graph for this function:

◆ IsFoliageTypeEnabled()

bool AVegetationManager::IsFoliageTypeEnabled ( const FString &  Path) const
private

Definition at line 753 of file VegetationManager.cpp.

◆ OnLevelAddedToWorld()

void AVegetationManager::OnLevelAddedToWorld ( ULevel *  InLevel,
UWorld *  InWorld 
)
private

Definition at line 730 of file VegetationManager.cpp.

Referenced by BeginPlay().

+ Here is the caller graph for this function:

◆ OnLevelRemovedFromWorld()

void AVegetationManager::OnLevelRemovedFromWorld ( ULevel *  InLevel,
UWorld *  InWorld 
)
private

Definition at line 737 of file VegetationManager.cpp.

Referenced by BeginPlay().

+ Here is the caller graph for this function:

◆ PostWorldOriginOffset()

void AVegetationManager::PostWorldOriginOffset ( UWorld *  ,
FIntVector  ,
FIntVector  InDstOrigin 
)
private

Definition at line 743 of file VegetationManager.cpp.

Referenced by BeginPlay().

+ Here is the caller graph for this function:

◆ RemoveVehicle()

void AVegetationManager::RemoveVehicle ( ACarlaWheeledVehicle Vehicle)

Definition at line 288 of file VegetationManager.cpp.

References IsValid().

Referenced by ACarlaWheeledVehicle::RemoveReferenceToManager().

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

◆ SetInstancedStaticMeshComponentCache()

void AVegetationManager::SetInstancedStaticMeshComponentCache ( FTileData TileData)
private

Definition at line 350 of file VegetationManager.cpp.

References FTileData::ContainsMesh(), FTileData::InstancedFoliageActor, IsValid(), FTileData::TileMeshesCache, and FTileData::UpdateTileMeshComponent().

+ Here is the call graph for this function:

◆ SetMaterialCache()

void AVegetationManager::SetMaterialCache ( FTileData TileData)
private

Definition at line 379 of file VegetationManager.cpp.

References FTileMeshComponent::InstancedStaticMeshComponent, IsValid(), FTileData::MaterialInstanceDynamicCache, and FTileData::TileMeshesCache.

+ Here is the call graph for this function:

◆ SetTileDataInternals()

void AVegetationManager::SetTileDataInternals ( FTileData TileData)
private

Definition at line 343 of file VegetationManager.cpp.

◆ SpawnSkeletalFoliages()

void AVegetationManager::SpawnSkeletalFoliages ( TArray< FElementsToSpawn > &  ElementsToSpawn)
private

Definition at line 543 of file VegetationManager.cpp.

References FPooledActor::Actor, FPooledActor::EnableActor(), and IsValid().

+ Here is the call graph for this function:

◆ Tick()

void AVegetationManager::Tick ( float  DeltaTime)
overrideprotectedvirtual

Definition at line 241 of file VegetationManager.cpp.

References IsValid().

+ Here is the call graph for this function:

◆ UpdateFoliageBlueprintCache()

void AVegetationManager::UpdateFoliageBlueprintCache ( ULevel *  InLevel)
private

Definition at line 412 of file VegetationManager.cpp.

References FFoliageBlueprint::BPFullClassName, FTileData::InstancedFoliageActor, IsValid(), FFoliageBlueprint::IsValid(), FFoliageBlueprint::SetBPClassName(), and FFoliageBlueprint::SetSpawnedClass().

+ Here is the call graph for this function:

◆ UpdateMaterials()

void AVegetationManager::UpdateMaterials ( FTileData Tile)
private

Definition at line 490 of file VegetationManager.cpp.

References Position, and FTileData::UpdateMaterialCache().

+ Here is the call graph for this function:

◆ UpdatePoolBasePosition()

void AVegetationManager::UpdatePoolBasePosition ( )

Definition at line 712 of file VegetationManager.cpp.

Member Data Documentation

◆ ActiveActorDistance

float AVegetationManager::ActiveActorDistance {500.0f}

Definition at line 108 of file VegetationManager.h.

◆ ActorPool

TMap<FString, TArray<FPooledActor> > AVegetationManager::ActorPool {}
private

Definition at line 182 of file VegetationManager.h.

◆ DebugMaterials

bool AVegetationManager::DebugMaterials {false}

Definition at line 102 of file VegetationManager.h.

◆ FoliageBlueprintCache

TMap<FString, FFoliageBlueprint> AVegetationManager::FoliageBlueprintCache {}
private

Definition at line 179 of file VegetationManager.h.

◆ HeroVehicle

ACarlaWheeledVehicle* AVegetationManager::HeroVehicle {nullptr}
private

Definition at line 177 of file VegetationManager.h.

◆ HideMaterialDistance

float AVegetationManager::HideMaterialDistance {500.0f}

Definition at line 105 of file VegetationManager.h.

◆ InactivePoolTransform

FTransform AVegetationManager::InactivePoolTransform { FQuat(1.0f, 1.0f, 1.0f, 1.0f), FVector(1.0f, 1.0f, 1.0f), FVector(1.0f, 1.0f, 1.0f)}
private

Definition at line 174 of file VegetationManager.h.

◆ InitialPoolSize

int32 AVegetationManager::InitialPoolSize {10}

Definition at line 127 of file VegetationManager.h.

◆ LargeMap

ALargeMapManager* AVegetationManager::LargeMap {nullptr}
private

Definition at line 176 of file VegetationManager.h.

◆ PoolTranslationTimer

float AVegetationManager::PoolTranslationTimer {30.0f}
private

Definition at line 173 of file VegetationManager.h.

◆ SpawnBushes

bool AVegetationManager::SpawnBushes {true}

Definition at line 112 of file VegetationManager.h.

◆ SpawnPlants

bool AVegetationManager::SpawnPlants {true}

Definition at line 121 of file VegetationManager.h.

◆ SpawnRocks

bool AVegetationManager::SpawnRocks {true}

Definition at line 118 of file VegetationManager.h.

◆ SpawnScale

float AVegetationManager::SpawnScale {1.0f}

Definition at line 124 of file VegetationManager.h.

◆ SpawnTrees

bool AVegetationManager::SpawnTrees {true}

Definition at line 115 of file VegetationManager.h.

◆ TileCache

TMap<FString, FTileData> AVegetationManager::TileCache {}
private

Definition at line 180 of file VegetationManager.h.

◆ UpdatePoolInactiveTransformTimer

FTimerHandle AVegetationManager::UpdatePoolInactiveTransformTimer
private

Definition at line 184 of file VegetationManager.h.


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