docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRTrackedObject

    Describes a tracked object detected by the XRObjectTrackingSubsystem.

    Implements
    ITrackable
    IEquatable<XRTrackedObject>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    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 an 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 GetChanges(Allocator).

    Guid referenceObjectGuid

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

    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    Properties

    defaultValue

    A XRTrackedObject with appropriate default values.

    Declaration
    public static XRTrackedObject defaultValue { get; }
    Property Value
    Type Description
    XRTrackedObject
    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    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 GetChanges(Allocator) (typically once per frame).

    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    pose

    The Pose associated with this tracked object.

    Declaration
    public Pose pose { get; }
    Property Value
    Type Description
    Pose
    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    referenceObjectGuid

    The GUID associated with the source XRReferenceObject.

    Declaration
    public Guid referenceObjectGuid { get; }
    Property Value
    Type Description
    Guid
    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    trackableId

    The TrackableId associated with this tracked object.

    Declaration
    public TrackableId trackableId { get; }
    Property Value
    Type Description
    TrackableId
    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    trackingState

    The TrackingState associated with this tracked object.

    Declaration
    public TrackingState trackingState { get; }
    Property Value
    Type Description
    TrackingState
    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    Methods

    Equals(object)

    Tests for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare against.

    Returns
    Type Description
    bool

    True if obj is of type XRTrackedObject and Equals(XRTrackedObject) also returns true; otherwise false.

    Overrides
    ValueType.Equals(object)
    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    Equals(XRTrackedObject)

    Tests for equality.

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

    The other XRTrackedObject to compare against.

    Returns
    Type Description
    bool

    True if this object's trackableId is equal to other's, otherwise false.

    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code generated from this object's trackableId.

    Overrides
    ValueType.GetHashCode()
    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    Operators

    operator ==(XRTrackedObject, XRTrackedObject)

    Tests for equality. Same as Equals(XRTrackedObject).

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

    The left-hand side of the comparison.

    XRTrackedObject rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    True if lhs is equal to rhs, otherwise false.

    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    operator !=(XRTrackedObject, XRTrackedObject)

    Tests for inequality. Same as !Equals(XRTrackedObject).

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

    The left-hand side of the comparison.

    XRTrackedObject rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    True if lhs is not equal to rhs, otherwise false.

    See Also
    XRReferenceObject
    XRReferenceObjectLibrary

    Implements

    ITrackable
    IEquatable<T>

    See Also

    XRReferenceObject
    XRReferenceObjectLibrary
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)