|
CARLA
|
#include <PropActorFactory.h>
Inheritance diagram for APropActorFactory:Public Member Functions | |
| bool | PostProcessProp (AActor *SpawnedActor, const FActorDescription &PropParams) |
Public Member Functions inherited from ACarlaActorFactory | |
| ACarlaActorFactory (const FObjectInitializer &ObjectInitializer) | |
Static Public Member Functions | |
| static void | LoadPropParametersArrayFromFile (const FString &FileName, TArray< FPropParameters > &OutPropParamsArray) |
| static void | SavePropParametersArrayToFile (const TArray< FPropParameters > &PropParamsArray, const FString &FileName) |
Static Public Member Functions inherited from ACarlaActorFactory | |
| static bool | DefinitionReferencesPath (const FActorDefinition &Definition, const FString &MountPoint) |
| True when the definition's class or any attribute/variation value points at content under MountPoint. | |
Protected Attributes | |
| TArray< FActorDefinition > | Definitions |
| TArray< FPropParameters > | PropsParams |
Private Member Functions | |
| virtual TArray< FActorDefinition > | GetDefinitions () override |
| Retrieve the definitions of the static mesh actor. | |
| virtual void | ReleaseContentPack (const FString &MountPoint) override |
| Drop every cached definition, parameter and loaded asset that refers to content under MountPoint ("/<Pack>/"), so a content pack can be unmounted; the dropped blueprints are gone until the next episode. | |
| virtual FActorSpawnResult | SpawnActor (const FTransform &SpawnAtTransform, const FActorDescription &ActorDescription) override |
| Spawn an actor based on ActorDescription and Transform. | |
Static Private Member Functions | |
| static FString | FPropParametersArrayToJson (const TArray< FPropParameters > &PropParamsArray) |
| static TSharedPtr< FJsonObject > | FPropParametersToJsonObject (const FPropParameters &PropParams) |
| static bool | JsonToFPropParameters (const TSharedPtr< FJsonObject > JsonObject, FPropParameters &OutPropParams) |
| static bool | JsonToFPropParametersArray (const FString &JsonString, TArray< FPropParameters > &OutPropParamsArray) |
Private Attributes | |
| TMap< FString, TObjectPtr< UStaticMesh > > | MeshCacheByPath |
| Mesh cache keyed by mesh path (same string stored in ActorDescription.Variations["mesh_path"]). | |
Definition at line 21 of file PropActorFactory.h.
|
staticprivate |
Definition at line 220 of file PropActorFactory.cpp.
References FPropParametersToJsonObject().
Referenced by SavePropParametersArrayToFile().
|
staticprivate |
Definition at line 184 of file PropActorFactory.cpp.
References FPropParameters::BaseType, FPropParameters::Mesh, FPropParameters::Name, FPropParameters::Size, and FPropParameters::SubType.
Referenced by FPropParametersArrayToJson().
|
overrideprivatevirtual |
Retrieve the definitions of the static mesh actor.
Reimplemented from ACarlaActorFactory.
Definition at line 24 of file PropActorFactory.cpp.
References Definitions, UCarlaBlueprintRegistry::FindContentPackPropFiles(), UCarlaContentPackManager::FindPackCatalogFiles(), UCarlaBlueprintRegistry::LoadPropDefinitionsFromFiles(), LoadPropParametersArrayFromFile(), UActorBlueprintFunctionLibrary::MakePropDefinitions(), UCarlaContentPackManager::MergeCatalog(), MeshCacheByPath, FPropParameters::Name, and PropsParams.
|
staticprivate |
Definition at line 260 of file PropActorFactory.cpp.
References FPropParameters::BaseType, FPropParameters::Mesh, FPropParameters::Name, FPropParameters::Size, and FPropParameters::SubType.
Referenced by JsonToFPropParametersArray().
|
staticprivate |
Definition at line 308 of file PropActorFactory.cpp.
References JsonToFPropParameters().
Referenced by LoadPropParametersArrayFromFile().
|
static |
Definition at line 341 of file PropActorFactory.cpp.
References JsonToFPropParametersArray().
Referenced by GetDefinitions().
| bool APropActorFactory::PostProcessProp | ( | AActor * | SpawnedActor, |
| const FActorDescription & | PropParams | ||
| ) |
Referenced by SpawnActor().
|
overrideprivatevirtual |
Drop every cached definition, parameter and loaded asset that refers to content under MountPoint ("/<Pack>/"), so a content pack can be unmounted; the dropped blueprints are gone until the next episode.
Reimplemented from ACarlaActorFactory.
Definition at line 169 of file PropActorFactory.cpp.
References ACarlaActorFactory::DefinitionReferencesPath(), Definitions, FPropParameters::Mesh, MeshCacheByPath, and PropsParams.
|
static |
Definition at line 243 of file PropActorFactory.cpp.
References FPropParametersArrayToJson().
|
overrideprivatevirtual |
Spawn an actor based on ActorDescription and Transform.
Reimplemented from ACarlaActorFactory.
Definition at line 68 of file PropActorFactory.cpp.
References FActorSpawnResult::Actor, UActorBlueprintFunctionLibrary::ActorAttributeToString(), FActorDescription::Class, FActorDescription::Id, IsValid(), MeshCacheByPath, PostProcessProp(), FActorSpawnResult::Status, and FActorDescription::Variations.
|
protected |
Definition at line 53 of file PropActorFactory.h.
Referenced by GetDefinitions(), and ReleaseContentPack().
|
private |
Mesh cache keyed by mesh path (same string stored in ActorDescription.Variations["mesh_path"]).
Populated from PropsParams in GetDefinitions() so that SpawnActor() avoids the per-spawn synchronous LoadObject on the game thread. Cache-miss fall back to LoadObject with a warning log.
Definition at line 64 of file PropActorFactory.h.
Referenced by GetDefinitions(), ReleaseContentPack(), and SpawnActor().
|
protected |
Definition at line 55 of file PropActorFactory.h.
Referenced by GetDefinitions(), and ReleaseContentPack().