OpenVR

OpenVR (SteamVR) can be used to support a wide range of HMDs, controllers and trackers.

Note: Humanoid Control does not need the SteamVR SDK installed in the project because it uses the low-level OpenVR APII.

The Vive Trackers are documented separately.

Information about the use of VRTK with Humanoid Control is found here.

Prerequisites

Humanoid Control

OpenVR is supported in the Humanoid Control VR, Plus and Pro packages

Unity

Humanoid Control v2 supports Unity 5.6 up to Unity 2019.3.

Humanoid Control v3 supports Unity 2017.4 LTS up to Unity 2019.3

Unity 2020.1 and higher are currently not supported because of the unclear situation between the new Unity XR and OpenVR.

Hardware

HTC Vive, Valve Index, Oculus Rift and Mixed Reality are supported through OpenVR .

Operating System

OpenVR is supported on Windows 10. MacOS support is available on request.

Setup

Virtual Reality Supported needs to be enabled in Edit Menu->Project Settings->Player->XR Settings. OpenVR needs to be added to the Virtual Reality SDKs.

Note: if both Oculus and SteamVR need to be supported in one build, make sure Oculus is listed higher than OpenVR in the Virtual Reality SDKs:

Humanoid Control v2.1 and earlier

In Humanoid Control v2.1 and earlier, OpenVR needs to be enabled in the Edit Menu->Preferences->Humanoid->SteamVR Support.

Humanoid Control v2.2

In Humanoid Control v2.2 and higher, three options are available:

  • Disabled: OpenVR is not supported
  • Open VR 1: legacy OpenVR support as in Humanoid Control v2.1 and earlier
  • Open VR 2: OpenVR support using action manifests and support for Skeletal Input. The action manifests are found in Assets/Humanoid/Scripts/Extensions/OpenVR/.

Humanoid Control v3

In Humanoid Control v3 and higher, OpenVR needs to be enabled in the Edit Menu->Preferences->Humanoid->SteamVR Support. Legacy OpenVR is no longer supported.

For all Humanoid Control versions: Disabling SteamVR Support ensures that no code related to SteamVR is included in the build.

Configuration

To enable body tracking with OpenVR for an avatar, SteamVR or OpenVR needs to be enabled in the Humanoid Control component.

This option will be enabled automatically when OpenVR is added to the Unity Virtual Reality SDKs.

Head Target

First Person Camera needs to be supported for the OpenVR HMD. For convenience, this option is also found on the Humanoid Control script.

The SteamVR or OpenVR HMD option is added with a reference to the Real World HMD:

Hand Target

The Steam VR Controller needs to be enabled on the Hand Targets for controller support.

Controller models are shown in the scene when Humanoid Control->Settings->Show Real Objects is enabled. These models can be moved in the scene to place the controllers to the right position relative to the hands of the avatar. A reference to these transforms is found in the Tracker Transform field.

Only when using OpenVR 2, an additional option will be available to enable the SteamVR Skeletal Input.

Controller Input

The buttons of the Steam VR controller can be accessed using the Game Controller Input. The buttons are mapped as follows:

Left Controller
Menu button controller.left.option / controller.left.button[0]
Touchpad touch controller.left.stickTouch
Touchpad press controller.left.stickButton
Touchpad movements controller.left.stickHorizontal/stickVertical
Trigger controller.left.trigger1
Grip controller.left.trigger2
Right Controller
Menu button controller.right.option / controller.right.button[0]
Touchpad touch controller.right.stickTouch
Touchpad press controller.right.stickButton
Touchpad movements controller.right.stickHorizontal/stickVertical
Trigger controller.right.trigger1
Grip controller.right.trigger2

Calibration

The tracking position and orientation can be calibrated during gameplay by calling the Calibrate() function on the HumanoidControl object. This is often implemented using the Controller Input component.