docs.unity3d.com

AR Foundation 6.0.1

Search Results for

    Show / Hide Table of Contents

    Struct XRReferenceObject

    Represents a 3D scan of a real object that can be recognized in the environment.

    Implements
    IEquatable<XRReferenceObject>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    [Serializable]
    public struct XRReferenceObject : IEquatable<XRReferenceObject>
    Remarks

    Reference objects contain a list of provider-specific entries. Each entry must have previously been generated in a format specific to its implementation of the XRObjectTrackingSubsystem.

    Constructors

    XRReferenceObject(string)

    Creates a new reference object. This is most commonly used to construct a new reference object at runtime. See Add(XRReferenceObject)

    Declaration
    public XRReferenceObject(string name)
    Parameters
    Type Name Description
    string name

    The name of the new reference object.

    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    Properties

    guid

    A GUID unique to this reference object.

    Declaration
    public Guid guid { get; }
    Property Value
    Type Description
    Guid
    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    name

    A string name for this reference object.

    Declaration
    public string name { get; }
    Property Value
    Type Description
    string
    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    Methods

    AddEntry(XRReferenceObjectEntry)

    Adds a provider-specific entry to this reference object.

    Declaration
    public void AddEntry(XRReferenceObjectEntry entry)
    Parameters
    Type Name Description
    XRReferenceObjectEntry entry

    The entry to add.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if an entry of the same type as entry has already been added.

    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

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

    Overrides
    ValueType.Equals(object)
    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    Equals(XRReferenceObject)

    Tests for equality.

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

    The other XRReferenceObject to compare against.

    Returns
    Type Description
    bool

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

    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    FindEntry(Type)

    Finds an XRReferenceObjectEntry by type.

    Declaration
    public XRReferenceObjectEntry FindEntry(Type type)
    Parameters
    Type Name Description
    Type type

    The specific type of XRReferenceObjectEntry to find.

    Returns
    Type Description
    XRReferenceObjectEntry

    The provider-specific XRReferenceObjectEntry if found, otherwise null.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if type is null.

    See Also
    FindEntry<T>()

    FindEntry<T>()

    Finds an XRReferenceObjectEntry by type.

    Declaration
    public T FindEntry<T>() where T : XRReferenceObjectEntry
    Returns
    Type Description
    T

    The provider-specific XRReferenceObjectEntry if found, otherwise null.

    Type Parameters
    Name Description
    T

    The specific type of XRReferenceObjectEntry to find.

    See Also
    FindEntry(Type)

    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 fields.

    Overrides
    ValueType.GetHashCode()
    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    Operators

    operator ==(XRReferenceObject, XRReferenceObject)

    Tests for equality. Same as Equals(XRReferenceObject).

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

    The left-hand side of the comparison.

    XRReferenceObject rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    True if lhs is equal to rhs, otherwise false.

    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    operator !=(XRReferenceObject, XRReferenceObject)

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

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

    The left-hand side of the comparison.

    XRReferenceObject rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

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

    See Also
    XRReferenceObjectLibrary
    XRReferenceObjectEntry

    Implements

    IEquatable<T>

    See Also

    XRReferenceObjectLibrary
    XRReferenceObjectEntry
    In This Article
    • Constructors
      • XRReferenceObject(string)
    • Properties
      • guid
      • name
    • Methods
      • AddEntry(XRReferenceObjectEntry)
      • Equals(object)
      • Equals(XRReferenceObject)
      • FindEntry(Type)
      • FindEntry<T>()
      • GetHashCode()
    • Operators
      • operator ==(XRReferenceObject, XRReferenceObject)
      • operator !=(XRReferenceObject, XRReferenceObject)
    • Implements
    • See Also
    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)