Add movable static meshes to the actor registry
This commit is contained in:
parent
db2f56a733
commit
a0c2c21581
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue