Jump to content
Happy Holidays! Limited Staff Responses: 1/20 - 1/31 ×

Detect Focus 3 vs Focus Plus in Unity Wave SDK


KevinF45
 Share

Recommended Posts

We are sometimes building for both Focus Plus and Focus 3, and would like to distinguish between the two using an API call. I don't see one off hand.

They both seem to show as "WVR Display Provider" from UnityEngine.XR.XRSettings.loadedDeviceName or "WVR HMD" from InputDevices.GetDevices() name.  

Is there an API that we can use to tell the difference?

Link to comment
Share on other sites

  • 1 month later...

Sample code by using Essence API:

 using Wave.Essence;

            var controller_r = WXRDevice.GetRoleDevice(XR_Device.Right);

           if (controller_r.TryGetFeatureValue(CommonUsages.isTracked, out bool value))

                     string rightControllerInfo = controller_r.name + " is tracked.";

 If you used the InputDevices.GetDevices, you have to check the characteristic of left/right/head devices.

 

 Sample code by using UnityEngine.XR:

                 /// <summary> Wave Head Mounted Device Characteristics </summary>

                     const InputDeviceCharacteristics kHMDCharacteristics = (

                                InputDeviceCharacteristics.HeadMounted |

                                InputDeviceCharacteristics.Camera |

                                InputDeviceCharacteristics.TrackedDevice

                     );

                     /// <summary> Wave Left Controller Characteristics </summary>

                     const InputDeviceCharacteristics kControllerLeftCharacteristics = (

                                InputDeviceCharacteristics.Left |

                                InputDeviceCharacteristics.TrackedDevice |

                                InputDeviceCharacteristics.Controller |

                                InputDeviceCharacteristics.HeldInHand

                     );

                     /// <summary> Wave Right Controller Characteristics </summary>

                     const InputDeviceCharacteristics kControllerRightCharacteristics = (

                                InputDeviceCharacteristics.Right |

                                InputDeviceCharacteristics.TrackedDevice |

                                InputDeviceCharacteristics.Controller |

                                InputDeviceCharacteristics.HeldInHand

 

                      var inputDevices = new List<UnityEngine.XR.InputDevice>();

                     InputDevices.GetDevices(inputDevices);

 

                      foreach (UnityEngine.XR.InputDevice id in inputDevices)

                                bool isRight = id.characteristics.Equals(kControllerRightCharacteristics);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...