add support for htc vive wrist trackers on android

This commit is contained in:
Mamadou Babaei
2025-02-14 12:03:14 +01:00
parent 763f7d8969
commit a828e5249d
7 changed files with 155 additions and 35 deletions
@@ -37,6 +37,7 @@
FSGWristTrackingSettings::FSGWristTrackingSettings()
: FSGWristTrackingSettings{
ESGOpenXRPositionalTrackingProvider::None,
ESGPositionalTrackingHardware::None,
FVector::ZeroVector,
FVector::ZeroVector,
@@ -44,12 +45,13 @@ FSGWristTrackingSettings::FSGWristTrackingSettings()
FRotator::ZeroRotator,
FName{TEXT("Left")},
FName{TEXT("Right")},
FSGWristTrackingDebuggingSettings{}
FSGWristTrackingDebuggingSettings{},
}
{
}
FSGWristTrackingSettings::FSGWristTrackingSettings(
const ESGOpenXRPositionalTrackingProvider InOpenXRPositionalTrackingProvider,
const ESGPositionalTrackingHardware InTrackingHardware,
const FVector& InTrackingHardwareLocationOffsetLeftHand,
const FVector& InTrackingHardwareLocationOffsetRightHand,
@@ -58,7 +60,8 @@ FSGWristTrackingSettings::FSGWristTrackingSettings(
const FName InLeftHandMotionSource,
const FName InRightHandMotionSource,
const FSGWristTrackingDebuggingSettings& InDebuggingSettings)
: TrackingHardware(InTrackingHardware),
: OpenXRPositionalTrackingProvider(InOpenXRPositionalTrackingProvider),
TrackingHardware(InTrackingHardware),
TrackingHardwareLocationOffsetLeftHand{InTrackingHardwareLocationOffsetLeftHand},
TrackingHardwareLocationOffsetRightHand{InTrackingHardwareLocationOffsetRightHand},
TrackingHardwareRotationOffsetLeftHand{InTrackingHardwareRotationOffsetLeftHand},
@@ -44,6 +44,7 @@
#include "SGSettings/SGWristTrackingDebuggingSettings.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGTypes/SGTrackingTypes.h"
#include "SGWristTrackingSettings.generated.h"
@@ -58,6 +59,33 @@ struct SENSEGLOVESETTINGS_API FSGWristTrackingSettings
GENERATED_USTRUCT_BODY()
public:
/**
* Specifies the type of OpenXR provider to use in order to extract the positional tracking data from the
* underlying XR system. If set to None, the plugin attempts to set this automatically by considering a combination
* of approaches including, the current value of `TrackingHardware` specified below, the platform it's targeted at,
* the available OpenXR plugins, along with HMD auto-detection mechanism to specify a compatible OpenXR tracking
* provider. Please note that the OpenXR provider depends on the combination of plugins, platform, and the settings
* you use. For example, it is possible to use a Vive Focus 3 Wrist Tracker on Microsoft Windows along with the
* Epic `OpenXRViveTracker` plugin and check the option `Emulate VIVE Wrist Tracker as VIVE Tracker` inside the
* VIVE Business Streaming application's Input settings. In that case, the correct OpenXR positional tracking
* provider to use would be `OpenXRViveTracker`. However, using the official ViveOpenXR plugin on Android, the
* correct OpenXR provider would be `OpenXRViveWristTracker`.
*
* Caution:
* HMD auto-detection is currently an experimental feature and may fail because HMD vendors occasionally change the
* properties utilized by the plugin for HMD detection. If you encounter issues, such as incorrect tracker offsets,
* it is recommended to explicitly specify the tracking hardware.
*
* Caution:
* Due to highly experimental nature of the HMD auto-detection feature, the HTC VIVE Focus Vision, HTC VIVE XR
* Elite, and HTC VIVE Focus Vision cannot be distinguished from each other in the current iteration. However,
* since the tracker devices and offsets for all these headsets are the same, this should not affect the
* performance or any functionality. The order in which the HMD is detected can be specified through the
* HMD-tracker setting `ViveHMDDetectionPriority`.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking")
ESGOpenXRPositionalTrackingProvider OpenXRPositionalTrackingProvider;
/**
* Specifies the type of tracking hardware to use. If set to None, the plugin attempts at HMD auto-detection to
* automatically specify a compatible tracking hardware. If set to `Custom`, any desired location and rotation can
@@ -150,6 +178,7 @@ public:
FSGWristTrackingSettings();
FSGWristTrackingSettings(
const ESGOpenXRPositionalTrackingProvider InOpenXRPositionalTrackingProvider,
ESGPositionalTrackingHardware InTrackingHardware,
const FVector& InTrackingHardwareLocationOffsetLeftHand,
const FVector& InTrackingHardwareLocationOffsetRightHand,