From 2828de38188b65b4ba2db5ef43fb787654245830 Mon Sep 17 00:00:00 2001 From: SDraw Date: Thu, 28 Sep 2023 18:15:15 +0300 Subject: [PATCH] Update to Ultraleap Unity Plugin 6.12.1 --- ml_lme/vendor/LeapCSharp/Device.cs | 9 +++++++++ ml_lme/vendor/LeapCSharp/LeapC.cs | 3 +++ 2 files changed, 12 insertions(+) diff --git a/ml_lme/vendor/LeapCSharp/Device.cs b/ml_lme/vendor/LeapCSharp/Device.cs index 6c3b5f5..3911e26 100644 --- a/ml_lme/vendor/LeapCSharp/Device.cs +++ b/ml_lme/vendor/LeapCSharp/Device.cs @@ -263,6 +263,15 @@ namespace Leap return devicePose; } + bool deviceTransformAvailable = LeapC.GetDeviceTransformAvailable(Handle); + + if (!deviceTransformAvailable) + { + devicePose = Pose.identity; + poseSet = true; + return Pose.identity; + } + float[] data = new float[16]; eLeapRS result = LeapC.GetDeviceTransform(Handle, data); diff --git a/ml_lme/vendor/LeapCSharp/LeapC.cs b/ml_lme/vendor/LeapCSharp/LeapC.cs index ccd5963..1295577 100644 --- a/ml_lme/vendor/LeapCSharp/LeapC.cs +++ b/ml_lme/vendor/LeapCSharp/LeapC.cs @@ -1052,6 +1052,9 @@ namespace LeapInternal [DllImport("LeapC", EntryPoint = "LeapGetDeviceInfo", CharSet = CharSet.Ansi)] public static extern eLeapRS GetDeviceInfo(IntPtr hDevice, ref LEAP_DEVICE_INFO info); + [DllImport("LeapC", EntryPoint = "LeapDeviceTransformAvailable")] + public static extern bool GetDeviceTransformAvailable(IntPtr hDevice); + [DllImport("LeapC", EntryPoint = "LeapGetDeviceTransform")] public static extern eLeapRS GetDeviceTransform(IntPtr hDevice, [MarshalAs(UnmanagedType.LPArray, SizeConst = 16)] float[] transform);