Tracker¶
The Tracker component is a device that the location and orientation can be tracked.
VIVE Wave™ XR plugin provides the Tracker feature in the XRSDK and Essence packages. (refer to Wave XR Plugin Packages).
Modify AndroidManifest.xml¶
To enable the Tracker feature, you have to add below content to your AndroidManifest.xml.
<uses-feature android:name="wave.feature.tracker" android:required="true" />
VIVE Wave™ XR plugin provides a menu item Wave > Tracker > EnableTracker to help you modify the AndroidManifest.xml.
Unity XR Tracker Interface¶
VIVE Wave™ XR plugin defines the Tracker as an Unity XR InputDevice.
You can access the tracking data through the Wave.OpenXR.InputDeviceTracker interface which is included in the XRSDK package.
Before accessing the Unity XR Tracker data, you have to enable Tracker by using the following code.
Wave.OpenXR.InputDeviceTracker.ActivateTracker(true);
Note
Please refer to Unity XR InputDevice - Tracker about the InputDeviceTracker API.
Wave Tracker Manager¶
The TrackerManager is included in the Essence package.
To use the VIVE Wave™ XR plugin Tracker feature in your scene, add the TrackerManager component from the menu item Wave > GameObject > Add Tracker Manager.
Initial Start Tracker
: Default disabled. Selects to start the Tracker component by default in runtime and will consume additional power.Use XR Device
: Default disabled. When this option is enabled, TrackerManager will retrieve the tracker pose and button data from Unity XR Tracker Interface.
Note
Please refer to Wave Tracker Interface about the TrackerManager API.
Wave Tracker Model¶
VIVE Wave™ XR plugin provides the Tracker sample and model which can be imported from Project Settings > Wave XR > Essence.
After imported, you can see the content at Assets > Wave > Essence > Tracker > Model.
To run the VIVE Wave™ XR plugin sample in VIVE Focus3, you have to enable VIVE Wave™ XR plugin from Project Settings > XR Plugin-in Management > Android tab > Wave XR.
Wave Tracker Callback¶
You can register a callback function to retrieve the information from Tracker device service in runtime.
Sample code:
using Wave.Native;
private WVR_TrackerInfoNotify m_InfoNotify;
private void Awake()
{
m_InfoNotify.callback = new WVR_TrackerInfoCallback(TrackerInfoCallback);
}
static void TrackerInfoCallback(WVR_TrackerId trackerId, IntPtr cbInfo, ref UInt64 timestamp)
{
string strValue = Marshal.PtrToStringAnsi(cbInfo);
}
public void RegisterCallback(bool on)
{
if (on)
{
Interop.WVR_RegisterTrackerInfoCallback(ref m_InfoNotify);
}
else
{
Interop.WVR_UnregisterTrackerInfoCallback();
}
}