Example #1
0
    // Use this for initialization
    void Start()
    {
        server = this.GetComponent <TCP_Server>();
        GameObject locator = GameObject.Find("Manus_VR_Driver");

        interpreter = locator.GetComponent <Manus_interpreter>();
    }
Example #2
0
    //Initialization
    void Start()
    {
        sliders_on_gameObj = this.GetComponentsInChildren <Slider>();   //Get my components
        //manus_inpt = this.GetComponent<Manus_interpreter>();            //Get my manus API
        GameObject game_thing = GameObject.Find("Manus_VR_Driver");     //Seek global API

        manus_inpt = game_thing.GetComponent <Manus_interpreter>();
    }
Example #3
0
    device_type_t type_of_device;               //Which side is this hand on - on Manus terms


    void Start()
    {
        fingers_occulus = new GameObject[15]; //Gameobject array for each of the bones.
        string wrist_string, offset;
        string hand_side;

        //string fing_0, fing_1, fing_2, fing_3, fing_4, fing_5, fing_6, fing_7, fing_8, fing_9, fing_10, fing_11, fing_12, fing_13, fing_14; //Finger strings illeterable;
        string[] fings = new string[15];
        ///string indx_1, indx_2, indx_3, mid_1, mid_2, mid_3;
        ///string rng_1, rng_2, rng_3, pnk_1, pnk_2, pnk_3;
        ///string thm_1, thm_2, thm_3;


        //Each bone in the Occulus hand has a unique identifier that links it back to the mesh. By using this method, one can illeterate through it and assign the unique IDs

        if (is_right == true)                                  //Check if my hand is left or right and setup accordingly
        {
            hand_side       = "RightHand";
            hand_side_right = true;
            type_of_device  = device_type_t.GLOVE_RIGHT;
            wrist_string    = "RightHand/hands:r_hand_world";
            offset          = wrist_string + "/hands:b_r_hand";
            fings[0]        = offset + "/hands:b_r_index1";
            fings[1]        = fings[0] + "/hands:b_r_index2";
            fings[2]        = fings[1] + "/hands:b_r_index3";
            fings[3]        = offset + "/hands:b_r_middle1";
            fings[4]        = fings[3] + "/hands:b_r_middle2";
            fings[5]        = fings[4] + "/hands:b_r_middle3";
            fings[6]        = offset + "/hands:b_r_ring1";
            fings[7]        = fings[6] + "/hands:b_r_ring2";
            fings[8]        = fings[7] + "/hands:b_r_ring3";
            fings[9]        = offset + "/hands:b_r_pinky0/hands:b_r_pinky1";
            fings[10]       = fings[9] + "/hands:b_r_pinky2";
            fings[11]       = fings[10] + "/hands:b_r_pinky3";
            fings[12]       = offset + "/hands:b_r_thumb1";
            fings[13]       = fings[12] + "/hands:b_r_thumb2";
            fings[14]       = fings[13] + "/hands:b_r_thumb3";
        }
        else
        {
            hand_side       = "LeftHand";
            hand_side_right = false;                                    //Left hand becomes the 0th
            type_of_device  = device_type_t.GLOVE_LEFT;
            wrist_string    = "LeftHand/hands:l_hand_world";
            offset          = wrist_string + "/hands:b_l_hand";
            fings[0]        = offset + "/hands:b_l_index1";                  //index bone 1
            fings[1]        = fings[0] + "/hands:b_l_index2";                //index bone 2
            fings[2]        = fings[1] + "/hands:b_l_index3";                //index bone 3
            fings[3]        = offset + "/hands:b_l_middle1";                 //middle bone 1
            fings[4]        = fings[3] + "/hands:b_l_middle2";               //middle bone 2
            fings[5]        = fings[4] + "/hands:b_l_middle3";               //middle bone 3
            fings[6]        = offset + "/hands:b_l_ring1";                   //ring bone 1
            fings[7]        = fings[6] + "/hands:b_l_ring2";                 //ring bone 1
            fings[8]        = fings[7] + "/hands:b_l_ring3";                 //ring bone 1
            fings[9]        = offset + "/hands:b_l_pinky0/hands:b_l_pinky1"; //pinky bone 1
            fings[10]       = fings[9] + "/hands:b_l_pinky2";                //pinky bone 2
            fings[11]       = fings[10] + "/hands:b_l_pinky3";               //pinky bone 3
            fings[12]       = offset + "/hands:b_l_thumb1";                  //thumb bone 1
            fings[13]       = fings[12] + "/hands:b_l_thumb2";               //thumb bone 2
            fings[14]       = fings[13] + "/hands:b_l_thumb3";               //thumb bone 3
        }
        hand_mesh = GameObject.Find(hand_side);                              //Find that object
        my_wrist  = GameObject.Find(wrist_string);                           //and that one too.
        for (int i = 0; i < 15; i++)
        {
            fingers_occulus[i] = GameObject.Find(fings[i]);
        }
        manus_interpret = this.GetComponent <Manus_interpreter>();       //Find the API
    }
Example #4
0
    private double[] finger_array; // Temp array to collect finger array values

    // Use this for initialization
    void Start()
    {
        manus_inpt = Manus_API.GetComponent <Manus_interpreter>();
        interact   = this.GetComponent <interaction>();
    }