docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SpatialImageDatabase

    The OpenXR runtime representation of an UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary.

    Inheritance
    object
    RuntimeReferenceImageLibrary
    SpatialImageDatabase
    Implements
    IReferenceImageLibrary
    Inherited Members
    RuntimeReferenceImageLibrary.this[int]
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.OpenXR.Features.SpatialEntities
    Assembly: Unity.XR.SpatialEntities.dll
    Syntax
    public class SpatialImageDatabase : RuntimeReferenceImageLibrary, IReferenceImageLibrary
    Remarks

    Exposes the source reference images to AR Foundation, and wraps the XrSpatialImageTrackingDatabaseEXT handle the OpenXR runtime tracks them with.

    Create an instance with SpatialImageTrackingSubsystem.TryCreateRuntimeLibraryAsync, and destroy it with TryDestroyImageDatabase(SpatialImageDatabase) to release the underlying native resources.

    Properties

    count

    The number of reference images contained in this database.

    Declaration
    public override int count { get; }
    Property Value
    Type Description
    int
    Overrides
    UnityEngine.XR.ARSubsystems.RuntimeReferenceImageLibrary.count

    movingImageType

    The MovingImageType copied from the source UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary. Used as the database-wide default.

    Declaration
    public MovingImageType movingImageType { get; }
    Property Value
    Type Description
    MovingImageType

    nativeHandle

    The native XrSpatialImageTrackingDatabaseEXT handle, or 0 if this database is empty or has not been created yet.

    Declaration
    public ulong nativeHandle { get; }
    Property Value
    Type Description
    ulong

    Methods

    GetReferenceImageAt(int)

    Get the reference image at the given index.

    Declaration
    protected override XRReferenceImage GetReferenceImageAt(int index)
    Parameters
    Type Name Description
    int index

    The index of the reference image to get. AR Foundation validates that index is from 0 to less than UnityEngine.XR.ARSubsystems.RuntimeReferenceImageLibrary.count before it calls this method.

    Returns
    Type Description
    XRReferenceImage

    The reference image at index.

    Overrides
    RuntimeReferenceImageLibrary.GetReferenceImageAt(int)

    Implements

    UnityEngine.XR.ARSubsystems.IReferenceImageLibrary
    In This Article
    Back to top
    Copyright © 2026 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)