Custom event classes for patched methods

Update to LeapCSharp 6.15.0
This commit is contained in:
SDraw 2024-04-26 23:52:25 +03:00
parent 4b879d53d5
commit 85925a7072
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
76 changed files with 3443 additions and 2187 deletions

View file

@ -14,12 +14,30 @@ namespace LeapInternal
{
public static readonly float MM_TO_M = 1e-3f;
public static bool leapToUnityTransformSet = false;
private static LeapTransform leapToUnityTransform;
/**
* Provides a static LeapTransform that converts from Leap units and coordinates to Unity
*/
public static LeapTransform LeapToUnityTransform
{
get
{
if (!leapToUnityTransformSet)
{
leapToUnityTransform = new LeapTransform(Vector3.zero, Quaternion.identity, new Vector3(MM_TO_M, MM_TO_M, MM_TO_M));
leapToUnityTransform.MirrorZ();
leapToUnityTransformSet = true;
}
return leapToUnityTransform;
}
}
public static void TransformToUnityUnits(this Hand hand)
{
LeapTransform leapTransform = new LeapTransform(Vector3.zero, Quaternion.identity, new Vector3(MM_TO_M, MM_TO_M, MM_TO_M));
leapTransform.MirrorZ();
hand.Transform(leapTransform);
hand.Transform(LeapToUnityTransform);
}