Transform Transform { get; set; }

book_4_sparkGenerated
code_blocksInput

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, which is typically determined by the VR system's tracking capabilities. The Transform property is virtual, allowing derived classes to override its behavior if necessary.

Usage

To access the Transform property, ensure that the TrackedObject is active by checking the Active property. If the object is active, you can retrieve its current world position and rotation using the Transform property. This is useful for synchronizing the virtual representation of the object with its real-world counterpart.

Example

// Example of accessing the Transform property of a TrackedObject

// Assume 'trackedObject' is an instance of TrackedObject
if (trackedObject.Active)
{
    Transform currentTransform = trackedObject.Transform;
    Vector3 position = currentTransform.Position;
    Rotation rotation = currentTransform.Rotation;
    
    // Use position and rotation as needed
}