Esempio n. 1
0
        internal static int ManusGetData(GLOVE_HAND hand, ref GLOVE_DATA data, uint timeout = 0) {
            float[] AndroidData = Android.Call<float[]>("getData", (int)hand);
            if (AndroidData.Length != 15) return ERROR;

            data.Acceleration = new GLOVE_VECTOR(new List<float>(AndroidData).GetRange(0, 3).ToArray());
            data.Euler = new GLOVE_VECTOR(new List<float>(AndroidData).GetRange(3, 3).ToArray());
            data.Quaternion = new GLOVE_QUATERNION(new List<float>(AndroidData).GetRange(6, 4).ToArray());
            data.Fingers = new List<float>(AndroidData).GetRange(10, 5).ToArray();
            return SUCCESS;
        }
Esempio n. 2
0
 internal static extern int ManusSetHandedness(GLOVE_HAND hand, bool right_hand);
Esempio n. 3
0
 internal static extern int ManusGetSkeletal(GLOVE_HAND hand, ref GLOVE_SKELETAL model, uint timeout = 0);
Esempio n. 4
0
        /// <summary>
        /// Gets the transoform of a fingerPart.
        /// </summary>
        /// <param name="data">Glove data</param>
        /// <param name="finger">The finger you want</param>
        /// <param name="fingerPart">The fingerpart you want, for example the fingertop (Distal phalanges)</param>
        /// <param name="rootTransform">Transform of hand</param>
        /// <param name="hand">Which hand it is</param>
        /// <returns>The fingertop from the finger you want</returns>
        internal Transform GetFinger(GLOVE_DATA data, int finger, FingerPart fingerPart, ref Transform rootTransform, GLOVE_HAND hand)
        {
            int part = (int)fingerPart;

            return(FindDeepChild(rootTransform, "Finger_" + finger.ToString() + part.ToString()));
        }
Esempio n. 5
0
 internal static int ManusCalibrate(GLOVE_HAND hand, bool gyro = true, bool accel = true, bool fingers = false) {
     return Android.Call<int>("calibrate", (int)hand, gyro, accel, fingers);
 }
Esempio n. 6
0
 internal static int ManusSetHandedness(GLOVE_HAND hand, bool right_hand) {
     return Android.Call<int>("setHandedness", (int)hand, right_hand);
 }
Esempio n. 7
0
 internal static extern int ManusSetVibration(GLOVE_HAND hand, float power);
Esempio n. 8
0
 internal static extern int ManusSetHandedness(GLOVE_HAND hand, bool right_hand);
Esempio n. 9
0
 public static extern int ManusGetData(GLOVE_HAND hand, out GLOVE_DATA data, uint timeout = 0);
Esempio n. 10
0
 public static extern int ManusSetHandedness(GLOVE_HAND hand, GLOVE_HAND newHand);
Esempio n. 11
0
 public static extern int ManusGetSkeletal(GLOVE_HAND hand, out GLOVE_SKELETAL model, uint timeout = 1000);
Esempio n. 12
0
 public static extern int ManusGetData(GLOVE_HAND hand, out GLOVE_DATA data, uint timeout = 0);
Esempio n. 13
0
        /// <summary>
        /// Gets the transform of a fingertop.
        /// </summary>
        /// <param name="data">Glove data</param>
        /// <param name="finger">The finger you want</param>
        /// <param name="rootTransform">Transform of hand</param>
        /// <param name="hand">Which hand it is</param>
        /// <returns>The fingertop from the finger you want</returns>
        internal Transform GetFinger(GLOVE_DATA data, int finger, ref Transform rootTransform, GLOVE_HAND hand)
        {
            int j = 3;

            return(FindDeepChild(rootTransform, "Finger_" + finger.ToString() + j.ToString()));
        }
Esempio n. 14
0
 /// <summary>
 /// Updates a Finger in a hand model
 /// </summary>
 /// <param name="t">Root of the transform to be updated</param>
 /// <param name="finger">Finger number to be updated</param>
 /// <param name="quat">Manus Quaternion to be used</param>
 /// <param name="hand">Hand to be updates</param>
 private void GameObjectToSkeletal(ref Transform t, int finger, GLOVE_QUATERNION q, GLOVE_HAND hand)
 {
     if (null == t)
     {
         return;
     }
     t.localRotation = new Quaternion(-q.y, -q.z, q.x, q.w);
     for (int j = 0; j < 4; j++)
     {
         FindDeepChild(t, "Finger_" + finger.ToString() + j.ToString()).localRotation =
             FindDeepChild(gameObject.transform, "Finger_" + finger.ToString() + j.ToString()).localRotation;
         //Debug.Log(FindDeepChild(t, "Finger_" + finger.ToString() + j.ToString()).localRotation);
         //Debug.Log(FindDeepChild(gameObject.transform, "Finger_" + finger.ToString() + j.ToString()).localRotation);
     }
 }
Esempio n. 15
0
 internal static extern int ManusGetData(GLOVE_HAND hand, ref GLOVE_DATA data, uint timeout = 0);
Esempio n. 16
0
 internal static extern int ManusGetSkeletal(GLOVE_HAND hand, ref GLOVE_SKELETAL model, uint timeout = 0);
Esempio n. 17
0
 public static extern int ManusGetSkeletal(GLOVE_HAND hand, out GLOVE_SKELETAL model, uint timeout = 1000);
Esempio n. 18
0
 internal static extern int ManusCalibrate(GLOVE_HAND hand, bool gyro = true, bool accel = true, bool fingers = false);
Esempio n. 19
0
 public static extern int ManusSetHandedness(GLOVE_HAND hand, GLOVE_HAND newHand);
Esempio n. 20
0
 public static extern int ManusCalibrate(GLOVE_HAND hand, bool gyro = true, bool accel = true, bool fingers = false);
Esempio n. 21
0
 public static extern int ManusSetVibration(GLOVE_HAND hand, float power);
Esempio n. 22
0
 internal static int ManusSetVibration(GLOVE_HAND hand, float power) {
     return Android.Call<int>("setVibration", (int)hand, power);
 }
Esempio n. 23
0
 internal static extern int ManusGetData(GLOVE_HAND hand, ref GLOVE_DATA data, uint timeout = 0);
Esempio n. 24
0
 /// <summary>
 /// Constructor for Glove class
 /// </summary>
 /// <param name="gh">Left or right glove</param>
 public Glove(GLOVE_HAND gh)
 {
     center = Quaternion.identity;
     hand = gh;
 }
Esempio n. 25
0
 /// <summary>
 /// Constructor for Glove class
 /// </summary>
 /// <param name="gh">Left or right glove</param>
 public Glove(GLOVE_HAND gh)
 {
     hand = gh;
 }