CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Actor
StaticMeshFactory.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "
Carla/Actor/ActorSpawnResult.h
"
10
#include "
Carla/Actor/CarlaActorFactory.h
"
11
12
#include "StaticMeshFactory.generated.h"
13
14
/// Factory in charge of spawning static meshes. This factory is able to spawn
15
/// any mesh in content.
16
UCLASS()
17
class CARLA_API
AStaticMeshFactory
: public
ACarlaActorFactory
18
{
19
GENERATED_BODY()
20
21
/// Retrieve the definitions of the static mesh actor
22
TArray<FActorDefinition>
GetDefinitions
()
final
;
23
24
virtual
void
ReleaseContentPack
(
const
FString &MountPoint)
override
;
25
26
FActorSpawnResult
SpawnActor
(
27
const
FTransform &SpawnAtTransform,
28
const
FActorDescription
&ActorDescription)
final
;
29
30
private
:
31
/// Lazy, memoizing mesh cache keyed by mesh path. This factory takes an
32
/// arbitrary mesh path at spawn time (there is no catalog to pre-populate
33
/// from), so the cache fills on first spawn of a given path and spares
34
/// subsequent spawns of the same path the synchronous LoadObject hit.
35
UPROPERTY(Transient, DuplicateTransient)
36
TMap<FString, TObjectPtr<UStaticMesh>>
MeshCacheByPath
;
37
};
ActorSpawnResult.h
CarlaActorFactory.h
ACarlaActorFactory::ACarlaActorFactory
ACarlaActorFactory(const FObjectInitializer &ObjectInitializer)
Definition
CarlaActorFactory.h:28
AStaticMeshFactory
Factory in charge of spawning static meshes.
Definition
StaticMeshFactory.h:18
AStaticMeshFactory::ReleaseContentPack
virtual void ReleaseContentPack(const FString &MountPoint) override
Drop every cached definition, parameter and loaded asset that refers to content under MountPoint ("/<...
Definition
StaticMeshFactory.cpp:38
AStaticMeshFactory::GetDefinitions
TArray< FActorDefinition > GetDefinitions() final
Retrieve the definitions of the static mesh actor.
Definition
StaticMeshFactory.cpp:15
AStaticMeshFactory::MeshCacheByPath
TMap< FString, TObjectPtr< UStaticMesh > > MeshCacheByPath
Lazy, memoizing mesh cache keyed by mesh path.
Definition
StaticMeshFactory.h:36
AStaticMeshFactory::SpawnActor
FActorSpawnResult SpawnActor(const FTransform &SpawnAtTransform, const FActorDescription &ActorDescription) final
Spawn an actor based on ActorDescription and Transform.
Definition
StaticMeshFactory.cpp:49
FActorDescription
A description of a Carla Actor with all its variation.
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Actor/ActorDescription.h:21
FActorSpawnResult
Result of an actor spawn function.
Definition
ActorSpawnResult.h:26
Generated by
1.18.0