Class XRHMD
Inherited Members
Namespace: UnityEngine.InputSystem.XR
Assembly: Unity.InputSystem.dll
Syntax
public class XRHMD : TrackedDevice
Properties
centerEyePosition
Declaration
public Vector3Control centerEyePosition { get; protected set; }
Property Value
Type | Description |
---|---|
Vector3Control |
centerEyeRotation
Declaration
public QuaternionControl centerEyeRotation { get; protected set; }
Property Value
Type | Description |
---|---|
QuaternionControl |
leftEyePosition
The base type of all XR head mounted displays. This can help organize shared behaviour across all HMDs.
Declaration
public Vector3Control leftEyePosition { get; protected set; }
Property Value
Type | Description |
---|---|
Vector3Control |
Remarks
To give your head tracking an extra update before rendering: First, enable before render updates on your Device.
// JSON
{
"name" : "MyHMD",
"extend" : "HMD",
"beforeRender" : "Update"
}
Then, make sure you put extra StateEvents
for your HMD on the queue right in time before rendering. Also, if your HMD is a combination of non-tracking and tracking controls, you can update just the tracking by sending a delta event instead of a full state event.
leftEyeRotation
Declaration
public QuaternionControl leftEyeRotation { get; protected set; }
Property Value
Type | Description |
---|---|
QuaternionControl |
rightEyePosition
Declaration
public Vector3Control rightEyePosition { get; protected set; }
Property Value
Type | Description |
---|---|
Vector3Control |
rightEyeRotation
Declaration
public QuaternionControl rightEyeRotation { get; protected set; }
Property Value
Type | Description |
---|---|
QuaternionControl |
Methods
FinishSetup()
Perform final initialization tasks after the control hierarchy has been put into place.
Declaration
protected override void FinishSetup()
Overrides
Remarks
This method can be overridden to perform control- or device-specific setup work. The most common use case is for looking up child controls and storing them in local getters.
public class MyDevice : InputDevice
{
public ButtonControl button { get; private set; }
public AxisControl axis { get; private set; }
protected override void OnFinishSetup()
{
// Cache controls in getters.
button = GetChildControl("button");
axis = GetChildControl("axis");
}
}</code></pre></example>