Update to Ultraleap Unity Plugin 6.12.1

This commit is contained in:
SDraw 2023-09-28 18:15:15 +03:00
parent 90de21cce8
commit 2828de3818
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
2 changed files with 12 additions and 0 deletions

View file

@ -263,6 +263,15 @@ namespace Leap
return devicePose; return devicePose;
} }
bool deviceTransformAvailable = LeapC.GetDeviceTransformAvailable(Handle);
if (!deviceTransformAvailable)
{
devicePose = Pose.identity;
poseSet = true;
return Pose.identity;
}
float[] data = new float[16]; float[] data = new float[16];
eLeapRS result = LeapC.GetDeviceTransform(Handle, data); eLeapRS result = LeapC.GetDeviceTransform(Handle, data);

View file

@ -1052,6 +1052,9 @@ namespace LeapInternal
[DllImport("LeapC", EntryPoint = "LeapGetDeviceInfo", CharSet = CharSet.Ansi)] [DllImport("LeapC", EntryPoint = "LeapGetDeviceInfo", CharSet = CharSet.Ansi)]
public static extern eLeapRS GetDeviceInfo(IntPtr hDevice, ref LEAP_DEVICE_INFO info); 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")] [DllImport("LeapC", EntryPoint = "LeapGetDeviceTransform")]
public static extern eLeapRS GetDeviceTransform(IntPtr hDevice, [MarshalAs(UnmanagedType.LPArray, SizeConst = 16)] float[] transform); public static extern eLeapRS GetDeviceTransform(IntPtr hDevice, [MarshalAs(UnmanagedType.LPArray, SizeConst = 16)] float[] transform);