mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 19:39:21 +00:00
Custom event classes for patched methods
Update to LeapCSharp 6.15.0
This commit is contained in:
parent
4b879d53d5
commit
85925a7072
76 changed files with 3443 additions and 2187 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue