API reference
API reference
Select your platform
No SDKs available
No versions available

OVRTracker Class

Represents an infrared camera that tracks the position of a head-mounted display.
The OVRTracker object is stateless and provides a convenient accessor to the tracker properties. Instead of new'ing an OVRTracker, consider using the global OVRTracker accessible via OVRManager.tracker.

Properties

count : int
[Get]
Returns the number of sensors currently connected to the system.
Signature
int count
isEnabled : bool
[Get][Set]
If this is true and a sensor is available, the system will use position tracking when isPositionTracked is also true.
Signature
bool isEnabled
isPositionTracked : bool
[Get]
If true, the sensor is actively tracking the HMD's position.
Otherwise the HMD may be temporarily occluded, the system may not support position tracking, etc.
Signature
bool isPositionTracked
isPresent : bool
[Get]
If true, a sensor is attached to the system.
Signature
bool isPresent

Methods

GetFrustum ( tracker )
Gets the sensor's viewing frustum.
Signature
Frustum GetFrustum(int tracker=0)
Parameters
tracker: int  The index of the tracker.
Returns
Frustum  Returns the Frustum associated with tracker .
GetPose ( tracker )
Gets the sensor's pose, relative to the head's pose at the time of the last pose recentering.
If the HMD is not present (OVRManager.isHmdPresent), this method returns the identity pose.
Signature
OVRPose GetPose(int tracker=0)
Parameters
tracker: int  The index of the tracker.
Returns
OVRPose  The pose of the tracker in tracking space, or identity if the HMD is not present.
GetPoseValid ( tracker )
Gets whether the pose of the specified sensor is valid and is ready to be queried.
Signature
bool GetPoseValid(int tracker=0)
Parameters
tracker: int  The index of the sensor.
Returns
bool  Returns true if the pose of the specified sensor is valid; otherwise false.
GetPresent ( tracker )
Gets whether the specified sensor is currently present.
Signature
bool GetPresent(int tracker=0)
Parameters
tracker: int  The index of the sensor.
Returns
bool  Returns true if tracker is present; otherwise, false.

Inner Struct

Frustum Struct

The (symmetric) visible area in front of a sensor.
You can obtain the frustum of different trackers using OVRTracker.GetFrustum.
This example uses the global OVRTracker instance on the OVRManager to query for the sensor's frustum and then logs the sensor's visible area:
void LogFrustum()
{
    var frustum = OVRManager.tracker.GetFrustum();
    Debug.Log($"Frustum has near plane={frustum.nearZ} and far plane={frustum.farZ}");
}

Fields

farZ : float
The sensor's maximum supported distance to the HMD.
Signature
float farZ
fov : Vector2
The sensor's horizontal and vertical fields of view in degrees.
Signature
Vector2 fov
nearZ : float
The sensor's minimum supported distance to the HMD.
Signature
float nearZ