概述

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. vr::IVRSystem接口提供了以下访问能力:显示配置信息、控制器跟踪数据、变形方法、控制器状态、事件和设备属性。它是OpenVR主要的接口,可以被vr::VR_Init方法初始化和返回。

Many functions in IVRSystem use a tracked device index to identify a specific device attached to the computer. This value is defined as follows: 在IVRSystem中的很多方法使用被追踪的设备编号定义某个固定的设备。具体定义如下:

  1. typedef uint32_t TrackedDeviceIndex_t;
  2. static const uint32_t k_unTrackedDeviceIndexInvalid = 0xFFFFFFFF;
  3. static const uint32_t k_unMaxTrackedDeviceCount = 16;
  4. 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. 在任意特定时间,不会有超过k_unMaxTrackedDeviceCount个数的设备同时出现在系统里.默认0号设备为头显,1-15号为其它设备编号.

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_TrackingReference - 此设备是摄像头、光塔或其它提供追踪实况的设备。The device is a camera, Lighthouse base station, or other device that supplies tracking ground truth.

接口方法Interface Functions

The vr::IVRSystem interface contains the following functions: vr::IVRSystem接口共包含以下方法: