CARLA
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
AVegetationManager Class Reference

#include <VegetationManager.h>

+ Inheritance 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)}
 
ALargeMapManager * LargeMap {nullptr}
 
ACarlaWheeledVehicle * HeroVehicle {nullptr}
 
TMap< FString, FFoliageBlueprint > FoliageBlueprintCache {}
 
TMap< FString, FTileData > TileCache {}
 
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< FElementsToSpawn > GetElementsToSpawn (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)
 
AActor * CreateFoliage (const FFoliageBlueprint &BP, const FTransform &Transform) const
 
void GetSketalTemplates ()
 

Detailed Description

Definition at line 95 of file VegetationManager.h.

Member Function Documentation

◆ ActivePooledActors()

void AVegetationManager::ActivePooledActors ( )
private

Definition at line 595 of file VegetationManager.cpp.

References ActiveActorDistance, ActivePooledActors(), ActorPool, and HeroVehicle.

Referenced by ActivePooledActors(), and Tick().

◆ AddVehicle()

void AVegetationManager::AddVehicle ( ACarlaWheeledVehicle *  Vehicle)

◆ BeginPlay()

void AVegetationManager::BeginPlay ( )
overrideprotectedvirtual

◆ CheckForNewTiles()

bool AVegetationManager::CheckForNewTiles ( ) const
private

Definition at line 768 of file VegetationManager.cpp.

References CheckForNewTiles(), IsValid(), and TileCache.

Referenced by CheckForNewTiles().

◆ CreateFoliage()

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

◆ CreateOrUpdateTileCache()

void AVegetationManager::CreateOrUpdateTileCache ( ULevel *  InLevel)
private

◆ CreatePoolForBPClass()

void AVegetationManager::CreatePoolForBPClass ( const FFoliageBlueprint &  BP)
private

◆ DestroySkeletalFoliages()

void AVegetationManager::DestroySkeletalFoliages ( )
private

◆ EnableActorFromPool()

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

Definition at line 645 of file VegetationManager.cpp.

References EnableActorFromPool(), and SpawnScale.

Referenced by EnableActorFromPool(), and SpawnSkeletalFoliages().

◆ FreeTileCache()

void AVegetationManager::FreeTileCache ( ULevel *  InLevel)
private

◆ GetElementsToSpawn()

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

◆ GetSketalTemplates()

void AVegetationManager::GetSketalTemplates ( )
private

◆ GetTilesInUse()

TArray< FString > AVegetationManager::GetTilesInUse ( )
private

◆ IsFoliageTypeEnabled()

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

◆ OnLevelAddedToWorld()

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

◆ OnLevelRemovedFromWorld()

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

Definition at line 734 of file VegetationManager.cpp.

References FreeTileCache(), and OnLevelRemovedFromWorld().

Referenced by BeginPlay(), and OnLevelRemovedFromWorld().

◆ PostWorldOriginOffset()

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

◆ RemoveVehicle()

void AVegetationManager::RemoveVehicle ( ACarlaWheeledVehicle *  Vehicle)

◆ SetInstancedStaticMeshComponentCache()

void AVegetationManager::SetInstancedStaticMeshComponentCache ( FTileData &  TileData)
private

◆ SetMaterialCache()

void AVegetationManager::SetMaterialCache ( FTileData &  TileData)
private

◆ SetTileDataInternals()

void AVegetationManager::SetTileDataInternals ( FTileData &  TileData)
private

◆ SpawnSkeletalFoliages()

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

◆ Tick()

void AVegetationManager::Tick ( float  DeltaTime)
overrideprotectedvirtual

◆ UpdateFoliageBlueprintCache()

void AVegetationManager::UpdateFoliageBlueprintCache ( ULevel *  InLevel)
private

◆ UpdateMaterials()

void AVegetationManager::UpdateMaterials ( FTileData *  Tile)
private

◆ UpdatePoolBasePosition()

void AVegetationManager::UpdatePoolBasePosition ( )

Member Data Documentation

◆ ActiveActorDistance

float AVegetationManager::ActiveActorDistance {500.0f}

Definition at line 114 of file VegetationManager.h.

Referenced by ActivePooledActors().

◆ ActorPool

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

◆ DebugMaterials

bool AVegetationManager::DebugMaterials {false}

Definition at line 108 of file VegetationManager.h.

Referenced by UpdateMaterials().

◆ FoliageBlueprintCache

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

◆ HeroVehicle

ACarlaWheeledVehicle* AVegetationManager::HeroVehicle {nullptr}
private

◆ HideMaterialDistance

float AVegetationManager::HideMaterialDistance {500.0f}

Definition at line 111 of file VegetationManager.h.

Referenced by SetMaterialCache().

◆ 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 180 of file VegetationManager.h.

Referenced by PostWorldOriginOffset(), and UpdatePoolBasePosition().

◆ InitialPoolSize

int32 AVegetationManager::InitialPoolSize {10}

Definition at line 133 of file VegetationManager.h.

Referenced by CreatePoolForBPClass().

◆ LargeMap

ALargeMapManager* AVegetationManager::LargeMap {nullptr}
private

Definition at line 182 of file VegetationManager.h.

Referenced by BeginPlay(), and Tick().

◆ PoolTranslationTimer

float AVegetationManager::PoolTranslationTimer {30.0f}
private

Definition at line 179 of file VegetationManager.h.

◆ SpawnBushes

bool AVegetationManager::SpawnBushes {true}

Definition at line 118 of file VegetationManager.h.

Referenced by IsFoliageTypeEnabled().

◆ SpawnPlants

bool AVegetationManager::SpawnPlants {true}

Definition at line 127 of file VegetationManager.h.

Referenced by IsFoliageTypeEnabled().

◆ SpawnRocks

bool AVegetationManager::SpawnRocks {true}

Definition at line 124 of file VegetationManager.h.

Referenced by IsFoliageTypeEnabled().

◆ SpawnScale

float AVegetationManager::SpawnScale {1.0f}

Definition at line 130 of file VegetationManager.h.

Referenced by CreateFoliage(), and EnableActorFromPool().

◆ SpawnTrees

bool AVegetationManager::SpawnTrees {true}

Definition at line 121 of file VegetationManager.h.

Referenced by IsFoliageTypeEnabled().

◆ TileCache

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

◆ UpdatePoolInactiveTransformTimer

FTimerHandle AVegetationManager::UpdatePoolInactiveTransformTimer
private

Definition at line 190 of file VegetationManager.h.


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