docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MagicLeapImageTrackingSubsystem

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    XRImageTrackingSubsystem
    MagicLeapImageTrackingSubsystem
    Implements
    ISubsystem
    Inherited Members
    XRImageTrackingSubsystem.CreateRuntimeLibrary(XRReferenceImageLibrary)
    XRImageTrackingSubsystem.GetChanges(Allocator)
    XRImageTrackingSubsystem.imageLibrary
    XRImageTrackingSubsystem.requestedMaxNumberOfMovingImages
    XRImageTrackingSubsystem.currentMaxNumberOfMovingImages
    TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.GetChanges(Allocator)
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.subsystemDescriptor
    SubsystemWithProvider.Start()
    SubsystemWithProvider.Stop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.MagicLeap
    Assembly: UnityEngine.XR.MagicLeap.dll
    Syntax
    [Preserve]
    [UsesLuminPrivilege("CameraCapture")]
    public sealed class MagicLeapImageTrackingSubsystem : XRImageTrackingSubsystem, ISubsystem

    Properties

    nativeTrackerCreationJobHandle

    The JobHandle that refers to the native tracker handle creation job.

    Declaration
    [Obsolete("This usage is no longer supported as creation of the native Image Tracker is no longer asynchronous.")]
    public static JobHandle nativeTrackerCreationJobHandle { get; }
    Property Value
    Type Description
    JobHandle
    Remarks

    The creation of the native image tracker handle that enables image tracking on Lumin devices has an average startup time of anywhere between ~1500ms - ~6000ms depending on the state of the device and is blocking. This subsystem opts to perform this operation asynchronously because of this. Please note that if you enable the image tracker in a disabled state, you do not incur the ~1500 - ~6000 ms startup cost. As is stands, getting MagicLeapProvider.s_NativeTrackerCreationJobHandle will go away, thus making nativeTrackerCreationJobHandle irrelevant.

    Methods

    DecRefcount()

    Decrement the internal reference count to the Native Image Tracker.

    Declaration
    public static void DecRefcount()
    Remarks

    Attention: Do not use unless you plan on managing the lifetime of the Magic Leap Image Tracker.

    By utilizing the DecRefcount, you are indicating that you are releasing the reference to the Magic Leap Image Tracker - that is, you are relinquishing controlling the lifetime of the Image Tracking subsystem.

    As long as you are managing the lifetime of the image tracker yourself, you do not need to call DecRefcount

    GetAutomaticImageStationarySettingsEnforcementPolicy()

    Returns whether the subsystem is in control of the stationary settings for images.

    Declaration
    public bool GetAutomaticImageStationarySettingsEnforcementPolicy()
    Returns
    Type Description
    bool

    Returns true if the subsystem is determining the stationary setting for images currently being tracked. Returns false if the user is responsible.

    IncRefcount()

    Increment the internal reference count to the Native Image Tracker.

    Declaration
    public static void IncRefcount()
    Remarks

    Attention: Do not use unless you plan on managing the lifetime of the Magic Leap Image Tracker.

    By utilizing the IncRefcount, you are indicating that you are 'holding on' to the Magic Leap Image Tracker - that is, you are managing the clean-up of the Image tracker yourself.

    As long as you are managing the lifetime of the image tracker yourself, you do not need to call DecRefcount

    IsValid()

    Checks to see whether the native provider is valid and whether permission has been granted.

    Declaration
    public bool IsValid()
    Returns
    Type Description
    bool

    true if the native provider has been instantiated and has a valid native resource.

    Remarks

    There are a number of reasons for false. Either privileges were denied or the device experienced and internal error and was not able to create the native tracking resource. Should the latter be the case, native error logs will have more information.

    SetAutomaticImageStationarySettingsEnforcementPolicy(bool)

    Sets whether the subsystem should have ownership of the stationary setting for images based on the "maxNumberOfMovingImages".

    Declaration
    public void SetAutomaticImageStationarySettingsEnforcementPolicy(bool shouldEnforceSubsystemOwnership)
    Parameters
    Type Name Description
    bool shouldEnforceSubsystemOwnership

    If passed in true the subsystem will automatically set the stationary parameter on images based on the "maxNumberOfMovingImages". If passed in false the developer is responsible for settings the stationary parameter using TrySetReferenceImageStationary(XRReferenceImage, bool).

    TrySetReferenceImageStationary(XRReferenceImage, bool)

    Attempts to set whether the subsystem should treat the given XRReferenceImage as stationary or not.

    Declaration
    public bool TrySetReferenceImageStationary(XRReferenceImage referenceImage, bool isStationary)
    Parameters
    Type Name Description
    XRReferenceImage referenceImage

    The XRReferenceImage that should have its isStationary value changed.

    bool isStationary

    Whether or not the target image should be treated as a stationary image in the real world. The default value is false.

    Returns
    Type Description
    bool

    true if the image settings were updated successfully and false otherwise.

    Remarks

    This will implicitly transfer ownership of the stationary setting for images from the subsystem to the user. In order to give ownership back, use SetAutomaticImageStationarySettingsEnforcementPolicy(bool).

    Implements

    ISubsystem
    In This Article
    Back to top
    Copyright © 2025 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)