Example #1
0
        // Update is called once per frame
        private void Update()
        {
            manus_hand_t leftHand;
            manus_hand_t rightHand;

            _leftRet  = Manus.ManusGetHand(session, device_type_t.GLOVE_LEFT, out leftHand);
            _rightRet = Manus.ManusGetHand(session, device_type_t.GLOVE_RIGHT, out rightHand);
            // if the retrieval of the handdata is succesfull update the local value and wether the hand is closed
            if (_leftRet == manus_ret_t.MANUS_SUCCESS)
            {
                _leftHand = leftHand;
                UpdateCloseValue(TotalAverageValue(_leftHand), device_type_t.GLOVE_LEFT);
            }

            if (_rightRet == manus_ret_t.MANUS_SUCCESS)
            {
                _rightHand = rightHand;
                UpdateCloseValue(TotalAverageValue(_rightHand), device_type_t.GLOVE_RIGHT);
            }

            if (Input.GetKeyDown(AutomaticCalibration))
            {
                Calibrate(device_type_t.GLOVE_LEFT);
                Calibrate(device_type_t.GLOVE_RIGHT);
                Debug.Log("Calibrated the hands with the Vive trackers");
            }

            ManualWristRotation();
        }
        // Use this for initialization
        public virtual void Start()
        {
            Application.runInBackground = true;
            Manus.ManusInit(out session);
            Manus.ManusSetCoordinateSystem(session, coor_up_t.COOR_Y_UP, coor_handed_t.COOR_LEFT_HANDED);

            for (int i = 0; i < 2; i++)
            {
                _handValues[i].CloseValue     = CloseValue.Open;
                _handValues[i].OnValueChanged = new ToggleEvent();
            }

            Manus.ManusGetHand(session, (device_type_t)0, out _leftHand);
            Manus.ManusGetHand(session, (device_type_t)1, out _rightHand);
        }
        // Update is called once per frame
        private void Update()
        {
            manus_hand_t leftHand;
            manus_hand_t rightHand;

            _leftRet  = Manus.ManusGetHand(session, device_type_t.GLOVE_LEFT, out leftHand);
            _rightRet = Manus.ManusGetHand(session, device_type_t.GLOVE_RIGHT, out rightHand);
            // if the retrieval of the handdata is succesfull update the local value and wether the hand is closed
            if (_leftRet == manus_ret_t.MANUS_SUCCESS)
            {
                _leftHand = leftHand;
                UpdateCloseValue(TotalAverageValue(_leftHand), device_type_t.GLOVE_LEFT);
            }

            if (_rightRet == manus_ret_t.MANUS_SUCCESS)
            {
                _rightHand = rightHand;
                UpdateCloseValue(TotalAverageValue(_rightHand), device_type_t.GLOVE_RIGHT);
            }

            ManualWristRotation();
        }
Example #4
0
        // Use this for initialization
        public virtual void Start()
        {
            Application.runInBackground = true;
            Manus.ManusInit(out session);
            Manus.ManusSetCoordinateSystem(session, coor_up_t.COOR_Y_UP, coor_handed_t.COOR_LEFT_HANDED);

            Manus.ManusSelectProfile(session, (uint)BoneFormat);

            uint amountOfProfiles = Manus.ManusGetProfileCount(session);

            if (BoneFormat == AnimationType.UE4 && amountOfProfiles == 1)
            {
                Debug.LogError("Body.json does not contain data for the " + BoneFormat.ToString() + " bone format. Replace body.json Check the documentation for more information: https://goo.gl/dfUh66");
            }

            for (int i = 0; i < 2; i++)
            {
                _handValues[i].CloseValue     = CloseValue.Open;
                _handValues[i].OnValueChanged = new ToggleEvent();
            }

            Manus.ManusGetHand(session, (device_type_t)0, out _leftHand);
            Manus.ManusGetHand(session, (device_type_t)1, out _rightHand);
        }