From 98a65527298d98c97862ef923b5199c30fcd1269 Mon Sep 17 00:00:00 2001 From: MarinaGloc Date: Tue, 12 May 2026 17:46:36 -0300 Subject: [PATCH] added 5.7 compatibility for depthlidar --- .../ProjectAirSim/Private/Sensors/DepthLidar.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/DepthLidar.cpp b/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/DepthLidar.cpp index 922fb243..3ef41960 100644 --- a/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/DepthLidar.cpp +++ b/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/DepthLidar.cpp @@ -228,12 +228,24 @@ void UDepthLidar::SetupDepthCapture() { } if (UnrealWorld) { +#if UE_IS_5_2 + // UE < 5.6: individual LineBatcher pointers on UWorld DepthCaptureComponent->HideComponent( Cast(UnrealWorld->LineBatcher)); DepthCaptureComponent->HideComponent( Cast(UnrealWorld->PersistentLineBatcher)); DepthCaptureComponent->HideComponent( Cast(UnrealWorld->ForegroundLineBatcher)); +#elif UE_IS_5_7 + // UE 5.6+: LineBatcher/PersistentLineBatcher/ForegroundLineBatcher were + // replaced by GetLineBatcher(ELineBatcherType) + DepthCaptureComponent->HideComponent( + UnrealWorld->GetLineBatcher(UWorld::ELineBatcherType::World)); + DepthCaptureComponent->HideComponent( + UnrealWorld->GetLineBatcher(UWorld::ELineBatcherType::WorldPersistent)); + DepthCaptureComponent->HideComponent( + UnrealWorld->GetLineBatcher(UWorld::ELineBatcherType::Foreground)); +#endif } DepthCaptureComponent->RegisterComponent(); @@ -322,7 +334,7 @@ void UDepthLidar::ReadDepthPixels(TArray& OutDepthPixels) const { return; } - FRHITexture2D* Texture2D = TextureRef->GetTexture2D(); + FRHITexture* Texture2D = TextureRef->GetTexture2D(); if (!Texture2D) { return; }