// Returns the direction the given bone is facing on the finger. protected Vector3 GetBoneDirection(Finger finger, int bone) { Vector3 difference = finger.JointPosition((Finger.FingerJoint)(bone + 1)).ToUnity() - finger.JointPosition((Finger.FingerJoint)(bone)).ToUnity(); difference.Normalize(); return difference; }
// Returns the center of the given bone on the finger. protected Vector3 GetBonePosition(Finger finger, int bone) { return (finger.JointPosition((Finger.FingerJoint)(bone + 1)).ToUnityScaled() + finger.JointPosition((Finger.FingerJoint)(bone)).ToUnityScaled()) * 0.5f; }