private float GetAngle(Leap.Hand hand) { Vector3 proximalAxis = hand.DistalAxis() * -1f; Vector3 radialAxis = hand.RadialAxis(); if (hand.IsLeft) { radialAxis *= -1f; } List <float> fingerAngles = new List <float> { Vector3.SignedAngle(proximalAxis, hand.GetIndex().Direction.ToVector3(), radialAxis), Vector3.SignedAngle(proximalAxis, hand.GetMiddle().Direction.ToVector3(), radialAxis), Vector3.SignedAngle(proximalAxis, hand.GetRing().Direction.ToVector3(), radialAxis), Vector3.SignedAngle(proximalAxis, hand.GetPinky().Direction.ToVector3(), radialAxis) }; List <float> fingerAnglesShifted = new List <float>(); foreach (float angle in fingerAngles) { float shiftedAngle = angle; if (angle < -90f) { shiftedAngle += 360f; } fingerAnglesShifted.Add(shiftedAngle); } angle = 0.25f * (fingerAnglesShifted[0] + fingerAnglesShifted[1] + fingerAnglesShifted[2] + fingerAnglesShifted[3]); return(angle); }