Head Mounted Display (HMD)

Head Mounted Display (HMD) provides the interface for the headset.

Configure

setupConfig returns the HMD device configure data before it’s connected. It provides the driver information to DeviceService. Check HmdDevice.Config.

@Override
public Config setupConfig() {
    Config configure = new Config();
    configure.screenOrientation = WVR.ScreenOrientation_Landscape;
    return configure;
}

Note Depending on the headset’s hardware design, different platforms support different screen orientations. The PluginKit provides four screen orientations:

  • WVR.ScreenOrientation_Landscape
  • WVR.ScreenOrientation_Portrait
  • WVR.ScreenOrientation_Reverse_Landscape
  • WVR.ScreenOrientation_Reverse_Portrait.
  • See Configure in VRDevice page to learn more about device configuration.

Proximity Sensor

If there is a proximity sensor on the headset, it needs to be enabled for it to be recognized. When the proximity sensor is covered, call triggerProximity(true). Otherwise, call triggerProximity(false).

bool IsPSensorCovered = true;
triggerProximity(IsPSensorCovered);

Note

When the user puts on the headset, it will call onResume(). When the headset is taken off, it will call onPause().

Sensor To Head

Wave defines Head as the center point between the eyes. For most HMDs, there is always a gap between the HMD Device Origin to the Head. To precisely compensate for this gap, the HMD DeviceService has to assign this vector from Device Origin to the Head.

In setupConfig, assign those values in sensorToHeadFor6Dof.

@Override
public Config setupConfig() {
    //...
    configure.sensorToHeadFor6Dof = new Vector();
    configure.sensorToHeadFor6Dof.x=-0.01f; //X<0 indicates Device Origin at the right of Head
    configure.sensorToHeadFor6Dof.y= 0.03f; //Y>0 indicates Device Origin at lower of eyes
    configure.sensorToHeadFor6Dof.z= 0.07f; //Z is normally positive.
    //...
}

The above code-block shows how to shift from Device Origin to the center of the eyes by (-1, 3, 7) cm.