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);