Description
The Transform
property of the TrackedObject
class provides the position and rotation of the tracked object in world space. This is based on the anchor position, allowing you to determine where the object is located and how it is oriented in the virtual environment.
Usage
To access the Transform
property, ensure that the TrackedObject
is active. If the Active
property is false
, the Transform
will not update, and you may not get the current position and rotation.
Example usage:
TrackedObject trackedObject = new TrackedObject();
if (trackedObject.Active)
{
Transform currentTransform = trackedObject.Transform;
Vector3 position = currentTransform.Position;
Rotation rotation = currentTransform.Rotation;
// Use position and rotation as needed
}
Example
TrackedObject trackedObject = new TrackedObject();
if (trackedObject.Active)
{
Transform currentTransform = trackedObject.Transform;
Vector3 position = currentTransform.Position;
Rotation rotation = currentTransform.Rotation;
// Use position and rotation as needed
}