Wave Tracker Interface¶
Refer to Wave XR Plugin Packages about VIVE Wave™ XR plugin packages.
The Essence package provides the Wave.Essence.Tracker.TrackerManager interface to access the Tracker data.
Wave Tracker Class Reference¶
XRSDK package: Wave.OpenXR, Wave.XR.Settings
Native package: Wave.Native
Essence package: Wave.Essence.Events
Wave Tracker Public Types¶
To access the Wave Tracker, you have to import the Essence package and use the Wave.Essence.Tracker namespace.
TrackerStatus¶
public enum TrackerStatus
{
// Initial, can call Start API in this state.
NotStart = 0,
StartFailure,
// Processing, should NOT call API in this state.
Starting,
Stopping,
// Running, can call Stop API in this state.
Available,
// Do nothing.
NoSupport
}
TrackerId¶
public enum TrackerId
{
Tracker0 = WVR_TrackerId.WVR_TrackerId_0,
Tracker1 = WVR_TrackerId.WVR_TrackerId_1,
Tracker2 = WVR_TrackerId.WVR_TrackerId_2,
Tracker3 = WVR_TrackerId.WVR_TrackerId_3,
}
TrackerRole¶
public enum TrackerRole
{
Undefined = WVR_TrackerRole.WVR_TrackerRole_Undefined,
Standalone = WVR_TrackerRole.WVR_TrackerRole_Standalone,
Pair1_Right = WVR_TrackerRole.WVR_TrackerRole_Pair1_Right,
Pair1_Left = WVR_TrackerRole.WVR_TrackerRole_Pair1_Left,
}
TrackerButton¶
public enum TrackerButton
{
System = WVR_InputId.WVR_InputId_0,
Menu = WVR_InputId.WVR_InputId_Alias1_Menu,
A = WVR_InputId.WVR_InputId_Alias1_A,
B = WVR_InputId.WVR_InputId_Alias1_B,
X = WVR_InputId.WVR_InputId_Alias1_X,
Y = WVR_InputId.WVR_InputId_Alias1_Y,
Trigger = WVR_InputId.WVR_InputId_Alias1_Trigger,
}
Note
Only the Menu/A/X are supported now.
AxisType¶
public enum AxisType
{
None = WVR_AnalogType.WVR_AnalogType_None,
XY = WVR_AnalogType.WVR_AnalogType_2D,
XOnly = WVR_AnalogType.WVR_AnalogType_1D,
}
Wave Tracker Manager Public Memeber Functions¶
The TrackerManager class provides API to access the Wave Tracker data.
To use the TrackerManager, add the TrackerManager component from the menu item Wave > GameObject > Add Tracker Manager.
GetTrackerPosition¶
Retrieves a Tracker’s position if the pose is valid.
bool GetTrackerPosition(TrackerId trackerId, out Vector3 position) // Return true for valid pose.
GetTrackerRotation¶
Retrieves a Tracker’s rotation if the pose is valid.
bool GetTrackerRotation(TrackerId trackerId, out Quaternion rotation) // Return true for valid pose.
GetTrackerButtonAxisType¶
Retrieves the axis type of a Tracker’s button.
AxisType GetTrackerButtonAxisType(TrackerId trackerId, TrackerButton id)
TrackerButtonPress¶
Checks if a Tracker’s button state is changed from released to pressed.
bool TrackerButtonPress(TrackerId trackerId, TrackerButton id)
// Sample code: checks the Tracker0 button A state
if (TrackerManager.Instance != null &&
TrackerManager.Instance.TrackerButtonPress(TrackerId.Tracker0, TrackerButton.A))
{
Debug.Log("Tracker0's button A is pressed down at current frame.");
}
TrackerButtonHold¶
Checks if a Tracker’s button is pressed now.
bool TrackerButtonHold(TrackerId trackerId, TrackerButton id)
TrackerButtonRelease¶
Checks if a Tracker’s button state is changed from pressed to released.
bool TrackerButtonRelease(TrackerId trackerId, TrackerButton id)
TrackerButtonTouch¶
Checks if a Tracker’s button state is changed from released to touched.
bool TrackerButtonTouch(TrackerId trackerId, TrackerButton id)
TrackerButtonTouching¶
Checks if a Tracker’s button is touched now.
bool TrackerButtonTouching(TrackerId trackerId, TrackerButton id)
TrackerButtonUntouch¶
Checks if a Tracker’s button state is changed from touched to released.
bool TrackerButtonUntouch(TrackerId trackerId, TrackerButton id)
TrackerButtonAxis¶
Retrieves a Tracker’s button axis. Note: You can ignore the Vector2.y if the button has Axis1D only.
Vector2 TrackerButtonAxis(TrackerId trackerId, TrackerButton id)
GetTrackerBatteryLife¶
Retrieves a Tracker’s battery life in float (0~1) which 1 is for 100% and 0 is for 0%.
float GetTrackerBatteryLife(TrackerId trackerId)
GetTrackerExtData¶
Retrieves a Tracker’s extended data present as an integer array.
Int32[] GetTrackerExtData(TrackerId trackerId)
GetTrackerExtData with timestamp¶
Retrieves a Tracker’s extended data present as an integer array.
Int32[] GetTrackerExtData(TrackerId trackerId, out UInt64 timestamp)
GetTrackerDeviceName¶
Retrieves a Tracker’s device name.
bool GetTrackerDeviceName(TrackerId trackerId, out string trackerName)