add support for htc vive focus vision hmd auto-detection and various htc hmds auto-detection support on android

This commit is contained in:
Mamadou Babaei
2025-02-14 12:11:14 +01:00
parent 5a70218a71
commit a1ce48e133
10 changed files with 290 additions and 40 deletions
+3
View File
@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Introduced the `Meta XR` plugin compatibility. - Introduced the `Meta XR` plugin compatibility.
- Introduced the `ViveOpenXR` plugin compatibility. - Introduced the `ViveOpenXR` plugin compatibility.
- Added the `FSGPluginUtils` utility class for other plugins or modules availability detection such as `Meta XR` and `ViveOpenXR`. - Added the `FSGPluginUtils` utility class for other plugins or modules availability detection such as `Meta XR` and `ViveOpenXR`.
- Added various HTC HMDs auto-detection support on Android.
- Added support for HTC VIVE Focus Vision HMD auto-detection.
### Fixed ### Fixed
@@ -29,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bumped the SenseGlove Unreal Engine Marketplace Packager `v0.5.0-7df1183`. - Bumped the SenseGlove Unreal Engine Marketplace Packager `v0.5.0-7df1183`.
- Bumped the copyright years. - Bumped the copyright years.
- This is the last release to support Unreal Engine `5.2`. From `v2.5.x` onwards only UE `5.3` and newer will be supported. - This is the last release to support Unreal Engine `5.2`. From `v2.5.x` onwards only UE `5.3` and newer will be supported.
- The `ESGViveHMDDetectionPriority` enum items has changed and is no longer backward-compatible.
### Documentation ### Documentation
@@ -6,4 +6,33 @@ Provides the tracking settings related to head-mounted displays (HDMs) and their
## ViveHMDDetectionPriority ## ViveHMDDetectionPriority
Determines which VIVE HMD to prioritize for detection, as the current detection mechanism cannot differentiate between the HTC VIVE Focus 3 and the HTC VIVE XR Elite. Determines which VIVE HMD to prioritize for detection, as the current detection mechanism cannot differentiate between HTC VIVE Focus Vision, HTC VIVE XR Elite, and HTC VIVE Focus 3.
The following values are possible:
```cpp
/*
* The HTC VIVE HMD detection priority for HTC devices that we cannot distinguish.
*/
UENUM(BlueprintType)
enum class ESGViveHMDDetectionPriority : uint8
{
/* First try to detect HTC VIVE Focus Vision, then XR Elite, and then Focus 3. */
FocusVision_XRElite_Focus3 UMETA(DisplayName = "Focus Vision (1st), XR Elite (2nd), Focus3 (3rd)"),
/* First try to detect HTC VIVE Focus Vision, then Focus 3, and then XR Elite. */
FocusVision_Focus3_XRElite UMETA(DisplayName = "Focus Vision (1st), Focus3 (2nd), XR Elite (3rd)"),
/* First try to detect HTC VIVE XR Elite, then Focus Vision, and then Focus 3. */
XRElite_FocusVision_Focus3 UMETA(DisplayName = "XR Elite (1st), Focus Vision (2nd), Focus3 (3rd)"),
/* First try to detect HTC VIVE XR Elite, then Focus 3, and then Focus Vision. */
XRElite_Focus3_FocusVision UMETA(DisplayName = "XR Elite (1st), Focus3 (2nd), Focus Vision (3rd)"),
/* First try to detect HTC VIVE Focus 3, then Focus Vision, and then XR Elite. */
Focus3_FocusVision_XRElite UMETA(DisplayName = "Focus3 (1st), Focus Vision (2nd), XR Elite (3rd)"),
/* First try to detect HTC VIVE Focus 3, then XR Elite, and then Focus Vision. */
Focus3_XRElite_FocusVision UMETA(DisplayName = "Focus3 (1st), XR Elite (2nd), Focus Vision (3rd)"),
};
```
@@ -26,10 +26,11 @@ At the moment the following hardware are supported:
> [!CAUTION] > [!CAUTION]
> Due to highly experimental nature of the HMD auto-detection feature, the HTC > Due to highly experimental nature of the HMD auto-detection feature, the HTC
> VIVE Focus 3 and HTC XR Elite cannot be distinguished from each other in the > VIVE Focus Vision, HTC VIVE Focus 3, and HTC VIVE XR Elite cannot be
> current iteration. However, since the tracker devices and offsets for both > distinguished from each other in the current iteration. However, since the
> headsets are the same, this should not affect performance or functionality. > tracker devices and offsets for all these headsets are the same, this should
> The order in which the HMD is detected can be specified through the > not affect the performance or any functionality. The order in which the HMD is
> detected can be specified through the
> [HMD-tracker setting `ViveHMDDetectionPriority`](../hmd-tracking.html#vivehmddetectionpriority). > [HMD-tracker setting `ViveHMDDetectionPriority`](../hmd-tracking.html#vivehmddetectionpriority).
## TrackingHardwareLocationOffsetLeftHand ## TrackingHardwareLocationOffsetLeftHand
@@ -37,7 +37,7 @@
FSGHMDTrackingSettings::FSGHMDTrackingSettings() FSGHMDTrackingSettings::FSGHMDTrackingSettings()
: FSGHMDTrackingSettings{ : FSGHMDTrackingSettings{
ESGViveHMDDetectionPriority::HtcViveFocus3First ESGViveHMDDetectionPriority::FocusVision_XRElite_Focus3
} }
{ {
} }
@@ -54,7 +54,7 @@ struct SENSEGLOVESETTINGS_API FSGHMDTrackingSettings
public: public:
/** /**
* Determines which VIVE HMD to prioritize for detection, as the current detection mechanism cannot differentiate * Determines which VIVE HMD to prioritize for detection, as the current detection mechanism cannot differentiate
* between the HTC VIVE Focus 3 and the HTC VIVE XR Elite. * between HTC VIVE Focus Vision, HTC VIVE XR Elite, and HTC VIVE Focus 3.
*/ */
UPROPERTY(Config, EditDefaultsOnly, Category="HMD Tracking") UPROPERTY(Config, EditDefaultsOnly, Category="HMD Tracking")
ESGViveHMDDetectionPriority ViveHMDDetectionPriority; ESGViveHMDDetectionPriority ViveHMDDetectionPriority;
@@ -70,11 +70,11 @@ public:
* the tracking hardware. * the tracking hardware.
* *
* Caution: * Caution:
* Due to highly experimental nature of the HMD auto-detection feature, the HTC VIVE Focus 3 and HTC XR Elite * Due to highly experimental nature of the HMD auto-detection feature, the HTC VIVE Focus Vision, HTC VIVE XR
* cannot be distinguished from each other in the current iteration. However, since the tracker devices and offsets * Elite, and HTC VIVE Focus Vision cannot be distinguished from each other in the current iteration. However,
* for both headsets are the same, this should not affect performance or functionality. * since the tracker devices and offsets for all these headsets are the same, this should not affect the
* The order in which the HMD is detected can be specified through the HMD-tracker setting * performance or any functionality. The order in which the HMD is detected can be specified through the
* `ViveHMDDetectionPriority`. * HMD-tracker setting `ViveHMDDetectionPriority`.
*/ */
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking") UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking")
ESGPositionalTrackingHardware TrackingHardware; ESGPositionalTrackingHardware TrackingHardware;
@@ -150,13 +150,19 @@ bool FSGHMDTracker::IsHtcVivePro()
/// NOTE /// NOTE
// VIVE Pro: // VIVE Pro:
// - Official Spec: 1440 x 1600 pixels per eye (2880 x 1600 pixels combined) // - Official Spec: 1440 x 1600 pixels per eye (2880 x 1600 pixels combined)
// - Unreal OpenXR Resolution: 4936 x 2740 // - Unreal OpenXR Resolution (PCVR): 4936 x 2740
// VIVE Focus 3: // VIVE Focus 3:
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined) // - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution: 5016 x 2508 // - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): ?
// VIVE XR Elite // VIVE XR Elite
// - Official Spec: 1920 x 1920 pixels per eye (3840 x 1920 pixels combined) // - Official Spec: 1920 x 1920 pixels per eye (3840 x 1920 pixels combined)
// - Unreal OpenXR Resolution: 5016 x 2508 // - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): ?
// VIVE Focus Vision
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): 1720 x 1720
if (HmdMonitorInfo.ResolutionX < 5000 && HmdMonitorInfo.ResolutionY > 2700) if (HmdMonitorInfo.ResolutionX < 5000 && HmdMonitorInfo.ResolutionY > 2700)
{ {
bResolutionMatches = true; bResolutionMatches = true;
@@ -173,6 +179,13 @@ bool FSGHMDTracker::IsHtcVivePro()
bool FSGHMDTracker::IsHtcViveFocus3() bool FSGHMDTracker::IsHtcViveFocus3()
{ {
#if PLATFORM_ANDROID
static const FName DeviceIdentifier{TEXT("WAVE:SUE")};
const FName DeviceName{GetDeviceName()};
const bool bNameMatches = DeviceName == DeviceIdentifier;
#else /* PLATFORM_ANDROID */
static const FName DeviceIdentifier{TEXT("Vive OpenXR: Vive SRanipal")}; static const FName DeviceIdentifier{TEXT("Vive OpenXR: Vive SRanipal")};
static const FString ViveDeviceIdentifier{TEXT("Vive")}; static const FString ViveDeviceIdentifier{TEXT("Vive")};
static const FString SRanipalDeviceIdentifier{TEXT("SRanipal")}; static const FString SRanipalDeviceIdentifier{TEXT("SRanipal")};
@@ -186,11 +199,12 @@ bool FSGHMDTracker::IsHtcViveFocus3()
bNameMatches = DeviceNameString.Contains(ViveDeviceIdentifier) bNameMatches = DeviceNameString.Contains(ViveDeviceIdentifier)
|| DeviceNameString.Contains(SRanipalDeviceIdentifier); || DeviceNameString.Contains(SRanipalDeviceIdentifier);
} }
#endif /* PLATFORM_ANDROID */
/// NOTE /// NOTE
/// For the time being since we cannot distinguish between VIVE Focus 3 and VIVE XR Elite using resolution checks, /// For the time being since we cannot distinguish between VIVE Focus Vision, VIVE XR Elite, and VIVE Focus 3 using
/// we skip the resolution checks altogether and assume it's not a VIVE Pro, as VIVE Pro won't come with Android /// resolution checks, we skip the resolution checks altogether and assume it's not a VIVE Pro, as VIVE Pro won't
/// support. /// come with Android support.
#if PLATFORM_ANDROID #if PLATFORM_ANDROID
bool bResolutionMatches = true; bool bResolutionMatches = true;
#else /* PLATFORM_ANDROID */ #else /* PLATFORM_ANDROID */
@@ -209,15 +223,21 @@ bool FSGHMDTracker::IsHtcViveFocus3()
/// NOTE /// NOTE
// VIVE Pro: // VIVE Pro:
// - Official Spec: 1440 x 1600 pixels per eye (2880 x 1600 pixels combined) // - Official Spec: 1440 x 1600 pixels per eye (2880 x 1600 pixels combined)
// - Unreal OpenXR Resolution: 4936 x 2740 // - Unreal OpenXR Resolution (PCVR): 4936 x 2740
// VIVE Focus 3: // VIVE Focus 3:
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined) // - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution: 5016 x 2508 // - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): ?
// VIVE XR Elite // VIVE XR Elite
// - Official Spec: 1920 x 1920 pixels per eye (3840 x 1920 pixels combined) // - Official Spec: 1920 x 1920 pixels per eye (3840 x 1920 pixels combined)
// - Unreal OpenXR Resolution: 5016 x 2508 // - Unreal OpenXR Resolution (PCVR): 5016 x 2508
if (HmdMonitorInfo.ResolutionX > 5000 // - Unreal OpenXR Resolution (Standalone): ?
&& (HmdMonitorInfo.ResolutionY > 2500 && HmdMonitorInfo.ResolutionY < 2700)) // VIVE Focus Vision
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): 1720 x 1720
if (HmdMonitorInfo.ResolutionX > 5000 &&
(HmdMonitorInfo.ResolutionY > 2500 && HmdMonitorInfo.ResolutionY < 2700))
{ {
bResolutionMatches = true; bResolutionMatches = true;
} }
@@ -233,6 +253,13 @@ bool FSGHMDTracker::IsHtcViveFocus3()
bool FSGHMDTracker::IsHtcViveXRElite() bool FSGHMDTracker::IsHtcViveXRElite()
{ {
#if PLATFORM_ANDROID
static const FName DeviceIdentifier{TEXT("WAVE:SUE")};
const FName DeviceName{GetDeviceName()};
const bool bNameMatches = DeviceName == DeviceIdentifier;
#else /* PLATFORM_ANDROID */
static const FName DeviceIdentifier{TEXT("Vive OpenXR: Vive SRanipal")}; static const FName DeviceIdentifier{TEXT("Vive OpenXR: Vive SRanipal")};
static const FString ViveDeviceIdentifier{TEXT("Vive")}; static const FString ViveDeviceIdentifier{TEXT("Vive")};
static const FString SRanipalDeviceIdentifier{TEXT("SRanipal")}; static const FString SRanipalDeviceIdentifier{TEXT("SRanipal")};
@@ -246,11 +273,12 @@ bool FSGHMDTracker::IsHtcViveXRElite()
bNameMatches = DeviceNameString.Contains(ViveDeviceIdentifier) bNameMatches = DeviceNameString.Contains(ViveDeviceIdentifier)
|| DeviceNameString.Contains(SRanipalDeviceIdentifier); || DeviceNameString.Contains(SRanipalDeviceIdentifier);
} }
#endif /* PLATFORM_ANDROID */
/// NOTE /// NOTE
/// For the time being since we cannot distinguish between VIVE Focus 3 and VIVE XR Elite using resolution checks, /// For the time being since we cannot distinguish between VIVE Focus Vision, VIVE XR Elite, and VIVE Focus 3 using
/// we skip the resolution checks altogether and assume it's not a VIVE Pro, as VIVE Pro won't come with Android /// resolution checks, we skip the resolution checks altogether and assume it's not a VIVE Pro, as VIVE Pro won't
/// support. /// come with Android support.
#if PLATFORM_ANDROID #if PLATFORM_ANDROID
bool bResolutionMatches = true; bool bResolutionMatches = true;
#else /* PLATFORM_ANDROID */ #else /* PLATFORM_ANDROID */
@@ -269,13 +297,93 @@ bool FSGHMDTracker::IsHtcViveXRElite()
/// NOTE /// NOTE
// VIVE Pro: // VIVE Pro:
// - Official Spec: 1440 x 1600 pixels per eye (2880 x 1600 pixels combined) // - Official Spec: 1440 x 1600 pixels per eye (2880 x 1600 pixels combined)
// - Unreal OpenXR Resolution: 4936 x 2740 // - Unreal OpenXR Resolution (PCVR): 4936 x 2740
// VIVE Focus 3: // VIVE Focus 3:
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined) // - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution: 5016 x 2508 // - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): ?
// VIVE XR Elite // VIVE XR Elite
// - Official Spec: 1920 x 1920 pixels per eye (3840 x 1920 pixels combined) // - Official Spec: 1920 x 1920 pixels per eye (3840 x 1920 pixels combined)
// - Unreal OpenXR Resolution: 5016 x 2508 // - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): ?
// VIVE Focus Vision
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): 1720 x 1720
if (HmdMonitorInfo.ResolutionX > 5000 &&
(HmdMonitorInfo.ResolutionY > 2500 && HmdMonitorInfo.ResolutionY < 2700))
{
bResolutionMatches = true;
}
}
}
}
#endif /* PLATFORM_ANDROID */
const bool bMatched = bNameMatches && bResolutionMatches;
return bMatched;
}
bool FSGHMDTracker::IsHtcViveFocusVision()
{
#if PLATFORM_ANDROID
static const FName DeviceIdentifier{TEXT("WAVE:SUE")};
const FName DeviceName{GetDeviceName()};
const bool bNameMatches = DeviceName == DeviceIdentifier;
#else /* PLATFORM_ANDROID */
static const FName DeviceIdentifier{TEXT("Vive OpenXR: Vive SRanipal")};
static const FString ViveDeviceIdentifier{TEXT("Vive")};
static const FString SRanipalDeviceIdentifier{TEXT("SRanipal")};
const FName DeviceName{GetDeviceName()};
bool bNameMatches = DeviceName == DeviceIdentifier;
if (!bNameMatches)
{
const FString DeviceNameString{GetDeviceName().ToString()};
bNameMatches = DeviceNameString.Contains(ViveDeviceIdentifier)
|| DeviceNameString.Contains(SRanipalDeviceIdentifier);
}
#endif /* PLATFORM_ANDROID */
/// NOTE
/// For the time being since we cannot distinguish between VIVE Focus Vision, VIVE XR Elite, and VIVE Focus 3 using
/// resolution checks, we skip the resolution checks altogether and assume it's not a VIVE Pro, as VIVE Pro won't
/// come with Android support.
#if PLATFORM_ANDROID
bool bResolutionMatches = true;
#else /* PLATFORM_ANDROID */
bool bResolutionMatches = false;
if (bNameMatches)
{
if (GEngine && GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed())
{
IHeadMountedDisplay* Device{GEngine->XRSystem->GetHMDDevice()};
if (Device)
{
IHeadMountedDisplay::MonitorInfo HmdMonitorInfo;
Device->GetHMDMonitorInfo(HmdMonitorInfo);
/// NOTE
// VIVE Pro:
// - Official Spec: 1440 x 1600 pixels per eye (2880 x 1600 pixels combined)
// - Unreal OpenXR Resolution (PCVR): 4936 x 2740
// VIVE Focus 3:
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): ?
// VIVE XR Elite
// - Official Spec: 1920 x 1920 pixels per eye (3840 x 1920 pixels combined)
// - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): ?
// VIVE Focus Vision
// - Official Spec: 2448 x 2448 pixels per eye (4896 x 2448 pixels combined)
// - Unreal OpenXR Resolution (PCVR): 5016 x 2508
// - Unreal OpenXR Resolution (Standalone): 1720 x 1720
if (HmdMonitorInfo.ResolutionX > 5000 && if (HmdMonitorInfo.ResolutionX > 5000 &&
(HmdMonitorInfo.ResolutionY > 2500 && HmdMonitorInfo.ResolutionY < 2700)) (HmdMonitorInfo.ResolutionY > 2500 && HmdMonitorInfo.ResolutionY < 2700))
{ {
@@ -315,9 +423,34 @@ ESGHeadMountedDisplayDevice FSGHMDTracker::GetDeviceType()
const USGSettings* Settings{USGSettings::GetInstance()}; const USGSettings* Settings{USGSettings::GetInstance()};
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!")); ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
if (Settings->GetTrackingSettings().HMDTrackingSettings.ViveHMDDetectionPriority == if (Settings->GetTrackingSettings().HMDTrackingSettings.ViveHMDDetectionPriority ==
ESGViveHMDDetectionPriority::HtcViveFocus3First) ESGViveHMDDetectionPriority::FocusVision_XRElite_Focus3)
{ {
if (IsHtcViveFocusVision())
{
return ESGHeadMountedDisplayDevice::HtcViveFocusVision;
}
if (IsHtcViveXRElite())
{
return ESGHeadMountedDisplayDevice::HtcViveXRElite;
}
if (IsHtcViveFocus3())
{
return ESGHeadMountedDisplayDevice::HtcViveFocus3;
}
}
if (Settings->GetTrackingSettings().HMDTrackingSettings.ViveHMDDetectionPriority ==
ESGViveHMDDetectionPriority::FocusVision_Focus3_XRElite)
{
if (IsHtcViveFocusVision())
{
return ESGHeadMountedDisplayDevice::HtcViveFocusVision;
}
if (IsHtcViveFocus3()) if (IsHtcViveFocus3())
{ {
return ESGHeadMountedDisplayDevice::HtcViveFocus3; return ESGHeadMountedDisplayDevice::HtcViveFocus3;
@@ -328,7 +461,28 @@ ESGHeadMountedDisplayDevice FSGHMDTracker::GetDeviceType()
return ESGHeadMountedDisplayDevice::HtcViveXRElite; return ESGHeadMountedDisplayDevice::HtcViveXRElite;
} }
} }
else
if (Settings->GetTrackingSettings().HMDTrackingSettings.ViveHMDDetectionPriority ==
ESGViveHMDDetectionPriority::XRElite_FocusVision_Focus3)
{
if (IsHtcViveXRElite())
{
return ESGHeadMountedDisplayDevice::HtcViveXRElite;
}
if (IsHtcViveFocusVision())
{
return ESGHeadMountedDisplayDevice::HtcViveFocusVision;
}
if (IsHtcViveFocus3())
{
return ESGHeadMountedDisplayDevice::HtcViveFocus3;
}
}
if (Settings->GetTrackingSettings().HMDTrackingSettings.ViveHMDDetectionPriority ==
ESGViveHMDDetectionPriority::XRElite_Focus3_FocusVision)
{ {
if (IsHtcViveXRElite()) if (IsHtcViveXRElite())
{ {
@@ -339,6 +493,49 @@ ESGHeadMountedDisplayDevice FSGHMDTracker::GetDeviceType()
{ {
return ESGHeadMountedDisplayDevice::HtcViveFocus3; return ESGHeadMountedDisplayDevice::HtcViveFocus3;
} }
if (IsHtcViveFocusVision())
{
return ESGHeadMountedDisplayDevice::HtcViveFocusVision;
}
}
if (Settings->GetTrackingSettings().HMDTrackingSettings.ViveHMDDetectionPriority ==
ESGViveHMDDetectionPriority::Focus3_FocusVision_XRElite)
{
if (IsHtcViveFocus3())
{
return ESGHeadMountedDisplayDevice::HtcViveFocus3;
}
if (IsHtcViveFocusVision())
{
return ESGHeadMountedDisplayDevice::HtcViveFocusVision;
}
if (IsHtcViveXRElite())
{
return ESGHeadMountedDisplayDevice::HtcViveXRElite;
}
}
if (Settings->GetTrackingSettings().HMDTrackingSettings.ViveHMDDetectionPriority ==
ESGViveHMDDetectionPriority::Focus3_XRElite_FocusVision)
{
if (IsHtcViveFocus3())
{
return ESGHeadMountedDisplayDevice::HtcViveFocus3;
}
if (IsHtcViveXRElite())
{
return ESGHeadMountedDisplayDevice::HtcViveXRElite;
}
if (IsHtcViveFocusVision())
{
return ESGHeadMountedDisplayDevice::HtcViveFocusVision;
}
} }
return ESGHeadMountedDisplayDevice::None; return ESGHeadMountedDisplayDevice::None;
@@ -95,9 +95,14 @@ public:
*/ */
static bool IsHtcViveXRElite(); static bool IsHtcViveXRElite();
/**
* Checks whether the HMD device is HTC VIVE Focus Vision, or not.
*/
static bool IsHtcViveFocusVision();
FORCEINLINE static bool IsAHtcViveDevice() FORCEINLINE static bool IsAHtcViveDevice()
{ {
return IsHtcVivePro() || IsHtcViveFocus3() || IsHtcViveXRElite(); return IsHtcVivePro() || IsHtcViveFocus3() || IsHtcViveXRElite() || IsHtcViveFocusVision();
} }
static ESGHeadMountedDisplayDevice GetDeviceType(); static ESGHeadMountedDisplayDevice GetDeviceType();
@@ -64,17 +64,32 @@ enum class ESGHeadMountedDisplayDevice : uint8
/* The HTC VIVE XR Elite HMD. */ /* The HTC VIVE XR Elite HMD. */
HtcViveXRElite UMETA(DisplayName = "HTC VIVE XR Elite"), HtcViveXRElite UMETA(DisplayName = "HTC VIVE XR Elite"),
/* The HTC VIVE Focus 3 HMD. */
HtcViveFocusVision UMETA(DisplayName = "HTC VIVE Focus Vision"),
}; };
/* /*
* The * The HTC VIVE HMD detection priority for HTC devices that we cannot distinguish.
*/ */
UENUM(BlueprintType) UENUM(BlueprintType)
enum class ESGViveHMDDetectionPriority : uint8 enum class ESGViveHMDDetectionPriority : uint8
{ {
/* First try to detect HTC VIVE Focus 3. */ /* First try to detect HTC VIVE Focus Vision, then XR Elite, and then Focus 3. */
HtcViveFocus3First UMETA(DisplayName = "HTC VIVE Focus 3 First"), FocusVision_XRElite_Focus3 UMETA(DisplayName = "Focus Vision (1st), XR Elite (2nd), Focus3 (3rd)"),
/* First try to detect HTC VIVE XR Elite. */ /* First try to detect HTC VIVE Focus Vision, then Focus 3, and then XR Elite. */
HtcViveXREliteFirst UMETA(DisplayName = "HTC VIVE XR Elite First"), FocusVision_Focus3_XRElite UMETA(DisplayName = "Focus Vision (1st), Focus3 (2nd), XR Elite (3rd)"),
};
/* First try to detect HTC VIVE XR Elite, then Focus Vision, and then Focus 3. */
XRElite_FocusVision_Focus3 UMETA(DisplayName = "XR Elite (1st), Focus Vision (2nd), Focus3 (3rd)"),
/* First try to detect HTC VIVE XR Elite, then Focus 3, and then Focus Vision. */
XRElite_Focus3_FocusVision UMETA(DisplayName = "XR Elite (1st), Focus3 (2nd), Focus Vision (3rd)"),
/* First try to detect HTC VIVE Focus 3, then Focus Vision, and then XR Elite. */
Focus3_FocusVision_XRElite UMETA(DisplayName = "Focus3 (1st), Focus Vision (2nd), XR Elite (3rd)"),
/* First try to detect HTC VIVE Focus 3, then XR Elite, and then Focus Vision. */
Focus3_XRElite_FocusVision UMETA(DisplayName = "Focus3 (1st), XR Elite (2nd), Focus Vision (3rd)"),
};