Struct XRTrackedObject | AR Subsystems | 2.2.0-preview.6
docs.unity3d.com
    Show / Hide Table of Contents

    Struct XRTrackedObject

    Describes a tracked object detected by the XRObjectTrackingSubsystem.

    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public struct XRTrackedObject : ITrackable, IEquatable<XRTrackedObject>
    Remarks

    Tracked objects are detected based on the contents of an XRReferenceObjectLibrary which contains reference objects for which to scan. Each XRTrackedObject represents an XRReferenceObject which has been detected in the environment.

    Constructors

    XRTrackedObject(TrackableId, Pose, TrackingState, IntPtr, Guid)

    Constructs a XRTrackedObject

    Declaration
    public XRTrackedObject(TrackableId trackableId, Pose pose, TrackingState trackingState, IntPtr nativePtr, Guid referenceObjectGuid)
    Parameters
    Type Name Description
    TrackableId trackableId

    The TrackableId associated with this tracked object.

    Pose pose

    The Pose of this tracked object.

    TrackingState trackingState

    The TrackingState of the tracked object.

    IntPtr nativePtr

    A native pointer associated with this tracked object. If not null, the object pointed to by this pointer should be valid at least until the next call to .

    Guid referenceObjectGuid

    The Guid of the reference object which was used to detect this tracked object.

    Properties

    defaultTrackedObject

    A XRTrackedObject with appropriate default values.

    Declaration
    public static XRTrackedObject defaultTrackedObject { get; }
    Property Value
    Type Description
    XRTrackedObject

    nativePtr

    A native pointer associated with this tracked object.

    Declaration
    public IntPtr nativePtr { get; }
    Property Value
    Type Description
    IntPtr
    Remarks

    The lifetime of this pointer is provider-specific, but should be valid at least until the next call to (typically once per frame).

    pose

    The Pose associated with this tracked object.

    Declaration
    public Pose pose { get; }
    Property Value
    Type Description
    Pose
    Implements
    ITrackable.pose

    referenceObjectGuid

    The Guid associated with the source XRReferenceObject.

    Declaration
    public Guid referenceObjectGuid { get; }
    Property Value
    Type Description
    Guid

    trackableId

    The TrackableId associated with this tracked object.

    Declaration
    public TrackableId trackableId { get; }
    Property Value
    Type Description
    TrackableId
    Implements
    ITrackable.trackableId

    trackingState

    The TrackingState associated with this tracked object.

    Declaration
    public TrackingState trackingState { get; }
    Property Value
    Type Description
    TrackingState
    Implements
    ITrackable.trackingState

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    Equals(XRTrackedObject)

    Declaration
    public bool Equals(XRTrackedObject other)
    Parameters
    Type Name Description
    XRTrackedObject other
    Returns
    Type Description
    Boolean

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    Operators

    Equality(XRTrackedObject, XRTrackedObject)

    Declaration
    public static bool operator ==(XRTrackedObject lhs, XRTrackedObject rhs)
    Parameters
    Type Name Description
    XRTrackedObject lhs
    XRTrackedObject rhs
    Returns
    Type Description
    Boolean

    Inequality(XRTrackedObject, XRTrackedObject)

    Declaration
    public static bool operator !=(XRTrackedObject lhs, XRTrackedObject rhs)
    Parameters
    Type Name Description
    XRTrackedObject lhs
    XRTrackedObject rhs
    Returns
    Type Description
    Boolean

    See Also

    XRReferenceObject
    XRReferenceObjectLibrary
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023