Want both Vive and Oculus support in one app

Hey all…

I’m trying to find the path of least resistance in creating VR apps that support both Vive and Oculus. My needs are not all that much, just head tracking, basic controller input and teleportation.

I tried VRTK and got it up and working with Vive. However, when I hooked up my Oculus, I was not getting any controller tracking at all in either my app or their sample apps.

So, I’m looking for alternatives. I understand that SteamVR can support both Oculus and Vive. However, I read something to the effect that if you want Oculus support, you have to run the app from the Steam store? Is this true? I have no plans to post this up to any store.

It’s actually pretty easy to do with no downloadables.

For tracking specific devices, Unity has their own XRNode definitions:
UnityEngine.XR.XRNode.LeftHand
UnityEngine.XR.XRNode.Head

You then pass them into these static functions to get the position and orientation relative to the VR root position:
UnityEngine.XR.InputTracking.GetLocalPosition
UnityEngine.XR.InputTracking.GetLocalRotation

As far as input itself, you can just reference the Open VR Controllers page to find out what joystick button each of the controller types maps to:

Then you check it as you normally would with Input.GetButtonDown(“RegisteredButtonName”) and a registered input.

1 Like

Thanks KingK… I got VRTK up and working before I noticed you had replied. At some point I’d like to come back and check this out.