Added generation to vehicles and pedestrians

This commit is contained in:
Daniel Santos-Olivan 2021-07-28 17:43:18 +02:00 committed by bernat
parent 2d59fd5788
commit 63227ba665
3 changed files with 17 additions and 0 deletions

View File

@ -1044,6 +1044,12 @@ void UActorBlueprintFunctionLibrary::MakeVehicleDefinition(
EActorAttributeType::Int,
FString::FromInt(Parameters.NumberOfWheels)});
Success = CheckActorDefinition(Definition);
Definition.Attributes.Emplace(FActorAttribute{
TEXT("generation"),
EActorAttributeType::Int,
FString::FromInt(Parameters.Generation)});
Success = CheckActorDefinition(Definition);
}
template <typename T, typename Functor>
@ -1105,6 +1111,11 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
EActorAttributeType::String,
GetGender(Parameters.Gender)});
Definition.Attributes.Emplace(FActorAttribute{
TEXT("generation"),
EActorAttributeType::Int,
FString::FromInt(Parameters.Generation)});
Definition.Attributes.Emplace(FActorAttribute{
TEXT("age"),
EActorAttributeType::String,

View File

@ -52,4 +52,7 @@ struct CARLA_API FPedestrianParameters
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<float> Speed;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Generation = 0;
};

View File

@ -27,6 +27,9 @@ struct CARLA_API FVehicleParameters
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 NumberOfWheels = 4;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Generation = 0;
/// (OPTIONAL) Use for custom classification of vehicles.
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString ObjectType;