Class MagicLeapImageTrackingSubsystem
Inheritance
Inherited Members
Namespace: UnityEngine.XR.MagicLeap
Syntax
[Preserve]
[UsesLuminPrivilege("CameraCapture")]
public sealed class MagicLeapImageTrackingSubsystem : XRImageTrackingSubsystem
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
CreateProvider()
Declaration
protected override XRImageTrackingSubsystem.Provider CreateProvider()
Returns
Type | Description |
---|---|
XRImageTrackingSubsystem.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 |
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 |
|
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 |
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 |
Boolean | isStationary | Whether or not the target image should be treated as a stationary image in the real world. The default value is |
Returns
Type | Description |
---|---|
Boolean |
|
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).