Add supported drivers option to vehicle parameters
This commit is contained in:
parent
4f27ff0067
commit
83769d9914
|
@ -416,6 +416,7 @@ void UActorBlueprintFunctionLibrary::MakeVehicleDefinition(
|
|||
AddRecommendedValuesForActorRoleName(Definition,
|
||||
{TEXT("autopilot"), TEXT("scenario"), TEXT("ego_vehicle")});
|
||||
Definition.Class = Parameters.Class;
|
||||
|
||||
if (Parameters.RecommendedColors.Num() > 0)
|
||||
{
|
||||
FActorVariation Colors;
|
||||
|
@ -429,6 +430,19 @@ void UActorBlueprintFunctionLibrary::MakeVehicleDefinition(
|
|||
Definition.Variations.Emplace(Colors);
|
||||
}
|
||||
|
||||
if (Parameters.SupportedDrivers.Num() > 0)
|
||||
{
|
||||
FActorVariation Drivers;
|
||||
Drivers.Id = TEXT("driver_id");
|
||||
Drivers.Type = EActorAttributeType::Int;
|
||||
Drivers.bRestrictToRecommended = true;
|
||||
for (auto &Id : Parameters.SupportedDrivers)
|
||||
{
|
||||
Drivers.RecommendedValues.Emplace(FString::FromInt(Id));
|
||||
}
|
||||
Definition.Variations.Emplace(Drivers);
|
||||
}
|
||||
|
||||
FActorVariation StickyControl;
|
||||
StickyControl.Id = TEXT("sticky_control");
|
||||
StickyControl.Type = EActorAttributeType::Bool;
|
||||
|
|
|
@ -33,4 +33,9 @@ struct CARLA_API FVehicleParameters
|
|||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TArray<FColor> RecommendedColors;
|
||||
|
||||
/// List of IDs of the drivers (pedestrians) supported by this vehicle, leave
|
||||
/// empty if no driver is supported.
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TArray<int32> SupportedDrivers;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue