24 TriggerDefinition.
Class = AFrictionTrigger::StaticClass();
26 TArray<FActorDefinition> TriggerDefinitions;
31 TriggerDefinitions.Add(TriggerDefinition);
33 return TriggerDefinitions;
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);
The game instance contains elements that must be kept alive in between levels.
static float RetrieveActorAttributeToFloat(const FString &Id, const TMap< FString, FActorAttribute > &Attributes, float Default)
A definition of a Carla Actor with all the variation and attributes.
TArray< FActorDefinition > GetDefinitions() final
Retrieve the definitions of all the sensors registered in the SensorRegistry.
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
static UCarlaGameInstance * GetGameInstance(const UObject *WorldContextObject)
static void MakeTriggerDefinition(const FString &Id, bool &Success, FActorDefinition &Definition)
TSubclassOf< AActor > Class
Class of the actor to be spawned.
A description of a Carla Actor with all its variation.
FActorSpawnResult SpawnActor(const FTransform &SpawnAtTransform, const FActorDescription &ActorDescription) final
Spawn an actor based on ActorDescription and Transform.
TSubclassOf< AActor > Class
Class of the actor to be spawned (Optional).
Result of an actor spawn function.
geom::Transform Transform
UCarlaEpisode * GetCarlaEpisode()