Wrist as target position

This commit is contained in:
SDraw 2022-10-03 23:40:22 +03:00
parent d11bf46f1a
commit 3b998827f5
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
5 changed files with 18 additions and 30 deletions

View file

@ -82,9 +82,10 @@ namespace ml_lme
static void FillHandPosition(Leap.Hand p_hand, ref Vector3 p_pos)
{
p_pos.x = p_hand.PalmPosition.x;
p_pos.y = p_hand.PalmPosition.y;
p_pos.z = p_hand.PalmPosition.z;
// Unity's IK and FinalIK move hand bones to target, therefore - wrist
p_pos.x = p_hand.WristPosition.x;
p_pos.y = p_hand.WristPosition.y;
p_pos.z = p_hand.WristPosition.z;
}
static void FillHandRotation(Leap.Hand p_hand, ref Quaternion p_rot)
@ -127,7 +128,6 @@ namespace ml_lme
static void FilFingerSpreads(Leap.Hand p_hand, ref float[] p_spreads)
{
foreach(Leap.Finger l_finger in p_hand.Fingers)
{
float l_angle = 0f;