Exemplo n.º 1
0
    //   ==============================NOT IN USE===================================
    //string convert_array()
    //{

    //}

    string consodiliate_strings()
    {
        Manus_hand_obj device0 = interpreter.get_hand(0);
        Manus_hand_obj device1 = interpreter.get_hand(1);

        try
        {
            string   stringed_array   = null;
            double[] raw_values_manus = device0.get_raw_hand().ToArray();
            //raw_values_manus += device1.get_raw_hand().ToArray();

            return(stringed_array);
        }
        catch
        {
            return("Problem with return type");
        }
        return("null");
    }
Exemplo n.º 2
0
    void Update()
    {
        if (toggle_manus.isOn)
        {
            Manus_hand_obj hand = manus_inpt.get_hand(device_type_t.GLOVE_RIGHT);   //Select glove
            double[]       hand_compression_ratios = hand.get_raw_hand().ToArray(); //Array conversion
            z1 = (float)hand_compression_ratios[6];                                 //Index
            z2 = (float)hand_compression_ratios[4];                                 //Middle
            z3 = (float)hand_compression_ratios[2];                                 //Ring
            z4 = (float)hand_compression_ratios[0];                                 //Pinky
            z5 = (float)hand_compression_ratios[8];                                 //Thumb

            //Slider Overrides
            sliders_on_gameObj[0].value = z5 * 111F - 85.0F;    //Rotate the base
            sliders_on_gameObj[1].value = z1 * 350.0F - 175.0F; //Move the second arm
            sliders_on_gameObj[2].value = z2 * 310.0F - 155.0F; //Move the first arm
            sliders_on_gameObj[3].value = z3 * 690.0F - 345.0F; //Rotate the last arm
            sliders_on_gameObj[4].value = 0;                    //???
            ///sliders_on_gameObj[5] exists but useless for now.
        }
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        Manus_hand_obj hand         = manus_interpret.get_hand(type_of_device); //Select glove
        List <Finger>  orientations = hand.get_hand();
        List <double>  raw_fings    = hand.get_raw_hand();

        //List<pose> poses_orien = orientations
        raw_list = raw_fings.ToArray();


        //Get the rotation of the quaternion and set equal
        if (enable_manus_rotation)
        {
            Vector3    temp_q = hand.get_wrist().eulerAngles;
            Quaternion q      = hand.get_wrist();
            my_wrist.transform.eulerAngles = new Vector3(temp_q.x, temp_q.z, temp_q.y);
        }

        hand_orientation = hand.get_wrist();
        ////Setting the orientation of the fingers.
        ////check_me_lol = orientations[2].get_finger_data()[2].rotation;
        ////Quaternion temp_q = orientations[0].get_finger_data()[2].rotation;
        ////Quaternion out_q = new Quaternion((float) (temp_q.x * 180 / 3.14168), (float)(temp_q.y * 180 / 3.14168), (float)(temp_q.z * 180 / 3.14168), (float)(-temp_q.w * 180 / 3.14168));
        //// Quaternion out_q = new Quaternion(0, 0, (float)(temp_q.w * 180 / 3.14168), 0);
        ////check_me = out_q;
        ////fingers_occulus[0].transform.localRotation = out_q;



        //Index Finger
        Vector3 out_vector = new Vector3(0, 0, -100F * (float)raw_fings[7]);

        fingers_occulus[1].transform.localEulerAngles = out_vector;
        out_vector = new Vector3(0, 0, -72F * (float)raw_fings[6]);
        fingers_occulus[2].transform.localEulerAngles = out_vector;

        out_vector = new Vector3(-74.875F, 106.624F, ((float)raw_fings[7] * (float)raw_fings[6] * -59.667F) + 54.667F);
        fingers_occulus[0].transform.localEulerAngles = out_vector;

        //Middle Finger
        out_vector = new Vector3(0, 0, -115F * (float)raw_fings[5]);
        fingers_occulus[4].transform.localEulerAngles = out_vector;
        out_vector = new Vector3(0, 0, -105F * (float)raw_fings[4]);
        fingers_occulus[5].transform.localEulerAngles = out_vector;

        out_vector = new Vector3(-80.399F, 18.783F, ((float)raw_fings[7] * (float)raw_fings[6] * -73.9F) + 151.9F);
        fingers_occulus[3].transform.localEulerAngles = out_vector;

        //Ring Finger
        out_vector = new Vector3(0, 0, -100F * (float)raw_fings[3]);
        fingers_occulus[7].transform.localEulerAngles = out_vector;
        out_vector = new Vector3(0, 0, -110F * (float)raw_fings[2]);
        fingers_occulus[8].transform.localEulerAngles = out_vector;

        out_vector = new Vector3(-69.153F, -21.521F, ((float)raw_fings[3] * (float)raw_fings[2] * -68.448F) - 166.516F);
        fingers_occulus[6].transform.localEulerAngles = out_vector;

        //Pinky Finger
        out_vector = new Vector3(0, 0, -90F * (float)raw_fings[1]);
        fingers_occulus[10].transform.localEulerAngles = out_vector;
        out_vector = new Vector3(0, 0, -100F * (float)raw_fings[0]);
        fingers_occulus[11].transform.localEulerAngles = out_vector;

        out_vector = new Vector3(-1.022F, -2.061F, (((float)raw_fings[1] + 0.4F) * (float)raw_fings[0] * -83.518F) + -169.447F);
        fingers_occulus[9].transform.localEulerAngles = out_vector;

        //Thumb Finger
        out_vector = new Vector3(0, 0, -60F * (float)raw_fings[9]);
        fingers_occulus[13].transform.localEulerAngles = out_vector;
        out_vector = new Vector3(0, 0, -90F * (float)raw_fings[8]);
        fingers_occulus[14].transform.localEulerAngles = out_vector;

        out_vector = new Vector3(-11.73F, 183.41F, ((float)raw_fings[9] * (float)raw_fings[8] * -39.229F) + 27.229F);
        fingers_occulus[12].transform.localEulerAngles = out_vector;
    }