Skip to main content
Version: 20 Mar 2024

MagicLeapMarkerUnderstandingNativeBindings.cs

Source code

// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2019-2023) Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%

#if UNITY_OPENXR_1_9_0_OR_NEWER
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.XR.MagicLeap;
using UnityEngine.XR.MagicLeap.Native;
using UnityEngine.XR.OpenXR.NativeTypes;

namespace UnityEngine.XR.OpenXR.Features.MagicLeapSupport
{
public partial class MagicLeapMarkerUnderstandingFeature
{
internal partial class NativeBindings : MagicLeapNativeBindings
{
[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLCreateMarkerDetector(in MarkerDetectorSettings settings, out ulong markerDetector);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLDestroyMarkerDetector(ulong markerDetector);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLSnapshotMarkerDetector(ulong markerDetector);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLGetMarkerDetectorState(ulong markerDetector, out MarkerDetectorStatus status);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLGetMarkers(ulong markerDetector, out uint markerCountOutput, [In, Out] ulong[] markers);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLGetMarkerReprojectionError(ulong markerDetector, ulong marker, out float reprojectionErrorMeters);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLGetMarkerLength(ulong markerDetector, ulong marker, out float meters);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLGetMarkerNumber(ulong markerDetector, ulong marker, out ulong number);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLGetMarkerString(ulong markerDetector, ulong marker, uint bufferSize, [In, Out] char[] buffer);

[DllImport(MagicLeapXrProviderNativeBindings.MagicLeapXrProviderDll, CallingConvention = CallingConvention.Cdecl)]
public static extern XrResult MLCreateMarkerSpace(ulong markerDetector, ulong marker, out ulong xrSpace);
}
}
}
#endif