23 TriggerDefinition.
Class = AFrictionTrigger::StaticClass();
25 TArray<FActorDefinition> TriggerDefinitions;
30 TriggerDefinitions.Add(TriggerDefinition);
32 return TriggerDefinitions;
36 const FTransform &Transform,
39 auto *World = GetWorld();
42 UE_LOG(LogCarla, Error, TEXT(
"ATriggerFactory: cannot spawn trigger into an empty world."));
47 if (GameInstance ==
nullptr)
49 UE_LOG(LogCarla, Error, TEXT(
"ATriggerFactory:: cannot spawn trigger, incompatible game instance."));
58 ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
60 if (Trigger ==
nullptr)
62 UE_LOG(LogCarla, Error, TEXT(
"ATriggerFactory:: spawn trigger failed."));
68 check(Episode !=
nullptr);
69 Trigger->SetEpisode(*Episode);
75 Trigger->SetFriction(Friction);
78 FVector Extent {100.0f, 100.0f, 100.0f};
90 Trigger->SetBoxExtent(Extent);
92 UGameplayStatics::FinishSpawningActor(Trigger, Transform);
TArray< FActorDefinition > GetDefinitions() final
Retrieve the definitions of all the sensors registered in the SensorRegistry.
FActorSpawnResult SpawnActor(const FTransform &SpawnAtTransform, const FActorDescription &ActorDescription) final
Spawn an actor based on ActorDescription and Transform.
static void MakeTriggerDefinition(const FString &Id, bool &Success, FActorDefinition &Definition)
static float RetrieveActorAttributeToFloat(const FString &Id, const TMap< FString, FActorAttribute > &Attributes, float Default)
The game instance contains elements that must be kept alive in between levels.
UCarlaEpisode * GetCarlaEpisode()
static UCarlaGameInstance * GetGameInstance(const UObject *WorldContextObject)
A definition of a Carla Actor with all the variation and attributes.
TSubclassOf< AActor > Class
Class of the actor to be spawned (Optional).
A description of a Carla Actor with all its variation.
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
TSubclassOf< AActor > Class
Class of the actor to be spawned.
Result of an actor spawn function.