15 #include "Engine/CollisionProfile.h" 18 : Super(ObjectInitializer)
20 auto *Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"CamMesh"));
21 Mesh->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
22 Mesh->bHiddenInGame =
true;
23 Mesh->CastShadow =
false;
41 if (Description.
Variations.Contains(
"sensor_tick"))
62 Super::Tick(DeltaTime);
96 Super::PostActorCreated();
99 auto *StaticMeshComponent = Cast<UStaticMeshComponent>(RootComponent);
100 if (StaticMeshComponent && !IsRunningCommandlet() && !StaticMeshComponent->GetStaticMesh())
102 UStaticMesh *CamMesh = LoadObject<UStaticMesh>(
104 TEXT(
"/Engine/EditorMeshes/MatineeCam_SM.MatineeCam_SM"),
108 StaticMeshComponent->SetStaticMesh(CamMesh);
110 #endif // WITH_EDITOR 115 Super::EndPlay(EndPlayReason);
119 auto &StreamingServer = GameInstance->GetServer().GetStreamingServer();
121 StreamingServer.CloseStream(StreamId);
boost::optional< FActorAttribute > GetAttribute(const FString Name)
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
FSensorManager & GetSensorManager()
void DeRegisterSensor(ASensor *Sensor)
int32 Seed
Seed of the pseudo-random engine.
static float ActorAttributeToFloat(const FActorAttribute &ActorAttribute, float Default)
void SetSeed(int32 InSeed)
bool AreClientsListening()
const UCarlaEpisode * Episode
bool ReadyToTick
Allows the sensor to tick with the tick rate from UE4.
const UCarlaEpisode & GetEpisode() const
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
static UCarlaGameInstance * GetGameInstance(const UObject *WorldContextObject)
virtual void OnFirstClientConnected()
void EndPlay(EEndPlayReason::Type EndPlayReason) override
void Seed(int32 InSeed)
Seed the random engine.
auto GetToken() const
Return the token that allows subscribing to this stream.
virtual void OnLastClientDisconnected()
A description of a Carla Actor with all its variation.
void RegisterSensor(ASensor *Sensor)
static UCarlaEpisode * GetCurrentEpisode(const UObject *WorldContextObject)
FActorDescription SensorDescription
void Tick(const float DeltaTime) final
ASensor(const FObjectInitializer &ObjectInitializer)
void PostActorCreated() override
virtual void PrePhysTick(float DeltaSeconds)
void PostPhysTickInternal(UWorld *World, ELevelTick TickType, float DeltaSeconds)
carla::streaming::detail::token_type token_type
virtual void Set(const FActorDescription &Description)
URandomEngine * RandomEngine
Random Engine used to provide noise for sensor output.