docs.unity3d.com
    Show / Hide Table of Contents

    Class MagicLeapImageTrackingSubsystem

    Inheritance
    Object
    MagicLeapImageTrackingSubsystem
    Namespace: UnityEngine.XR.MagicLeap
    Syntax
    public sealed class MagicLeapImageTrackingSubsystem : XRImageTrackingSubsystem

    Properties

    nativeTrackerCreationJobHandle

    The that refers to the native tracker handle creation job.

    Declaration
    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

    CreateProvider()

    Declaration
    protected override Provider CreateProvider()
    Returns
    Type Description
    Provider

    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
    Boolean

    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
    Boolean

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

    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
    Boolean 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, Boolean).

    TrySetReferenceImageStationary(XRReferenceImage, Boolean)

    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.

    Boolean 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
    Boolean

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