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