16#include <util/ue-header-guard-begin.h>
17#include <Engine/CollisionProfile.h>
18#include <util/ue-header-guard-end.h>
21 : Super(ObjectInitializer)
23 auto *Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"CamMesh"));
24 Mesh->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
25 Mesh->bHiddenInGame =
true;
26 Mesh->CastShadow =
false;
38 SetActorTickInterval(0.0f);
51 if (Description.
Variations.Contains(
"sensor_tick"))
72 float SensorDeltaTime = DeltaTime;
81 Super::Tick(SensorDeltaTime);
113 Super::PostActorCreated();
116 auto *StaticMeshComponent = Cast<UStaticMeshComponent>(RootComponent);
117 if (StaticMeshComponent && !IsRunningCommandlet() && !StaticMeshComponent->GetStaticMesh())
119 UStaticMesh *CamMesh = LoadObject<UStaticMesh>(
121 TEXT(
"/Engine/EditorMeshes/MatineeCam_SM.MatineeCam_SM"),
125 StaticMeshComponent->SetStaticMesh(CamMesh);
132 Super::EndPlay(EndPlayReason);
136 auto &StreamingServer = GameInstance->GetServer().GetStreamingServer();
138 StreamingServer.CloseStream(StreamId);
void EndPlay(EEndPlayReason::Type EndPlayReason) override
FActorDescription SensorDescription
virtual void OnFirstClientConnected()
void Tick(const float DeltaTime) final
bool ReadyToTick
Allows the sensor to tick using the configured UE5 tick interval.
bool bPrimaryDrivenTick
Multi-GPU secondary: ticks are driven by the primary's frames.
float ReadyToTickDeltaSeconds
Elapsed time computed by UE5's tick scheduler for the most recent Tick().
int32 Seed
Seed of the pseudo-random engine.
virtual void Set(const FActorDescription &Description)
std::optional< FActorAttribute > GetAttribute(const FString Name)
void PostActorCreated() override
URandomEngine * RandomEngine
Random Engine used to provide noise for sensor output.
void PostPhysTickInternal(UWorld *World, ELevelTick TickType, float DeltaSeconds)
float PrimaryTickDeltaSeconds
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
const UCarlaEpisode & GetEpisode() const
virtual void OnLastClientDisconnected()
ASensor(const FObjectInitializer &ObjectInitializer)
void SetSeed(int32 InSeed)
virtual void PrePhysTick(float DeltaSeconds)
auto GetToken() const
Return the token that allows subscribing to this stream.
bool AreClientsListening()
void DeRegisterSensor(ASensor *Sensor)
void RegisterSensor(ASensor *Sensor)
static float ActorAttributeToFloat(const FActorAttribute &ActorAttribute, float Default)
FSensorManager & GetSensorManager()
static UCarlaGameInstance * GetGameInstance(const UObject *WorldContextObject)
static UCarlaEpisode * GetCurrentEpisode(const UObject *WorldContextObject)
void Seed(int32 InSeed)
Seed the random engine.
Serializes a stream endpoint.
const auto & get_stream_id() const
A description of a Carla Actor with all its variation.
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.