From 41455990688f2bf92dd0f2a76e006d18fa349450 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Wed, 10 Jul 2024 11:08:27 +0200 Subject: [PATCH] workaround the runuat 5.2/5.3 build issue due to missing IOpenXRHMD.h from epic public headers --- .../SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp index 30c436c0..d389eacb 100644 --- a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp +++ b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp @@ -41,7 +41,9 @@ #include "Engine/SkeletalMesh.h" #include "Engine/World.h" #include "GameFramework/WorldSettings.h" +#if ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 #include "IOpenXRHMD.h" +#endif /* ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 */ #include "IOpenXRHMDModule.h" #include "IXRTrackingSystem.h" #include "OpenXRCore.h" @@ -994,6 +996,7 @@ bool FSGXRTracker::GetMotionControllerData( return false; } +#if ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 IOpenXRHMD* OpenXRHMD{XRTrackingSystem->GetIOpenXRHMD()}; if (!OpenXRHMD) { @@ -1155,6 +1158,9 @@ bool FSGXRTracker::GetMotionControllerData( /// TODO // This is reportedly a WMR-specific convenience function for rapid prototyping. Not sure if it's useful for OpenXR. OutMotionControllerData.bIsGrasped = false; +#else /* ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 */ + XRTrackingSystem->GetMotionControllerData(WorldContextObject, Hand, OutMotionControllerData); +#endif /* ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 */ return OutMotionControllerData.bValid; }