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; }