Tracking Space Prefab

The Tracking Space prefab is responsible for describing the current state of the different XR nodes—head, hands, fingers, and controller buttons. It is a direct child of the XR Rig root.

TrackingSpace Class

The TrackingSpace class is the-top level component of the tracking space prefab. It can be accessed from the tracking property of the XRRig parameter when implementing the IXRRigNode interface. This allows you to implement either custom XR device input that updates the tracking space accordingly or some XR feature that reads the latest XR states. Basing your application logic on the tracking space state allows you to develop cross-platform features. Аll you need to do to support a new XR device for your existing application is to implement input handling that will update the tracking space hierarchy. You can access the following TrackingSpace class properties:

  • head—provides a TrackedDevice instance whose position is updated with the XR device head.
  • leftHand—provides access to a Hand instance corresponding to the left virtual hand.
  • rightHand—provides access to a Hand instance corresponding to the right virtual hand.

Hand Class

This class inherits from TrackedDevice allowing it to track the corresponding virtual hand position. It also provides the following properties:

  • hand—a HandInput enum value specifying whether the tracked hand is left or right.
  • pose—a TrackingHandPose instance providing hand tracking information for the fingers state.
  • controller—a Controller instance providing information on the controller button states.
  • pointer—an extended Button instance providing information about the button states of the UI interaction pointer including its precision value used for hiding or showing the XR pointer.

TrackingHandPose Class

The TrackingHandPose class provides information for the virtual hand fingers. The following API may be publicly accessed:

  • GetFinger—a method allowing you to get a specified finger state as a DigitPose instance.
  • trackingConfidence—a field specifying the latest hand tracking confidence ranging from 0 to 1. Some implementations may decide to hide the virtual hands if the tracking confidence is below a specific threshold.

DigitPose Class

The DigitPose class described the state of a finger during hand tracking. You may access the following fields:

  • open—a number value ranging from 0 to 1 indicating if the finger is opened or closed.
  • pinch—a value indicating the pinch state. The Pinch structure provides numerical values for pressure and boolean values for isPressed and isTouched.
  • trackingConfidence—a field specifying the latest hand tracking confidence for the specified finger ranging from 0 to 1.

The DigitPose class also gives you access to each of the finger bone Transforms through the following properties—carpal, bone1, bone2, bone3, tip.

Controller class

The Controller class provides information necessary for the controller interactions. You may access the following properties:

  • trigger—a property of type Button providing information for the current state of the trigger button.
  • grip—a property of type Button providing information for the current state of the grip button.
  • button1—a property of type Button providing information for the current state of button1.
  • button2—a property of type Button providing information for the current state of button2.
  • menu—a property of type Button providing information for the current state of the menu button.
  • joystick—a property of type Joystick providing information for the current state of the trigger button.
In this article
Not finding the help you need?