Struct XRReferenceImage | AR Subsystems | 3.1.10
docs.unity3d.com
    Show / Hide Table of Contents

    Struct XRReferenceImage

    Represents an entry in an XRReferenceImageLibrary.

    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    [Serializable]
    public struct XRReferenceImage : IEquatable<XRReferenceImage>
    Remarks

    A reference image is an image to look for in the physical environment. The XRReferenceImage does not directly reference a Texture2D or other image data; it only stores the GUID of the Texture2D as it appears in the AssetDatabase. At build time, platform specific build steps may use the guids to look up the source textures and generate an appropriate image database. At runtime, detected images can be matched up with the source XRReferenceImage.

    Constructors

    XRReferenceImage(SerializableGuid, SerializableGuid, Nullable<Vector2>, String, Texture2D)

    Declaration
    public XRReferenceImage(SerializableGuid guid, SerializableGuid textureGuid, Vector2? size, string name, Texture2D texture)
    Parameters
    Type Name Description
    SerializableGuid guid
    SerializableGuid textureGuid
    Nullable<Vector2> size
    String name
    Texture2D texture

    Properties

    guid

    The Guid associated with this image.

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

    height

    The height of the image, in meters.

    Declaration
    public float height { get; }
    Property Value
    Type Description
    Single

    name

    A name associated with this reference image.

    Declaration
    public string name { get; }
    Property Value
    Type Description
    String

    size

    The size of the image, in meters. This can improve image detection, and may be required by some platforms.

    Declaration
    public Vector2 size { get; }
    Property Value
    Type Description
    Vector2

    specifySize

    Must be set to true for size to be used.

    Declaration
    public bool specifySize { get; }
    Property Value
    Type Description
    Boolean

    texture

    The source texture which this reference image represents. This may be null to avoid including the texture in the Player build if that is not desired. See UnityEditor.XR.ARSubsystems.XRReferenceImageLibraryExtensions.SetTexture for more details.

    Declaration
    public Texture2D texture { get; }
    Property Value
    Type Description
    Texture2D

    textureGuid

    The Guid of the source texture as it appeared in the AssetDatabase in the Editor.

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

    width

    The width of the image, in meters.

    Declaration
    public float width { get; }
    Property Value
    Type Description
    Single

    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(XRReferenceImage)

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

    GetHashCode()

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

    ToString()

    Provides a string representation suitable for debug logging.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A string representation of the reference image.

    Overrides
    ValueType.ToString()

    Operators

    Equality(XRReferenceImage, XRReferenceImage)

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

    Inequality(XRReferenceImage, XRReferenceImage)

    Declaration
    public static bool operator !=(XRReferenceImage lhs, XRReferenceImage rhs)
    Parameters
    Type Name Description
    XRReferenceImage lhs
    XRReferenceImage rhs
    Returns
    Type Description
    Boolean
    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