24 TriggerDefinition.
Class = AFrictionTrigger::StaticClass();
26 TArray<FActorDefinition> TriggerDefinitions;
31 TriggerDefinitions.Add(TriggerDefinition);
33 return TriggerDefinitions;
37 const FTransform &Transform,
40 auto *World = GetWorld();
43 UE_LOG(LogCarla, Error, TEXT(
"ATriggerFactory: cannot spawn trigger into an empty world."));
48 if (GameInstance ==
nullptr)
50 UE_LOG(LogCarla, Error, TEXT(
"ATriggerFactory:: cannot spawn trigger, incompatible game instance."));
59 ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
61 if (Trigger ==
nullptr)
63 UE_LOG(LogCarla, Error, TEXT(
"ATriggerFactory:: spawn trigger failed."));
69 check(Episode !=
nullptr);
70 Trigger->SetEpisode(*Episode);
76 Trigger->SetFriction(Friction);
79 FVector Extent {100.0f, 100.0f, 100.0f};
91 Trigger->SetBoxExtent(Extent);
93 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.