Add movable static meshes to the actor registry

This commit is contained in:
nsubiron 2019-02-11 17:33:39 +01:00
parent db2f56a733
commit a0c2c21581
2 changed files with 17 additions and 0 deletions

View File

@ -1,6 +1,7 @@
## Latest Changes
* Fixed `manual_control.py` and `no_rendering_mode.py` to prevent crashes when used in "no rendering mode"
* Added movable props present in the map (e.g. chairs and tables) as actors so they can be controlled from Python
* Refactored `no_rendering_mode.py` to improve performance and interface
## CARLA 0.9.3

View File

@ -12,6 +12,7 @@
#include "Carla/Vehicle/VehicleSpawnPoint.h"
#include "EngineUtils.h"
#include "Engine/StaticMeshActor.h"
#include "GameFramework/SpectatorPawn.h"
static FString UCarlaEpisode_GetTrafficSignId(ETrafficSignState State)
@ -108,4 +109,19 @@ void UCarlaEpisode::InitializeAtBeginPlay()
Description.Class = Actor->GetClass();
ActorDispatcher->RegisterActor(*Actor, Description);
}
for (TActorIterator<AStaticMeshActor> It(World); It; ++It)
{
auto Actor = *It;
check(Actor != nullptr);
auto MeshComponent = Actor->GetStaticMeshComponent();
check(MeshComponent != nullptr);
if (MeshComponent->Mobility == EComponentMobility::Movable)
{
FActorDescription Description;
Description.Id = TEXT("static.prop");
Description.Class = Actor->GetClass();
ActorDispatcher->RegisterActor(*Actor, Description);
}
}
}