0

I am working with Unity and the Mixed Reality Toolkit. My issue is that "HP Reverb G2" is not detected using Windows Mixed Reality, but it works if I parse with SteamVR. My goal is to detect if the headset is on my head without using SteamVR.

My current solution, which doesn't work, is as follows:

public static bool IsHMDMounted()
{
    if (headDevice == null || headDevice.isValid == false)
    {
        headDevice = InputDevices.GetDeviceAtXRNode(XRNode.Head);
    }
    if (headDevice != null)
    {
        bool presenceFeatureSupported = headDevice.TryGetFeatureValue(CommonUsages.userPresence, out bool userPresent);
        if (headDevice.isValid && presenceFeatureSupported)
        {
            return userPresent;
           
        }
        else
        {
            return false;
        }
    }
    else
    {
        return false;
    }
}
Juris
  • 407
  • 3
  • 14
Alen
  • 1
  • 1

1 Answers1

0

There is a discussion related to this issue on the Unity forums - Question - OpenXR -- Is it no longer possible to get descriptive device names? - Unity Forum.

Referring to this thread, it seems that Unity does not expose the device information provided by Open XR, but you can get this information by intercepting the API of Open XR according to the method mentioned in the thread - https://forum.unity.com/threads/openxr-is-it-no-longer-possible-to-get-descriptive-device-names.1051493/#post-8275923.