/// <summary> Fill the appropriate unity Quaternion and Vector3 arrays based on a single joing chain (finger or glove semgent) </summary> /// <param name="chain"></param> /// <param name="positions"></param> /// <param name="angles"></param> /// <param name="rotations"></param> /// <param name="lengths"></param> protected static void GetLinkVariables(ref SenseGloveCs.Kinematics.JointChain chain, ref Vector3[] positions, ref Vector3[] angles, ref Quaternion[] rotations, ref Vector3[] lengths) { int n = chain.joints.Length; positions = new Vector3[n]; angles = new Vector3[n]; rotations = new Quaternion[n]; lengths = new Vector3[n - 1]; for (int j = 0; j < n; j++) { positions[j] = SG_Util.ToUnityPosition(chain.joints[j].position); angles[j] = SG_Util.ToUnityEuler(chain.joints[j].relativeAngle); rotations[j] = SG_Util.ToUnityQuaternion(chain.joints[j].rotation); if (j < n - 1) { lengths[j] = SG_Util.ToUnityPosition(chain.lengths[j]); } } }