bool manusIsConnected(IEntity entity)
        {
            var vrGloveHand = entity.GetComponent <IF_VR_Glove_Hand>();

            HandDataManager.EnsureLoaded();
            var deviceType = vrGloveHand.Type == IF_VR_HandType.Left ? device_type_t.GLOVE_LEFT : device_type_t.GLOVE_RIGHT;

            vrGloveHand.Connected = Manus.ManusIsConnected(HandDataManager.ManusSession, deviceType);
            return(vrGloveHand.Connected);
        }
Ejemplo n.º 2
0
        //Cycles one period of update for each of the manus hands.
        void Update()
        {
            //Manus.ManusInit(out session);
            isL = Manus.ManusIsConnected(session, device_type_t.GLOVE_LEFT);
            isR = Manus.ManusIsConnected(session, device_type_t.GLOVE_RIGHT);
            add_manus_hand(ref lefth, ref leftraw, device_type_t.GLOVE_LEFT, left_arm, myProfileL);
            add_manus_hand(ref righth, ref rightraw, device_type_t.GLOVE_RIGHT, right_arm, myProfileR);

            //Finger[] f = this.hands[0].get_hand_profile_manus().ToArray();

            if (Is_right)
            {
                double[] ls = this.hands[1].get_raw_hand().ToArray();
                bat_value = this.hands[1].get_bat();
                index     = ls[0];
                middle    = ls[1];
                ring      = ls[2];
                thumb     = ls[3];
                //List<Finger> tempF = this.hands[1].get_hand();
                //List<pose> ps = tempF[my_finger_opt].get_finger_data();
                //my_quart = ps[select_option].rotation;
                my_quart   = this.hands[1].get_wrist();
                my_quart.x = (my_quart.x * 180F) / 3.14165F;
                my_quart.y = (my_quart.y * 180F) / 3.14165F;
                my_quart.z = (my_quart.z * 180F) / 3.14165F;
                my_quart.w = (my_quart.w * 180F) / 3.14165F;
                my_vec     = my_quart.eulerAngles;
            }
            else
            {
                double[] ls = this.hands[0].get_raw_hand().ToArray();
                bat_value = this.hands[0].get_bat();
                index     = ls[0];
                middle    = ls[1];
                ring      = ls[2];
                thumb     = ls[3];
                //List<Finger> tempF = this.hands[0].get_hand();
                //List<pose> ps = tempF[my_finger_opt].get_finger_data();
                //my_quart = ps[select_option].rotation;
                my_quart   = this.hands[0].get_wrist();
                my_quart.x = (my_quart.x * 180F) / 3.14165F;
                my_quart.y = (my_quart.y * 180F) / 3.14165F;
                my_quart.z = (my_quart.z * 180F) / 3.14165F;
                my_quart.w = (my_quart.w * 180F) / 3.14165F;
                my_vec     = my_quart.eulerAngles;
            }
            //Quaternion q = hands[0].get_wrist();

            // Debug.Log("Wrist data= X: " + q.x + "Y: " + q.y + "Z: " + q.z + "W: " + q.w);

            //Debug.Log(carpal_inx);
        }