Ejemplo n.º 1
0
 // Data stream packet from Apollo
 public static void dataStreamHandler(IntPtr cbr, UInt64 session, ApolloJointData jointData)
 {
     if (newDataEvent != null)
     {
         newDataEvent(jointData, sourceList[jointData.deviceID].handedness);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Get the rotation of the given finger
        /// </summary>
        /// <param name="fingerIndex"></param>
        /// <param name="deviceType"></param>
        /// <param name="pose"></param>
        /// <returns></returns>
        public Quaternion GetFingerRotation(FingerIndex fingerIndex, device_type_t deviceType, int pose)
        {
            ApolloJointData hand = GetJointData(deviceType);

            if (!hand.IsValid)
            {
                return(Quaternion.identity);
            }

            Quaternion fingerRotation = hand.fingers[(int)fingerIndex].joints[pose].rotation;

            return(fingerRotation);
        }
Ejemplo n.º 3
0
        public void newHandData(ApolloJointData data, GloveLaterality side)
        {
            //todo clean up null check
            if (!ShouldAcceptApolloData || data.fingers == null)
            {
                return;
            }

            switch (side)
            {
            case GloveLaterality.GLOVE_LEFT:
                // store the jointData for later use
                _leftHand = data;
                break;

            case GloveLaterality.GLOVE_RIGHT:
                // store the jointData for later use
                _rightHand = data;
                break;
            }
        }