|
CARLA
|
#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 () |
Definition at line 95 of file VegetationManager.h.
|
private |
Definition at line 595 of file VegetationManager.cpp.
References ActiveActorDistance, ActivePooledActors(), ActorPool, and HeroVehicle.
Referenced by ActivePooledActors(), and Tick().
| void AVegetationManager::AddVehicle | ( | ACarlaWheeledVehicle * | Vehicle | ) |
Definition at line 283 of file VegetationManager.cpp.
References AddVehicle(), HeroVehicle, IsValid(), and Vehicle.
Referenced by ACarlaWheeledVehicle::AddReferenceToManager(), and AddVehicle().
|
overrideprotectedvirtual |
Definition at line 235 of file VegetationManager.cpp.
References BeginPlay(), UCarlaStatics::GetLargeMapManager(), LargeMap, OnLevelAddedToWorld(), OnLevelRemovedFromWorld(), and PostWorldOriginOffset().
Referenced by BeginPlay().
|
private |
Definition at line 768 of file VegetationManager.cpp.
References CheckForNewTiles(), IsValid(), and TileCache.
Referenced by CheckForNewTiles().
|
private |
Definition at line 695 of file VegetationManager.cpp.
References CreateFoliage(), FFoliageBlueprint::SpawnedClass, and SpawnScale.
Referenced by CreateFoliage(), CreatePoolForBPClass(), and SpawnSkeletalFoliages().
|
private |
Definition at line 304 of file VegetationManager.cpp.
References CreateOrUpdateTileCache(), FTileData::InstancedFoliageActor, IsValid(), FTileData::MaterialInstanceDynamicCache, FTileData::ProceduralFoliageVolume, SetTileDataInternals(), TileCache, and FTileData::TileMeshesCache.
Referenced by CreateOrUpdateTileCache(), and OnLevelAddedToWorld().
|
private |
Definition at line 670 of file VegetationManager.cpp.
References FPooledActor::Actor, ActorPool, FFoliageBlueprint::BPFullClassName, CreateFoliage(), CreatePoolForBPClass(), FPooledActor::DisableActor(), InitialPoolSize, and IsValid().
Referenced by CreatePoolForBPClass(), and UpdateFoliageBlueprintCache().
|
private |
Definition at line 621 of file VegetationManager.cpp.
References ActorPool, DestroySkeletalFoliages(), ACarlaWheeledVehicle::GetDetectionSize(), and HeroVehicle.
Referenced by DestroySkeletalFoliages(), and Tick().
|
private |
Definition at line 645 of file VegetationManager.cpp.
References EnableActorFromPool(), and SpawnScale.
Referenced by EnableActorFromPool(), and SpawnSkeletalFoliages().
|
private |
Definition at line 454 of file VegetationManager.cpp.
References FTileData::InstancedFoliageActor, IsValid(), FTileData::MaterialInstanceDynamicCache, FTileData::ProceduralFoliageVolume, TileCache, and FTileData::TileMeshesCache.
Referenced by OnLevelRemovedFromWorld().
|
private |
Definition at line 502 of file VegetationManager.cpp.
References FoliageBlueprintCache, GetElementsToSpawn(), ACarlaWheeledVehicle::GetFoliageInstancesCloseToVehicle(), HeroVehicle, FTileMeshComponent::IndicesInUse, FTileMeshComponent::InstancedStaticMeshComponent, FElementsToSpawn::TileMeshComponent, and FTileData::TileMeshesCache.
Referenced by GetElementsToSpawn(), and Tick().
|
private |
|
private |
Definition at line 786 of file VegetationManager.cpp.
References GetTilesInUse(), HeroVehicle, FTileData::InstancedFoliageActor, IsValid(), FTileData::ProceduralFoliageVolume, and TileCache.
Referenced by GetTilesInUse(), and Tick().
|
private |
Definition at line 750 of file VegetationManager.cpp.
References IsFoliageTypeEnabled(), SpawnBushes, SpawnPlants, SpawnRocks, and SpawnTrees.
Referenced by IsFoliageTypeEnabled(), and UpdateFoliageBlueprintCache().
|
private |
Definition at line 727 of file VegetationManager.cpp.
References CreateOrUpdateTileCache(), OnLevelAddedToWorld(), and UpdateFoliageBlueprintCache().
Referenced by BeginPlay(), and OnLevelAddedToWorld().
|
private |
Definition at line 734 of file VegetationManager.cpp.
References FreeTileCache(), and OnLevelRemovedFromWorld().
Referenced by BeginPlay(), and OnLevelRemovedFromWorld().
|
private |
Definition at line 740 of file VegetationManager.cpp.
References InactivePoolTransform, PostWorldOriginOffset(), and UpdatePoolBasePosition().
Referenced by BeginPlay(), and PostWorldOriginOffset().
| void AVegetationManager::RemoveVehicle | ( | ACarlaWheeledVehicle * | Vehicle | ) |
Definition at line 292 of file VegetationManager.cpp.
References HeroVehicle, IsValid(), RemoveVehicle(), and Vehicle.
Referenced by ACarlaWheeledVehicle::RemoveReferenceToManager(), and RemoveVehicle().
|
private |
Definition at line 354 of file VegetationManager.cpp.
References FTileData::ContainsMesh(), FoliageBlueprintCache, FTileData::InstancedFoliageActor, IsValid(), SetInstancedStaticMeshComponentCache(), FTileData::TileMeshesCache, and FTileData::UpdateTileMeshComponent().
Referenced by SetInstancedStaticMeshComponentCache(), and SetTileDataInternals().
|
private |
Definition at line 383 of file VegetationManager.cpp.
References HideMaterialDistance, FTileMeshComponent::InstancedStaticMeshComponent, IsValid(), FTileData::MaterialInstanceDynamicCache, SetMaterialCache(), and FTileData::TileMeshesCache.
Referenced by SetMaterialCache(), and SetTileDataInternals().
|
private |
Definition at line 347 of file VegetationManager.cpp.
References SetInstancedStaticMeshComponentCache(), SetMaterialCache(), and SetTileDataInternals().
Referenced by CreateOrUpdateTileCache(), and SetTileDataInternals().
|
private |
Definition at line 547 of file VegetationManager.cpp.
References FPooledActor::Actor, ActorPool, CreateFoliage(), FPooledActor::EnableActor(), EnableActorFromPool(), ACarlaWheeledVehicle::GetDetectionSize(), HeroVehicle, IsValid(), and SpawnSkeletalFoliages().
Referenced by SpawnSkeletalFoliages(), and Tick().
|
overrideprotectedvirtual |
Definition at line 245 of file VegetationManager.cpp.
References ActivePooledActors(), DestroySkeletalFoliages(), GetElementsToSpawn(), ALargeMapManager::GetHeroVehicle(), GetTilesInUse(), HeroVehicle, IsValid(), LargeMap, SpawnSkeletalFoliages(), Tick(), TileCache, ACarlaWheeledVehicle::UpdateDetectionBox(), and UpdateMaterials().
Referenced by Tick().
|
private |
Definition at line 416 of file VegetationManager.cpp.
References FFoliageBlueprint::BPFullClassName, CreatePoolForBPClass(), FoliageBlueprintCache, IsFoliageTypeEnabled(), FFoliageBlueprint::IsValid(), IsValid(), FFoliageBlueprint::SetBPClassName(), FFoliageBlueprint::SetSpawnedClass(), and UpdateFoliageBlueprintCache().
Referenced by OnLevelAddedToWorld(), and UpdateFoliageBlueprintCache().
|
private |
Definition at line 494 of file VegetationManager.cpp.
References DebugMaterials, HeroVehicle, Position, FTileData::UpdateMaterialCache(), and UpdateMaterials().
Referenced by Tick(), and UpdateMaterials().
| void AVegetationManager::UpdatePoolBasePosition | ( | ) |
Definition at line 709 of file VegetationManager.cpp.
References ActorPool, InactivePoolTransform, and UpdatePoolBasePosition().
Referenced by PostWorldOriginOffset(), and UpdatePoolBasePosition().
| float AVegetationManager::ActiveActorDistance {500.0f} |
Definition at line 114 of file VegetationManager.h.
Referenced by ActivePooledActors().
|
private |
Definition at line 188 of file VegetationManager.h.
Referenced by ActivePooledActors(), CreatePoolForBPClass(), DestroySkeletalFoliages(), SpawnSkeletalFoliages(), and UpdatePoolBasePosition().
| bool AVegetationManager::DebugMaterials {false} |
Definition at line 108 of file VegetationManager.h.
Referenced by UpdateMaterials().
|
private |
Definition at line 185 of file VegetationManager.h.
Referenced by GetElementsToSpawn(), SetInstancedStaticMeshComponentCache(), and UpdateFoliageBlueprintCache().
|
private |
Definition at line 183 of file VegetationManager.h.
Referenced by ActivePooledActors(), AddVehicle(), DestroySkeletalFoliages(), GetElementsToSpawn(), GetTilesInUse(), RemoveVehicle(), SpawnSkeletalFoliages(), Tick(), and UpdateMaterials().
| float AVegetationManager::HideMaterialDistance {500.0f} |
Definition at line 111 of file VegetationManager.h.
Referenced by SetMaterialCache().
|
private |
Definition at line 180 of file VegetationManager.h.
Referenced by PostWorldOriginOffset(), and UpdatePoolBasePosition().
| int32 AVegetationManager::InitialPoolSize {10} |
Definition at line 133 of file VegetationManager.h.
Referenced by CreatePoolForBPClass().
|
private |
Definition at line 182 of file VegetationManager.h.
Referenced by BeginPlay(), and Tick().
|
private |
Definition at line 179 of file VegetationManager.h.
| bool AVegetationManager::SpawnBushes {true} |
Definition at line 118 of file VegetationManager.h.
Referenced by IsFoliageTypeEnabled().
| bool AVegetationManager::SpawnPlants {true} |
Definition at line 127 of file VegetationManager.h.
Referenced by IsFoliageTypeEnabled().
| bool AVegetationManager::SpawnRocks {true} |
Definition at line 124 of file VegetationManager.h.
Referenced by IsFoliageTypeEnabled().
| float AVegetationManager::SpawnScale {1.0f} |
Definition at line 130 of file VegetationManager.h.
Referenced by CreateFoliage(), and EnableActorFromPool().
| bool AVegetationManager::SpawnTrees {true} |
Definition at line 121 of file VegetationManager.h.
Referenced by IsFoliageTypeEnabled().
|
private |
Definition at line 186 of file VegetationManager.h.
Referenced by CheckForNewTiles(), CreateOrUpdateTileCache(), FreeTileCache(), GetTilesInUse(), and Tick().
|
private |
Definition at line 190 of file VegetationManager.h.