diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d98e06..c20235f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,8 +65,6 @@ This is a minor release focusing mainly on bringing OpenXR-compatible hand track - The UXRDeviceVisualizationComponent provided by Unreal Engine is used in the SGPawn class as ControllerVisualizerLeft and ControllerVisualizerRight for implementing the wrist tracking hardware visualization feature. However, it is not compatible with the new OpenXR system in certain scenarios. For instance, when the motion controllers serve as wrist tracking hardware since the SenseGlove plugin is now introduced to the engine as an OpenXRHandTracking system, it causes the UXRDeviceVisualizationComponent to visualize the wrist tracking hardware at coordinates (0.0f, 0.0f, 0.0f) instead of their actual location and rotation in the world. This happens because the component incorrectly registers them as inactive, possibly because it's assumed hand tracking and motion controllers cannot be in use at the same time. Currently, we use this feature solely for debugging, and we have an alternative in the form of wrist-tracking debug gizmos, which can be toggled on or off via the settings system. In future releases, we might remove this feature due to its incompatibility, unless we find a solution to make the UXRDeviceVisualizationComponent work with the new system. Alternatively, we may develop our own version of the UXRDeviceVisualizationComponent. - Although the SenseGlove OpenXR implementation is fully compatible with the IOpenXRHMD interface and the FOpenXRHMD XRTrackingSystem, it's not compatible with FOculusXRHMD backend provided by the Meta XR plugin. It should possibly be the same with the VIVE OpenXR plugin. So, if these plugins are enabled in your project, the SenseGlove OpenXR will not function as intended, breaking the plugin's functionality. It seems these plugins are required in order to make the fallback to the hand-tracking feature work on Android. We might add support and compatibility with Meta XR and VIVE OpenXR plugins in the future, but for the time being if your project requires those plugins we advise sticking to the v2.0.x version of the SenseGlove Unreal Engine plugin for now. -- On UE 5.2 and 5.3 if other OpenXRHandTracking plugins are active simultaneously along with the SenseGlove plugin, they might or might not break the SenseGlove plugin's functionality. Or, when you get the FXRMotionControllerData from IXRTrackingSystem::GetMotionControllerData() it returns the data from the first OpenXRHandTracking provider it could find, which might not be SenseGlove. On UE 5.4, one could use our version of GetMotionControllerData(), FSGXRTracker::GetMotionControllerData() which returns the correct FXRMotionControllerData by finding the right OpenXRHandTracking provider. On UE 5.2 and 5.3 this is just a wrapper around IXRTrackingSystem::GetMotionControllerData() and that's why it exhibits the same behavior that breaks the plugin when other OpenXRHandTracking providers are present at the same time. - ## [2.0.7] - 2024-05-29 diff --git a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp index d389eacb..bd8d68f8 100644 --- a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp +++ b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp @@ -41,12 +41,15 @@ #include "Engine/SkeletalMesh.h" #include "Engine/World.h" #include "GameFramework/WorldSettings.h" -#if ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 +#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 #include "IOpenXRHMD.h" -#endif /* ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 */ +#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ #include "IOpenXRHMDModule.h" #include "IXRTrackingSystem.h" #include "OpenXRCore.h" +#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3 +#include "OpenXRHMD.h" +#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3 */ #include "Runtime/Launch/Resources/Version.h" #include "SGCore/SGHapticGlove.h" @@ -996,8 +999,11 @@ bool FSGXRTracker::GetMotionControllerData( return false; } -#if ENGINE_MAJOR_VERSION > 5 && ENGINE_MINOR_VERSION >= 4 +#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 IOpenXRHMD* OpenXRHMD{XRTrackingSystem->GetIOpenXRHMD()}; +#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ + FOpenXRHMD* OpenXRHMD{static_cast(GEngine->XRSystem.Get())}; +#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ if (!OpenXRHMD) { return false; @@ -1158,9 +1164,6 @@ 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; } diff --git a/Source/SenseGloveTracking/SenseGloveTracking.Build.cs b/Source/SenseGloveTracking/SenseGloveTracking.Build.cs index ffa488ed..291a7c3f 100644 --- a/Source/SenseGloveTracking/SenseGloveTracking.Build.cs +++ b/Source/SenseGloveTracking/SenseGloveTracking.Build.cs @@ -34,6 +34,7 @@ using System; +using System.IO; using UnrealBuildTool; public class SenseGloveTracking : ModuleRules @@ -66,6 +67,23 @@ public class SenseGloveTracking : ModuleRules } ); +#if ! UE_5_4_OR_LATER + string OpenXRHMDPrivateIncludeDir = Path.GetFullPath(Target.RelativeEnginePath); + OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Plugins"); + OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Runtime"); + OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "OpenXR"); + OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Source"); + OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "OpenXRHMD"); + OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Private"); + + PrivateIncludePaths.AddRange( + new string[] + { + OpenXRHMDPrivateIncludeDir, + } + ); +#endif + PrivateDependencyModuleNames.AddRange( new string[] {