docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct TrackableId

    A session-unique identifier for trackables in the real-world environment, such as planes and feature points.

    Implements
    IEquatable<TrackableId>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public struct TrackableId : IEquatable<TrackableId>
    Remarks

    Ids are generally unique to a particular session, but multiple sessions might produce identical ids for different trackables.

    A trackable id is a 128 bit number, stored as two ulongs. This makes it large enough to hold a Guid.

    Constructors

    TrackableId(string)

    Construct a trackable identifier by parsing the given identifier string.

    Declaration
    public TrackableId(string idString)
    Parameters
    Type Name Description
    string idString

    An identifier string.

    Exceptions
    Type Condition
    FormatException

    Thrown if the given identifier string cannot be parsed.

    TrackableId(ulong, ulong)

    Constructs a TrackableId from two ulongs.

    Declaration
    public TrackableId(ulong subId1, ulong subId2)
    Parameters
    Type Name Description
    ulong subId1

    The first half of the id.

    ulong subId2

    The second half of the id.

    Properties

    invalidId

    Get the invalid id.

    Declaration
    public static TrackableId invalidId { get; }
    Property Value
    Type Description
    TrackableId

    subId1

    The first half of the id.

    Declaration
    public ulong subId1 { get; set; }
    Property Value
    Type Description
    ulong

    subId2

    The second half of the id.

    Declaration
    public ulong subId2 { get; set; }
    Property Value
    Type Description
    ulong

    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 TrackableId and Equals(TrackableId) also returns true; otherwise false.

    Overrides
    ValueType.Equals(object)

    Equals(TrackableId)

    Tests for equality.

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

    The other TrackableId to compare against.

    Returns
    Type Description
    bool

    True if every field in other is equal to this TrackableId, otherwise false.

    GetHashCode()

    Generates a hash code suitable for use in a Dictionary or Set.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for participation in certain collections.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Generates a string representation of the id suitable for debugging.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of the id.

    Overrides
    ValueType.ToString()

    Operators

    operator ==(TrackableId, TrackableId)

    Tests for equality. Same as Equals(TrackableId).

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

    The left-hand side of the comparison.

    TrackableId rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    True if lhs is equal to rhs, otherwise false.

    implicit operator TrackableId(SerializableGuid)

    Convert from SerializableGuid to TrackableId using the TrackableId(ulong, ulong) constructor.

    Declaration
    public static implicit operator TrackableId(SerializableGuid serializableGuid)
    Parameters
    Type Name Description
    SerializableGuid serializableGuid

    The SerializableGuid to convert.

    Returns
    Type Description
    TrackableId

    The TrackableId.

    operator !=(TrackableId, TrackableId)

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

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

    The left-hand side of the comparison.

    TrackableId rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

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

    Implements

    IEquatable<T>
    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)