diff --git a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp index 7e10c2e8..1c73246e 100644 --- a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp +++ b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp @@ -1163,9 +1163,28 @@ bool FSGXRTracker::GetMotionControllerData( { OutMotionControllerData.DeviceVisualType = EXRVisualType::Hand; + /// TODO + // This is a just a temporary workaround to silence a UE 5.5 deprecation warning. + // Should be refactored with a proper implementation when migrating away from the deprecated + // `FXRMotionControllerData` in favor of newly introduced + // `FXRMotionControllerState` and `FXRHandTrackingState` structs. +#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 + bool bTracked = false; +#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ OutMotionControllerData.bValid = HandTracker->GetAllKeypointStates( Hand, OutMotionControllerData.HandKeyPositions, OutMotionControllerData.HandKeyRotations, - OutMotionControllerData.HandKeyRadii); + OutMotionControllerData.HandKeyRadii +#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 + , bTracked +#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ + ); + +#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 + if (!bTracked) + { + return false; + } +#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ if (!ensureAlwaysMsgf( !OutMotionControllerData.bValid