Skip to content

IVRSystem_Overview

Dario Laverde edited this page Jul 31, 2018 · 15 revisions

Overview

The vr::IVRSystem interface provides access to display configuration information, tracking data, distortion functions, controller state, events, and device properties. It is the main interface of OpenVR and can be initialized and retrieved with the openvr::VR_Init function.

Many functions in IVRSystem use a tracked device index to identify a specific device attached to the computer. This value is defined as follows:

typedef uint32_t TrackedDeviceIndex_t;
static const uint32_t k_unTrackedDeviceIndexInvalid = 0xFFFFFFFF;
static const uint32_t k_unMaxTrackedDeviceCount = 64;
static const uint32_t k_unTrackedDeviceIndex_Hmd = 0;

There will never be more than k_unMaxTrackedDeviceCount devices active in the system at any given time. Their indices will be 0 (for the HMD) and 1-15 for the other devices.

Each tracked device has a class that is one of:

  • TrackedDeviceClass_Invalid - There is no device at this index
  • TrackedDeviceClass_HMD - The device at this index is an HMD
  • TrackedDeviceClass_Controller - The device is a controller
  • TrackedDeviceClass_GenericTracker - The device is a tracker
  • TrackedDeviceClass_TrackingReference - The device is a camera, Lighthouse base station, or other device that supplies tracking ground truth.
  • TrackedDeviceClass_DisplayRedirect - Accessories that aren't necessarily tracked themselves, but may redirect video output from other tracked devices

Interface Functions

The vr::IVRSystem interface contains the following functions:

Clone this wiki locally