Exposed 'is_invincible' for pedestrians (#1454)

This commit is contained in:
Daniel Novillo 2019-05-08 13:45:02 +02:00 committed by Néstor Subirón
parent 661bc87a0c
commit 1f8e405425
3 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,7 @@
* Updated OpenDriveActor to use the new Waypoint API
* Fixed wrong units in VehiclePhysicsControl's center of mass
* Several optimizations to the RPC server, now supports a bigger load of async messages
* Exposed 'is_invincible' for pedestrians
## CARLA 0.9.5
@ -75,6 +76,7 @@
* Fixed obstacle detector not working
* Fixed small float bug in misc.py
## CARLA 0.9.4
* Added recording and playback functionality

View File

@ -171,6 +171,8 @@ class World(object):
if blueprint.has_attribute('color'):
color = random.choice(blueprint.get_attribute('color').recommended_values)
blueprint.set_attribute('color', color)
if blueprint.has_attribute('is_invincible'):
blueprint.set_attribute('is_invincible', 'true')
# Spawn the player.
if self.player is not None:
spawn_point = self.player.get_transform()

View File

@ -438,6 +438,15 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
EActorAttributeType::String,
GetGender(Parameters.Gender)});
FActorVariation IsInvincible;
IsInvincible.Id = TEXT("is_invincible");
IsInvincible.Type = EActorAttributeType::Bool;
IsInvincible.RecommendedValues = { TEXT("true") };
IsInvincible.bRestrictToRecommended = false;
Definition.Variations.Emplace(IsInvincible);
Success = CheckActorDefinition(Definition);
}