CARLA
Loading...
Searching...
No Matches
CarlaActorFactoryBlueprint.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
11
12#include <util/ue-header-guard-begin.h>
13#include "GameFramework/Actor.h"
14#include <util/ue-header-guard-end.h>
15
16#include "CarlaActorFactoryBlueprint.generated.h"
17
18/// Base class for Blueprints implementing ACarlaActorFactory interface.
19///
20/// Blueprints deriving from this class are expected to override
21/// GetDefinitions and SpawnActor functions.
22UCLASS(Abstract, BlueprintType, Blueprintable)
24{
25 GENERATED_BODY()
26
27public:
28
29 TArray<FActorDefinition> GetDefinitions() final
30 {
31 return GenerateDefinitions();
32 }
33
35 const FTransform &SpawnAtTransform,
36 const FActorDescription &ActorDescription) final
37 {
38 FActorSpawnResult Result;
39 SpawnActor(SpawnAtTransform, ActorDescription, Result);
40 return Result;
41 }
42
43protected:
44
45 UFUNCTION(BlueprintImplementableEvent)
46 TArray<FActorDefinition> GenerateDefinitions();
47
48 UFUNCTION(BlueprintImplementableEvent)
49 void SpawnActor(
50 const FTransform &SpawnAtTransform,
51 const FActorDescription &ActorDescription,
52 FActorSpawnResult &SpawnResult);
53};
Base class for Blueprints implementing ACarlaActorFactory interface.
FActorSpawnResult SpawnActor(const FTransform &SpawnAtTransform, const FActorDescription &ActorDescription) final
Spawn an actor based on ActorDescription and Transform.
TArray< FActorDefinition > GetDefinitions() final
Retrieve the list of actor definitions that this class is able to spawn.
Base class for Carla actor factories.
A definition of a Carla Actor with all the variation and attributes.
A description of a Carla Actor with all its variation.
Result of an actor spawn function.