Beispiel #1
0
 /// <summary>
 /// Convert an array of unity positions back into an array used by the DLL
 /// </summary>
 /// <param name="pos"></param>
 /// <returns></returns>
 public static SenseGloveCs.Kinematics.Vect3D[] ToPosition(Vector3[] pos)
 {
     SenseGloveCs.Kinematics.Vect3D[] res = new SenseGloveCs.Kinematics.Vect3D[pos.Length];
     for (int f = 0; f < pos.Length; f++)
     {
         res[f] = SG_Util.ToPosition(pos[f]);
     }
     return(res);
 }
 /// <summary> Apply hand parameters to the Sense Glove internal model. </summary>
 /// <param name="jointPositions"></param>
 /// <param name="handLengths"></param>
 public void SetHandParameters(Vector3[] jointPositions, Vector3[][] handLengths)
 {
     if (this.linkedGlove != null && this.linkedGlove.IsReady() && jointPositions.Length > 4 && handLengths.Length > 4)
     {
         this.StartJointPositions = jointPositions;
         for (int f = 0; f < handLengths.Length; f++)
         {
             if (handLengths[f].Length > 2)
             {   //Set Hand Lengths
                 for (int i = 0; i < handLengths[f].Length; i++)
                 {
                     this.linkedGlove.gloveData.kinematics.fingers[f].lengths[i] = SG_Util.ToPosition(handLengths[f][i]);
                 }
             }
         }
         Debug.Log(this.name + " Applied hand Lengths to Sense Glove Internal Model");
     }
 }