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

Factory in charge of spawning static meshes. More...

#include <StaticMeshFactory.h>

+ Inheritance diagram for AStaticMeshFactory:

Private Member Functions

TArray< FActorDefinition > GetDefinitions () final
 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.
 
FActorSpawnResult SpawnActor (const FTransform &SpawnAtTransform, const FActorDescription &ActorDescription) final
 Spawn an actor based on ActorDescription and Transform.
 

Private Attributes

TMap< FString, TObjectPtr< UStaticMesh > > MeshCacheByPath
 Lazy, memoizing mesh cache keyed by mesh path.
 

Additional Inherited Members

- Public Member Functions inherited from ACarlaActorFactory
 ACarlaActorFactory (const FObjectInitializer &ObjectInitializer)
 
- 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.
 

Detailed Description

Factory in charge of spawning static meshes.

This factory is able to spawn any mesh in content.

Definition at line 17 of file StaticMeshFactory.h.

Member Function Documentation

◆ GetDefinitions()

TArray< FActorDefinition > AStaticMeshFactory::GetDefinitions ( )
finalprivatevirtual

Retrieve the definitions of the static mesh actor.

Reimplemented from ACarlaActorFactory.

Definition at line 15 of file StaticMeshFactory.cpp.

References Float, and String.

◆ ReleaseContentPack()

void AStaticMeshFactory::ReleaseContentPack ( const FString &  MountPoint)
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 38 of file StaticMeshFactory.cpp.

References MeshCacheByPath.

◆ SpawnActor()

FActorSpawnResult AStaticMeshFactory::SpawnActor ( const FTransform &  SpawnAtTransform,
const FActorDescription &  ActorDescription 
)
finalprivatevirtual

Spawn an actor based on ActorDescription and Transform.

Precondition
ActorDescription is expected to be derived from one of the definitions retrieved with GetDefinitions.

Reimplemented from ACarlaActorFactory.

Definition at line 49 of file StaticMeshFactory.cpp.

References FActorDescription::Class, FActorDescription::Id, MeshCacheByPath, FActorSpawnResult::Status, and FActorDescription::Variations.

Member Data Documentation

◆ MeshCacheByPath

TMap<FString, TObjectPtr<UStaticMesh> > AStaticMeshFactory::MeshCacheByPath
private

Lazy, memoizing mesh cache keyed by mesh path.

This factory takes an arbitrary mesh path at spawn time (there is no catalog to pre-populate from), so the cache fills on first spawn of a given path and spares subsequent spawns of the same path the synchronous LoadObject hit.

Definition at line 36 of file StaticMeshFactory.h.

Referenced by ReleaseContentPack(), and SpawnActor().


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