SteamVR / HTC Vive

SteamVR is supported for Head Mounted Devices and Hand Controllers.

The Vive Trackers are documented separately.

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

Prerequisites

InstantVR

SteamVR is supported in InstantVR version 3.4 and higher. Steam VR controllers are only supported in InstantVR Advanced and Edge version 3.4 and higher.

Humanoid Control

SteamVR is supported in the Humanoid Control VR, VR+ and Pro packages

Hardware

HTC Vive and Oculus Rift are supported though SteamVR.

Operating System

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

Setup

pre Unity 2017.2: Virtual Reality Supported needs to be enabled in Edit Menu->Project Settings->Player->Other Settings. OpenVR needs to be added to the Virtual Reality SDKs.

Unity 2017.2 and higher: 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:

InstantVR

SteamVR needs to be enabled in the Edit Menu->Preferences->Instant VR->SteamVR Support.

The script IVR_SteamVR needs to be added to the character GameObject with the InstantVR script.

Humanoid Control

SteamVR needs to be enabled in the Edit Menu->Preferences->Humanoid->SteamVR Support.

Disabling SteamVR Support ensures that no code related to SteamVR is included in the build.

Targets

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

Head Target

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

Hand Target

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

Vive 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.

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
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
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

InstantVR

By default, the origin position will be set at (0,0,0). This will be sufficient in most cases.

It is possible to set the origin manually though. The real world position and orientation of the origin can be set using the Tracker Position/Tracker Angles parameters in the IVR_UnityVR script.

When using the InputHandler example script, calibration is initiated when the Tab key on the keyboard is pressed or when the two Option buttons on any controller are pressed simultaneously.

Humanoid Control

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.