Update to Ultraleap Gemini v5.12

Update to Ultraleap Unity Plugin v6.9.0
Unclamped spreads and curls
This commit is contained in:
SDraw 2023-07-04 11:54:10 +03:00
parent 965c0bf93d
commit 5c33abc9d2
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
46 changed files with 1143 additions and 2564 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************
* Copyright (C) Ultraleap, Inc. 2011-2021. *
* Copyright (C) Ultraleap, Inc. 2011-2023. *
* *
* Use subject to the terms of the Apache License 2.0 available at *
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
@ -11,7 +11,6 @@ namespace Leap
{
using System;
using System.Collections.Generic;
#pragma warning disable 0618
/// <summary>
/// The Hand class reports the physical characteristics of a detected hand.
///
@ -47,56 +46,6 @@ namespace Leap
Fingers.Add(new Finger());
}
/// <summary>
/// Constructs a hand.
///
/// Generally, you should not create your own Hand objects. Such objects will not
/// have valid tracking data. Get valid Hand objects from a frame
/// received from the service.
/// @since 3.0
/// </summary>
[System.Obsolete("This signature will be removed in the next major version of the plugin. Use the one with Vector3 and Quaternion instead.")]
public Hand(long frameID,
int id,
float confidence,
float grabStrength,
float grabAngle,
float pinchStrength,
float pinchDistance,
float palmWidth,
bool isLeft,
float timeVisible,
Arm arm,
List<Finger> fingers,
Vector palmPosition,
Vector stabilizedPalmPosition,
Vector palmVelocity,
Vector palmNormal,
LeapQuaternion palmOrientation,
Vector direction,
Vector wristPosition)
{
FrameId = frameID;
Id = id;
Confidence = confidence;
GrabStrength = grabStrength;
GrabAngle = grabAngle;
PinchStrength = pinchStrength;
PinchDistance = pinchDistance;
PalmWidth = palmWidth;
IsLeft = isLeft;
TimeVisible = timeVisible;
Arm = arm;
Fingers = fingers;
PalmPosition = palmPosition;
StabilizedPalmPosition = stabilizedPalmPosition;
PalmVelocity = palmVelocity;
PalmNormal = palmNormal;
Rotation = palmOrientation;
Direction = direction;
WristPosition = wristPosition;
}
/// <summary>
/// Constructs a hand.
///
@ -108,7 +57,6 @@ namespace Leap
int id,
float confidence,
float grabStrength,
float grabAngle,
float pinchStrength,
float pinchDistance,
float palmWidth,
@ -128,7 +76,6 @@ namespace Leap
Id = id;
Confidence = confidence;
GrabStrength = grabStrength;
GrabAngle = grabAngle;
PinchStrength = pinchStrength;
PinchDistance = pinchDistance;
PalmWidth = palmWidth;
@ -136,13 +83,13 @@ namespace Leap
TimeVisible = timeVisible;
Arm = arm;
Fingers = fingers;
PalmPosition = ToVector(palmPosition);
StabilizedPalmPosition = ToVector(stabilizedPalmPosition);
PalmVelocity = ToVector(palmVelocity);
PalmNormal = ToVector(palmNormal);
Rotation = ToLeapQuaternion(palmOrientation);
Direction = ToVector(direction);
WristPosition = ToVector(wristPosition);
PalmPosition = palmPosition;
StabilizedPalmPosition = stabilizedPalmPosition;
PalmVelocity = palmVelocity;
PalmNormal = palmNormal;
Rotation = palmOrientation;
Direction = direction;
WristPosition = wristPosition;
}
/// <summary>
@ -221,15 +168,13 @@ namespace Leap
/// The center position of the palm.
/// @since 1.0
/// </summary>
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector PalmPosition;
public Vector3 PalmPosition;
/// <summary>
/// The rate of change of the palm position.
/// @since 1.0
/// </summary>
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector PalmVelocity;
public Vector3 PalmVelocity;
/// <summary>
/// The normal vector to the palm. If your hand is flat, this vector will
@ -242,8 +187,7 @@ namespace Leap
/// respect to the horizontal plane.
/// @since 1.0
/// </summary>
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector PalmNormal;
public Vector3 PalmNormal;
/// <summary>
/// The direction from the palm position toward the fingers.
@ -255,8 +199,9 @@ namespace Leap
/// respect to the horizontal plane.
/// @since 1.0
/// </summary>
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector Direction;
public Vector3 Direction;
LeapTransform _basis = new LeapTransform(Vector3.one, Quaternion.identity);
/// <summary>
/// The transform of the hand.
@ -264,15 +209,23 @@ namespace Leap
/// Note, in version prior to 3.1, the Basis was a Matrix object.
/// @since 3.1
/// </summary>
public LeapTransform Basis { get { return new LeapTransform(PalmPosition, Rotation); } }
public LeapTransform Basis
{
get
{
_basis.translation = PalmPosition;
_basis.rotation = Rotation;
return _basis;
}
}
/// <summary>
/// The rotation of the hand as a quaternion.
///
/// @since 3.1
/// </summary>
[System.Obsolete("Its type will be changed from LeapQuaternion to UnityEngine.Quaternion")]
public LeapQuaternion Rotation;
public Quaternion Rotation;
/// <summary>
/// The strength of a grab hand pose.
@ -283,20 +236,6 @@ namespace Leap
/// </summary>
public float GrabStrength;
/// <summary>
/// The angle between the fingers and the hand of a grab hand pose.
///
/// The angle is computed by looking at the angle between the direction of the
/// 4 fingers and the direction of the hand. Thumb is not considered when
/// computing the angle.
/// The angle is 0 radian for an open hand, and reaches pi radians when the pose
/// is a tight fist.
///
/// @since 3.0
/// </summary>
[System.Obsolete("This code will be removed in the next major version of the plugin. If you believe that it needs to be kept, please open a discussion on the GitHub forum (https://github.com/ultraleap/UnityPlugin/discussions)")]
public float GrabAngle;
/// <summary>
/// The holding strength of a pinch hand pose.
///
@ -332,15 +271,13 @@ namespace Leap
/// primarily on the speed of movement.
/// @since 1.0
/// </summary>
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector StabilizedPalmPosition;
public Vector3 StabilizedPalmPosition;
/// <summary>
/// The position of the wrist of this hand.
/// @since 2.0.3
/// </summary>
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector WristPosition;
public Vector3 WristPosition;
/// <summary>
/// The duration of time this Hand has been visible to the Leap Motion Controller, in seconds
@ -376,20 +313,5 @@ namespace Leap
/// @since 2.0.3
/// </summary>
public Arm Arm;
[Obsolete("This will be removed in the next major version update")]
private Vector ToVector(Vector3 v)
{
return new Vector(v.x, v.y, v.z);
}
[Obsolete("This will be removed in the next major version update")]
private LeapQuaternion ToLeapQuaternion(Quaternion q)
{
return new LeapQuaternion(q.x, q.y, q.z, q.w);
}
}
#pragma warning restore 0618
}