CARLA
Loading...
Searching...
No Matches
DepthCamera_WideAngleLens.cpp
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
8#include "Carla.h"
9
12
14
20
21ADepthCamera_WideAngleLens::ADepthCamera_WideAngleLens(const FObjectInitializer &ObjectInitializer)
22 : Super(ObjectInitializer)
23{
24 // Depth is encoded as a base-256 value across the R/G/B channels, so the
25 // cubemap-to-fisheye resample must use point sampling; linear filtering
26 // would interpolate the encoded bytes and decode to nonsense depth.
27 Super::SetCubemapSampler(CameraModelUtil::GetSampler(ESamplerFilter::SF_Point));
28
30#if PLATFORM_LINUX
31 TEXT("Material'/Carla/PostProcessingMaterials/WideAngleLens/DepthEffectMaterial_GLSL_WAL.DepthEffectMaterial_GLSL_WAL'")
32#else
33 TEXT("Material'/Carla/PostProcessingMaterials/WideAngleLens/DepthEffectMaterial_WAL.DepthEffectMaterial_WAL'")
34#endif
35 );
36}
37
38void ADepthCamera_WideAngleLens::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
39{
40 TRACE_CPUPROFILER_EVENT_SCOPE(ADepthCamera_WideAngleLens::PostPhysTick);
41 // Skip the whole 6-face capture + compute + readback pipeline when no
42 // client is subscribed.
44 return;
46}
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
ADepthCamera_WideAngleLens(const FObjectInitializer &ObjectInitializer)
static FActorDefinition GetSensorDefinition()
static void CaptureAndSendToClient(TSensor &Sensor)
Capture the six faces, project them into the lens, and deliver the image through ImageUtil's per-tick...
static FActorDefinition MakeWideAngleLensCameraDefinition(const FString &Id, bool bEnableModifyingPostProcessEffects=false)
FRHISamplerState * GetSampler(ESamplerFilter Filter)
A definition of a Carla Actor with all the variation and attributes.