Merge branch 'dev' of https://github.com/carla-simulator/carla into dev
This commit is contained in:
commit
c83c045ada
|
@ -12,11 +12,11 @@ namespace carla {
|
|||
namespace rpc {
|
||||
|
||||
enum class ActorAttributeType : uint8_t {
|
||||
Bool,
|
||||
Int,
|
||||
Float,
|
||||
String,
|
||||
RGBColor,
|
||||
Bool = 1u,
|
||||
Int = 2u,
|
||||
Float = 3u,
|
||||
String = 4u,
|
||||
RGBColor = 5u,
|
||||
|
||||
SIZE,
|
||||
INVALID
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace client {
|
|||
|
||||
std::ostream &operator<<(std::ostream &out, const ActorAttribute &attr) {
|
||||
using Type = carla::rpc::ActorAttributeType;
|
||||
static_assert(static_cast<uint8_t>(Type::SIZE) == 5u, "Please update this function.");
|
||||
static_assert(static_cast<uint8_t>(Type::SIZE) == 6u, "Please update this function.");
|
||||
out << "ActorAttribute(id=" << attr.GetId();
|
||||
switch (attr.GetType()) {
|
||||
case Type::Bool:
|
||||
|
|
|
@ -1593,6 +1593,12 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
|
|||
EActorAttributeType::String,
|
||||
GetAge(Parameters.Age)});
|
||||
|
||||
|
||||
Definition.Attributes.Emplace(FActorAttribute{
|
||||
TEXT("can_use_wheel_chair"),
|
||||
EActorAttributeType::Bool,
|
||||
Parameters.bCanUseWheelChair ? TEXT("true") : TEXT("false") });
|
||||
|
||||
if (Parameters.Speed.Num() > 0)
|
||||
{
|
||||
FActorVariation Speed;
|
||||
|
@ -1606,6 +1612,8 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
|
|||
Definition.Variations.Emplace(Speed);
|
||||
}
|
||||
|
||||
bool bCanUseWheelChair = Parameters.bCanUseWheelChair;
|
||||
|
||||
FActorVariation IsInvincible;
|
||||
IsInvincible.Id = TEXT("is_invincible");
|
||||
IsInvincible.Type = EActorAttributeType::Bool;
|
||||
|
@ -1613,6 +1621,20 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
|
|||
IsInvincible.bRestrictToRecommended = false;
|
||||
Definition.Variations.Emplace(IsInvincible);
|
||||
|
||||
FActorVariation WheelChairVariation;
|
||||
WheelChairVariation.Id = TEXT("use_wheelchair");
|
||||
WheelChairVariation.Type = EActorAttributeType::Bool;
|
||||
if(bCanUseWheelChair)
|
||||
{
|
||||
WheelChairVariation.RecommendedValues = { TEXT("true"), TEXT("false") };
|
||||
}
|
||||
else
|
||||
{
|
||||
WheelChairVariation.RecommendedValues = { TEXT("false") };
|
||||
}
|
||||
WheelChairVariation.bRestrictToRecommended = true;
|
||||
Definition.Variations.Emplace(WheelChairVariation);
|
||||
|
||||
Success = CheckActorDefinition(Definition);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,4 +55,7 @@ struct CARLA_API FPedestrianParameters
|
|||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
int32 Generation = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bCanUseWheelChair = false;
|
||||
};
|
||||
|
|
|
@ -24,6 +24,9 @@ public:
|
|||
UPROPERTY(Category="Walker Base", BlueprintReadWrite, EditAnywhere)
|
||||
float AfterLifeSpan = 10.0f;
|
||||
|
||||
UPROPERTY(Category="Walker Base", BlueprintReadWrite, EditAnywhere)
|
||||
bool bUsesWheelChair = false;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void StartDeathLifeSpan()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue