Example #1
0
    public static IEnumerator HoldKey(KeyCode key)
    {
        InputBroker.SetKeyDown(key);
        yield return(new WaitForEndOfFrame());

        InputBroker.SetKey(key);
    }
 void Update()
 {
     StateMutex.WaitOne();
     if (Bodies_ != null && BodyAdjustments_ != null)
     {
         foreach (System.Collections.Generic.KeyValuePair <string, Body_> kv in Bodies_)
         {
             bool adjustmentMade = false;
             foreach (System.Collections.Generic.KeyValuePair <string, Body_> adjustment in BodyAdjustments_)
             {
                 if (kv.Key == adjustment.Key)
                 {
                     InputBroker.SetPosition(kv.Key, new Vector3(
                                                 kv.Value.translation.x + adjustment.Value.translation.x,
                                                 kv.Value.translation.y + adjustment.Value.translation.y,
                                                 kv.Value.translation.z + adjustment.Value.translation.z));
                     Quaternion q = new Quaternion(kv.Value.quaternion.x, kv.Value.quaternion.y, kv.Value.quaternion.z, kv.Value.quaternion.w) *
                                    Quaternion.Euler(adjustment.Value.euler.p, adjustment.Value.euler.h, adjustment.Value.euler.r);
                     InputBroker.SetRotation(kv.Key, q);
                     adjustmentMade = true;
                 }
                 if (!adjustmentMade)
                 {
                     InputBroker.SetPosition(kv.Key, new Vector3(kv.Value.translation.x, kv.Value.translation.y, kv.Value.translation.z));
                     Quaternion q = new Quaternion(kv.Value.quaternion.x, kv.Value.quaternion.y, kv.Value.quaternion.z, kv.Value.quaternion.w);
                     InputBroker.SetRotation(kv.Key, q);
                 }
             }
         }
     }
     StateMutex.ReleaseMutex();
 }
Example #3
0
    public static IEnumerator ReleaseKey(KeyCode key)
    {
        InputBroker.SetKeyUp(key);
        yield return(new WaitForEndOfFrame());

        InputBroker.DeleteKey(key);
    }
Example #4
0
 public void Update()
 {
     if (InputBroker != null)
     {
         InputBroker.Update();
     }
 }
    public override void DefineControlLevel()
    {
        State textSlide  = new State("TextSlide");
        State blankSlide = new State("BlankSlide");

        AddActiveStates(new List <State> {
            textSlide, blankSlide
        });

        this.AddInitializationMethod(() => {
            panelObj.SetActive(true);
        });

        //display text
        textSlide.AddStateInitializationMethod(() =>
        {
            textObj.SetActive(true);
            textObj.GetComponent <Text>().text = slideText[slideCount] + defaultEndText;
            slideCount++;
        });
        textSlide.SpecifyTermination(() => InputBroker.GetKeyDown(defaultKey), blankSlide, () => textObj.SetActive(false));

        //blank slide to make slide change more obvious
        blankSlide.AddTimer(blankDur, textSlide, () => panelObj.SetActive(true));
        blankSlide.SpecifyTermination(() => slideCount == slideText.Length, null, () => panelObj.SetActive(false));
    }
Example #6
0
    // Update is called once per frame
    void Update()
    {
        // Check if no object is being collided and if no object is grabbed
        if (collidedObject == null && grabbedObject == null)
        {
            // If A and B are pressed, treat the virtual hand as a fist by turning off the collider's trigger
            if (InputBroker.GetKeyDown(WiimoteName + ":A") && InputBroker.GetKeyDown(WiimoteName + ":B"))
            {
                collider.isTrigger = false;
            }
            // Otherwise, ensure the collider is treated as a trigger
            else
            {
                collider.isTrigger = true;
            }
        }

        // Check if an object is being collided (but no object is grabbed yet)
        else if (collidedObject != null && grabbedObject == null)
        {
            // If A and B are pressed, grab the object, turn off its physics, and add it to the virtual hand's empty parent
            if (InputBroker.GetKeyDown(WiimoteName + ":A") && InputBroker.GetKeyDown(WiimoteName + ":B"))
            {
                // Turn off physics by turning on kinematics
                grabbedObject = collidedObject;
                grabbedObject.rigidbody.isKinematic = true;

                // Find the root of the grabbed object (for hierarchical objects)
                rootObject = grabbedObject.transform;
                while (rootObject.transform.parent != null)
                {
                    rootObject = rootObject.transform.parent;
                }

                // Move the root of the grabbed object under the virtual hand's parent
                rootObject.parent = transform.parent;

                // Determine the root's initial position and rotation relative to the virtual hand's parent
                grabbedPosition = rootObject.localPosition;
                grabbedRotation = rootObject.localRotation;
            }
        }

        // Check if an object is grabbed
        else if (grabbedObject != null)
        {
            // Update the root's position and rotation relative to the virtual hand's parent
            rootObject.localPosition = grabbedPosition;
            rootObject.localRotation = grabbedRotation;

            // If A and B are NOT pressed, turn the object's physics back on and release it
            if (!InputBroker.GetKeyDown(WiimoteName + ":A") || !InputBroker.GetKeyDown(WiimoteName + ":B"))
            {
                grabbedObject.rigidbody.isKinematic = false;
                rootObject.parent = null;
                grabbedObject     = null;
            }
        }
    }
Example #7
0
    void PressButton()
    {
        string interact = "Interact" + GetComponentInParent <PlayerPlatformerController> ().playerNum;

        InputBroker.SetButtonDown(interact);

        //Jump
        GetComponentInParent <PlayerPlatformerController> ().Jump();
    }
Example #8
0
    // Update is called once per frame
    void Update()
    {
        // Up button moves forwards relative to the object's transformation
        if (InputBroker.GetKeyDown(WiimoteName + ":Up"))
        {
            CommonVariables.mappedPosition += transform.forward * TravelSpeed * Time.deltaTime;
        }

        // Down button moves backwards relative to the object's transformation
        if (InputBroker.GetKeyDown(WiimoteName + ":Down"))
        {
            CommonVariables.mappedPosition -= transform.forward * TravelSpeed * Time.deltaTime;
        }

        // Left button rotates the virtual world left (heading only)
        if (InputBroker.GetKeyDown(WiimoteName + ":Left"))
        {
            CommonVariables.mappedRotation.y -= RotationSpeed * Time.deltaTime;
        }

        // Right button rotates the virtual world right (heading only)
        if (InputBroker.GetKeyDown(WiimoteName + ":Right"))
        {
            CommonVariables.mappedRotation.y += RotationSpeed * Time.deltaTime;
        }

        // 1 button increases the travel speed
        if (InputBroker.GetKeyDown(WiimoteName + ":One"))
        {
            // Check for a click (not a continued press)
            if (!OneDown)
            {
                TravelSpeed *= 2.0f;
            }
            OneDown = true;
        }
        else
        {
            OneDown = false;
        }

        // 2 button decreases the travel speed
        if (InputBroker.GetKeyDown(WiimoteName + ":Two"))
        {
            // Check for a click (not a continued press)
            if (!TwoDown)
            {
                TravelSpeed /= 2.0f;
            }
            TwoDown = true;
        }
        else
        {
            TwoDown = false;
        }
    }
Example #9
0
    // Update is called once per frame
    public void Update()
    {
        if (InputBroker != null)
        {
            InputBroker.Update();

            Acceleration  = InputBroker.Acceleration;
            Steering      = InputBroker.Steering;
            fired_powers_ = InputBroker.FiredPowerUps;
        }
    }
    // Each physics step..
    void FixedUpdate()
    {
        // Set some local float variables equal to the value of our Horizontal and Vertical Inputs
        float moveHorizontal = InputBroker.GetAxis("Horizontal");
        float moveVertical   = InputBroker.GetAxis("Vertical");

        // Create a Vector3 variable, and assign X and Z to feature our horizontal and vertical float variables above
        Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);

        // Add a physical force to our Player rigidbody using our 'movement' Vector3 above,
        // multiplying it by 'speed' - our public player speed that appears in the inspector
        rb.AddForce(movement * speed);
    }
Example #11
0
 private void parsekeys(string name, ButtonState buttons)
 {
     InputBroker.SetKey(name + ":B", buttons.B);
     InputBroker.SetKey(name + ":A", buttons.A);
     InputBroker.SetKey(name + ":Up", buttons.Up);
     InputBroker.SetKey(name + ":Left", buttons.Left);
     InputBroker.SetKey(name + ":Down", buttons.Down);
     InputBroker.SetKey(name + ":Right", buttons.Right);
     InputBroker.SetKey(name + ":Minus", buttons.Minus);
     InputBroker.SetKey(name + ":Home", buttons.Home);
     InputBroker.SetKey(name + ":Plus", buttons.Plus);
     InputBroker.SetKey(name + ":One", buttons.One);
     InputBroker.SetKey(name + ":Two", buttons.Two);
 }
Example #12
0
    // Update is called once per frame5
    void Update()
    {
        // Minus button decreases the IPD
        if (InputBroker.GetKeyDown(WiimoteName + ":Minus"))
        {
            CommonVariables.dynamicIPD -= RateOfChange * Time.deltaTime;
        }

        // Plus button increases the IPD
        if (InputBroker.GetKeyDown(WiimoteName + ":Plus"))
        {
            CommonVariables.dynamicIPD += RateOfChange * Time.deltaTime;
        }
    }
Example #13
0
    void Start()
    {
        var controller = GetComponent <SteamVR_TrackedController> ();

        if (controller != null)
        {
            controller.PadClicked += HandlePadPress;
        }
        else
        {
            print("Controller not found on " + this.gameObject.name);
        }
        input = (InputBroker)FindObjectOfType(typeof(InputBroker));
    }
Example #14
0
    public static IEnumerator ClickMouseButton(int button)
    {
        InputBroker.SetMouseButtonDown(button);
        yield return(new WaitForEndOfFrame());

        InputBroker.SetMouseButton(button);
        yield return(new WaitForEndOfFrame());

        yield return(new WaitForEndOfFrame());

        InputBroker.SetMouseButtonUp(button);
        yield return(new WaitForEndOfFrame());

        InputBroker.DeleteMouseButton(button);
    }
Example #15
0
    protected void OnEnable()
    {
        var wb = GameObject.Find("WhiteBoardWithDisplay");

        if (wb != null)
        {
            whiteboardText = wb.GetComponent <ShowText>();
            whiteboardText.Hide();
            whiteboardImage = wb.GetComponent <ShowImage>();
            whiteboardImage.Hide();
        }
        input   = FindObjectOfType <InputBroker>();
        subject = FindObjectOfType <SubjectDataHolder>();
        subject.LoadSubjectData();
        salienceController.ResetRunningAverage();
    }
    void FixedUpdate()
    {
        if (sinceLastDecision > decisionCadence)
        {
            bool horizontalChange = Random.Range(0.0f, 1.0f) > stateChangeProbability;
            if (horizontalChange)
            {
                if (!InputBroker.HorizontalPressed())
                {
                    InputBroker.setHorizontal(Random.Range(-1.0f, 1.0f));
                }
                else
                {
                    InputBroker.setHorizontal(0.0f);
                }
            }
            bool verticalChange = Random.Range(0.0f, 1.0f) > stateChangeProbability;
            if (verticalChange)
            {
                if (!InputBroker.VerticalPressed())
                {
                    InputBroker.setVertical(Random.Range(-1.0f, 1.0f));
                }
                else
                {
                    InputBroker.setVertical(0.0f);
                }
            }
            sinceLastDecision = 0.0f;
        }

        if (horizontalPressDuration > maxPressDuration)
        {
            InputBroker.setHorizontal(0.0f);
            sinceLastDecision = 0.0f;
        }
        if (verticalPressDuration > maxPressDuration)
        {
            InputBroker.setVertical(0.0f);
            sinceLastDecision = 0.0f;
        }
    }
 void Update()
 {
     sinceLastDecision += Time.deltaTime;
     if (InputBroker.HorizontalPressed())
     {
         horizontalPressDuration += Time.deltaTime;
     }
     else
     {
         horizontalPressDuration = 0;
     }
     if (InputBroker.VerticalPressed())
     {
         verticalPressDuration += Time.deltaTime;
     }
     else
     {
         verticalPressDuration = 0;
     }
 }
Example #18
0
    void MakeRotation()
    {
        Vector3 current = InputBroker.GetPosition(LeftWiimote);

        float xChange = current.x - leftPosition.x;
        float yChange = current.y - leftPosition.y;
        float zChange = current.z - leftPosition.z;

        foreach (GameObject obj in SelectObjLst)
        {
            if (xChange > 0)           //may be work??
            {
                obj.transform.RotateAround(obj.transform.position, obj.transform.forward, -10);
            }
            else if (xChange < 0)           //may be work??
            {
                obj.transform.RotateAround(obj.transform.position, obj.transform.forward, 10);
            }

            if (yChange > 0)
            {
                obj.transform.RotateAround(obj.transform.position, obj.transform.up, -10);
            }
            else if (yChange < 0)
            {
                obj.transform.RotateAround(obj.transform.position, obj.transform.up, 10);
            }

            if (zChange > 0)
            {
                obj.transform.RotateAround(obj.transform.position, obj.transform.right, 10);
            }
            else if (zChange < 0)
            {
                obj.transform.RotateAround(obj.transform.position, obj.transform.right, -10);
            }
        }

        leftPosition = current;
    }
Example #19
0
    void Start()
    {
        //Create our line, we set its points to zero because we are only initializing it.

        GameObject go = new GameObject();

        go.name = "MyLineRenderer";
        myLine  = go.AddComponent("LineRenderer") as LineRenderer;
        //Set the number of points
        myLine.SetVertexCount(2);
        //Use world space
        myLine.useWorldSpace = true;
        //Sets the positions of the first two points
        myLine.SetPosition(0, Vector3.zero);
        myLine.SetPosition(1, Vector3.zero);

        //isSelect = true;
        SelectObjLst = new ArrayList();
        taglist      = new ArrayList();
        leftPosition = InputBroker.GetPosition(LeftWiimote);
        //leftRotation = InputBroker.GetRotation(LeftWiimote);
    }
Example #20
0
    //-------------------
    //DIFFERENT METHODS
    //-------------------

    IEnumerator PressButton()
    {
        float timer = 3f;

        //Get winner
        while (winner == null)
        {
            if (InputBroker.GetButtonDown("Interact1"))
            {
                winner = GameControl.instance.players [0];
            }
            else if (InputBroker.GetButtonDown("Interact2"))
            {
                winner = GameControl.instance.players [1];
            }
            else if (InputBroker.GetButtonDown("Interact3"))
            {
                winner = GameControl.instance.players [2];
            }
            else if (InputBroker.GetButtonDown("Interact4"))
            {
                winner = GameControl.instance.players [3];
            }

            //Subtract from the timer
            timer -= Time.unscaledDeltaTime;

            //If the time has run down, nobody has won
            if (timer <= 0)
            {
                break;
            }

            yield return(null);
        }
    }
Example #21
0
    // Update is called once per frame
    void Update()
    {
        // Check if no object is being collided and if no object is grabbed
        if (collidedObject == null && grabbedObject == null)
        {
            // If A and B are pressed, treat the virtual hand as a fist by turning off the collider's trigger
            if (InputBroker.GetKeyDown(WiimoteName + ":A") && InputBroker.GetKeyDown(WiimoteName + ":B"))
            {
                collider.isTrigger = false;
            }
            // Otherwise, ensure the collider is treated as a trigger
            else
            {
                collider.isTrigger = true;
            }
        }

        // Check if an object is being collided (but no object is grabbed yet)
        else if (collidedObject != null && grabbedObject == null)
        {
            // If A and B are pressed, grab the object, turn off its physics, and add it to the virtual hand's empty parent
            if (InputBroker.GetKeyDown(WiimoteName + ":A") && InputBroker.GetKeyDown(WiimoteName + ":B"))
            {
                // Turn off physics by turning on kinematics
                grabbedObject = collidedObject;
                grabbedObject.rigidbody.isKinematic = true;

                // Find the root of the grabbed object (for hierarchical objects)
                rootObject = grabbedObject.transform;
                while (rootObject.transform.parent != null)
                {
                    rootObject = rootObject.transform.parent;
                }

                // Move the root of the grabbed object under the virtual hand's parent
                rootObject.parent = transform.parent;

                // Determine the root's initial position and rotation relative to the virtual hand's parent
                grabbedPosition = rootObject.localPosition;
                grabbedRotation = rootObject.localRotation;
            }
        }

        // Check if an object is grabbed
        else if (grabbedObject != null)
        {
            // Update the root's position and rotation relative to the virtual hand's parent
            rootObject.localPosition = grabbedPosition;
            rootObject.localRotation = grabbedRotation;

            // If A and B are NOT pressed, turn the object's physics back on and release it
            if (!InputBroker.GetKeyDown(WiimoteName + ":A") || !InputBroker.GetKeyDown(WiimoteName + ":B"))
            {
                grabbedObject.rigidbody.isKinematic = false;
                rootObject.parent = null;
                grabbedObject     = null;
            }
        }

        //detect if we have passed the go-go threshold
        GameObject hmdObject  = GameObject.Find("HMD");
        GameObject handObject = GameObject.Find("RightWiimote");         //phyical hand

        Vector3 hmdPosition  = hmdObject.transform.localPosition;
        Vector3 handPosition = handObject.transform.localPosition;
        Vector3 handheadDiff = new Vector3(0.0f, 0.0f, 0.0f);

        //handheadDiff.x = handPosition.x - hmdPosition.x;
        handheadDiff.z = handPosition.z - hmdPosition.z;
        Debug.Log("position " + this.transform.localPosition);
        float factor = 2.0f;

        if (handheadDiff.magnitude > threshold)
        {
            float magCalc = handheadDiff.magnitude;
            magCalc *= factor;


            if (InputBroker.GetKeyDown(WiimoteName + ":Plus"))
            {
                magCalc = magCalc * magCalc * magCalc * magCalc * magCalc;
                Debug.Log("Plus ");
                magCalc /= factor * factor * factor * factor * factor;
            }

            else if (InputBroker.GetKeyDown(WiimoteName + ":Minus"))
            {
                magCalc = magCalc * magCalc;
                Debug.Log("Minus");
                magCalc /= factor * factor;
            }

            else
            {
                magCalc = magCalc * magCalc * magCalc * magCalc;
                Debug.Log("Normal");
                magCalc /= factor * factor * factor * factor;
            }

            this.transform.localPosition          = handheadDiff.normalized * magCalc;
            grabbedObject.transform.localPosition = handheadDiff.normalized * magCalc;

            Debug.Log("position after threshold " + handheadDiff);
        }
        else
        {
            this.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
            Debug.Log("position below threshold " + this.transform.localPosition);
        }
    }
Example #22
0
 void Start()
 {
     recording = false;
     response  = new List <Response> ();
     input     = FindObjectOfType <InputBroker>();
 }
Example #23
0
 // Update is called once per frame
 void Update()
 {
     // Set rotation and position of object to match Vicon tracker
     transform.localRotation = InputBroker.GetRotation(ViconName);
     transform.localPosition = InputBroker.GetPosition(ViconName);
 }
Example #24
0
 private void parseaccel(string name, AccelState accel)
 {
     InputBroker.SetAxis(name + ":X", accel.Values.X);
     InputBroker.SetAxis(name + ":Y", accel.Values.Y);
     InputBroker.SetAxis(name + ":Z", accel.Values.Z);
 }
Example #25
0
    // Update is called once per frame
    void Update()
    {
        GameObject car = GameObject.Find("carbox");

        car.transform.Translate(forward * Time.deltaTime * speed);
        car.transform.Rotate(up * Time.deltaTime * rotation);
        Debug.Log(forward);


        //Wii control
        if (InputBroker.GetKeyDown(RightWiimoteName + ":A"))
        {
            speed += 0.05f;
            Debug.Log(speed);
        }
        if (InputBroker.GetKeyDown(RightWiimoteName + ":B"))
        {
            if (speed >= 0.5)
            {
                speed -= 0.5f;
            }
            if (speed > 0 && speed < 0.5)
            {
                speed = 0;
            }
            Debug.Log(speed);
        }

        if (InputBroker.GetKeyDown(LeftWiimoteName + ":A"))
        {
            rotation = 30f;
            Debug.Log("Test");
        }
        if (InputBroker.GetKeyDown(LeftWiimoteName + ":B"))
        {
            rotation = -30f;
        }

        if (!InputBroker.GetKeyDown(LeftWiimoteName + ":A") & !InputBroker.GetKeyDown(LeftWiimoteName + ":B"))
        {
            rotation = 0f;
        }


        // Keyboard control
        if (Input.GetKey(KeyCode.W))
        {
            speed += 0.05f;
            Debug.Log(speed);
        }

        if (!Input.GetKey(KeyCode.W))
        {
            if (speed >= 0.5)
            {
                speed -= 0.08f;
            }
            if (speed > 0 && speed < 0.5)
            {
                speed = 0;
            }
            Debug.Log(speed);
        }
        if (Input.GetKey(KeyCode.S))
        {
            if (speed >= 0.5)
            {
                speed -= 0.5f;
            }
            if (speed > 0 && speed < 0.5)
            {
                speed = 0;
            }
            Debug.Log(speed);
        }
        if (Input.GetKey(KeyCode.A))
        {
            rotation = -30f;
        }
        if (Input.GetKey(KeyCode.D))
        {
            rotation = 30f;
        }
        if (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.D))
        {
            rotation = 0f;
        }
    }
Example #26
0
    void ReleaseButton()
    {
        string interact = "Interact" + GetComponentInParent <PlayerPlatformerController> ().playerNum;

        InputBroker.RemoveButtonDown(interact);
    }
Example #27
0
    // Update is called once per frame
    void Update()
    {
        //virtual world
        Vector3    origin    = transform.position + (transform.forward * 0.3f);
        Vector3    direction = transform.forward;
        RaycastHit hit;


        if (Physics.Raycast(origin, direction, out hit))
        {
            Debug.Log("we hit something  " + hit.collider.gameObject.name);
            //Debug.DrawLine(origin, hit.point,Color.red);
            myLine.SetPosition(0, origin);
            myLine.SetPosition(1, hit.point);
            myLine.SetColors(Color.red, Color.red);
            myLine.SetWidth(0.01f, 0.01f);
            if (InputBroker.GetKeyDown(RightWiimote + ":A"))
            {
                hit.collider.gameObject.tag = "Player";
                taglist.Add(hit.collider.gameObject);
            }
            if (InputBroker.GetKeyDown(RightWiimote + ":Up"))
            {
                if (hit.collider.gameObject.tag == "Player")
                {
                    hit.collider.gameObject.layer = 2;
                }
            }
            if (InputBroker.GetKeyDown(RightWiimote + ":Down"))
            {
                if (taglist.Count != 0)
                {
                    foreach (GameObject obj in taglist)
                    {
                        obj.tag   = "Untagged";
                        obj.layer = 0;
                    }
                }
            }
            if (InputBroker.GetKeyPress(RightWiimote + ":B"))                //select
            {
                SelectObjLst.Add(hit.collider.gameObject);

                hit.collider.gameObject.renderer.material.color = Color.red;
            }
            if (InputBroker.GetKeyPress(RightWiimote + ":One"))                 //remove one
            {
                SelectObjLst.Remove(hit.collider.gameObject);
                hit.collider.gameObject.renderer.material.SetColor("_Color", Color.white);
            }

            if (InputBroker.GetKeyPress(RightWiimote + ":Two"))                 //remove all, restart
            {
                if (SelectObjLst.Count != 0)
                {
                    foreach (GameObject obj in SelectObjLst)
                    {
                        obj.renderer.material.SetColor("_Color", Color.white);
                    }
                }
                if (taglist.Count != 0)
                {
                    foreach (GameObject obj in taglist)
                    {
                        obj.tag   = "Untagged";
                        obj.layer = 0;
                    }
                }
                SelectObjLst.Clear();
                taglist.Clear();
            }
        }
        else
        {
            Debug.Log("we did not");
            myLine.SetPosition(0, origin);
            myLine.SetPosition(1, origin);
            myLine.SetColors(Color.red, Color.red);
            myLine.SetWidth(0.01f, 0.01f);
        }

        if (InputBroker.GetKeyDown(LeftWiimote + ":A"))
        {
            MakeRotation();
        }

        if (InputBroker.GetKeyDown(LeftWiimote + ":B"))
        {
            changeColor();
        }
        if (InputBroker.GetKeyDown(LeftWiimote + ":Left"))
        {
            CommonVariables.mappedRotation.y -= RotationSpeed * Time.deltaTime;
        }

        // Right button rotates the virtual world right (heading only)
        if (InputBroker.GetKeyDown(LeftWiimote + ":Right"))
        {
            CommonVariables.mappedRotation.y += RotationSpeed * Time.deltaTime;
        }
    }
    // Store InputSimulator values in InputBroker
    void UpdateInputBroker()
    {
        // Update RiftDK1's Vicon
        InputBroker.SetPosition(RiftDK1Vicon, new Vector3(RiftDK1X, RiftDK1Y, RiftDK1Z));
        Quaternion OculusRiftQuaternion = Quaternion.Euler(RiftDK1P, RiftDK1H, RiftDK1R);

        InputBroker.SetRotation(RiftDK1Vicon, OculusRiftQuaternion);

        // Update RightGlove's Vicon
        InputBroker.SetPosition(RightGloveVicon, new Vector3(RightGloveX, RightGloveY, RightGloveZ));
        Quaternion RightGloveQuaternion = Quaternion.Euler(RightGloveP, RightGloveH, RightGloveR);

        InputBroker.SetRotation(RightGloveVicon, RightGloveQuaternion);

        // Update RightWiimote's Vicon
        InputBroker.SetPosition(RightWiimoteVicon, new Vector3(RightWiimoteX, RightWiimoteY, RightWiimoteZ));
        Quaternion RightWiimoteQuaternion = Quaternion.Euler(RightWiimoteP, RightWiimoteH, RightWiimoteR);

        InputBroker.SetRotation(RightWiimoteVicon, RightWiimoteQuaternion);

        // Update RightWiimote's Buttons
        InputBroker.SetKey(RightWiimoteName + ":Up", RightWiimoteUp);
        InputBroker.SetKey(RightWiimoteName + ":Down", RightWiimoteDown);
        InputBroker.SetKey(RightWiimoteName + ":Left", RightWiimoteLeft);
        InputBroker.SetKey(RightWiimoteName + ":Right", RightWiimoteRight);
        InputBroker.SetKey(RightWiimoteName + ":A", RightWiimoteA);
        InputBroker.SetKey(RightWiimoteName + ":B", RightWiimoteB);
        InputBroker.SetKey(RightWiimoteName + ":Minus", RightWiimoteMinus);
        InputBroker.SetKey(RightWiimoteName + ":Plus", RightWiimotePlus);
        InputBroker.SetKey(RightWiimoteName + ":One", RightWiimote1);
        InputBroker.SetKey(RightWiimoteName + ":Two", RightWiimote2);

        // Update LeftGlove's Vicon
        InputBroker.SetPosition(LeftGloveVicon, new Vector3(LeftGloveX, LeftGloveY, LeftGloveZ));
        Quaternion LeftGloveQuaternion = Quaternion.Euler(LeftGloveP, LeftGloveH, LeftGloveR);

        InputBroker.SetRotation(LeftGloveVicon, LeftGloveQuaternion);

        // Update LeftWiimote's Vicon
        InputBroker.SetPosition(LeftWiimoteVicon, new Vector3(LeftWiimoteX, LeftWiimoteY, LeftWiimoteZ));
        Quaternion LeftWiimoteQuaternion = Quaternion.Euler(LeftWiimoteP, LeftWiimoteH, LeftWiimoteR);

        InputBroker.SetRotation(LeftWiimoteVicon, LeftWiimoteQuaternion);

        // Update LeftWiimote's Buttons
        InputBroker.SetKey(LeftWiimoteName + ":Up", LeftWiimoteUp);
        InputBroker.SetKey(LeftWiimoteName + ":Down", LeftWiimoteDown);
        InputBroker.SetKey(LeftWiimoteName + ":Left", LeftWiimoteLeft);
        InputBroker.SetKey(LeftWiimoteName + ":Right", LeftWiimoteRight);
        InputBroker.SetKey(LeftWiimoteName + ":A", LeftWiimoteA);
        InputBroker.SetKey(LeftWiimoteName + ":B", LeftWiimoteB);
        InputBroker.SetKey(LeftWiimoteName + ":Minus", LeftWiimoteMinus);
        InputBroker.SetKey(LeftWiimoteName + ":Plus", LeftWiimotePlus);
        InputBroker.SetKey(LeftWiimoteName + ":One", LeftWiimote1);
        InputBroker.SetKey(LeftWiimoteName + ":Two", LeftWiimote2);

        // Update RightShoe's Vicon
        InputBroker.SetPosition(RightShoeVicon, new Vector3(RightShoeX, RightShoeY, RightShoeZ));
        Quaternion RightShoeQuaternion = Quaternion.Euler(RightShoeP, RightShoeH, RightShoeR);

        InputBroker.SetRotation(RightShoeVicon, RightShoeQuaternion);

        // Update LeftShoe's Vicon
        InputBroker.SetPosition(LeftShoeVicon, new Vector3(LeftShoeX, LeftShoeY, LeftShoeZ));
        Quaternion LeftShoeQuaternion = Quaternion.Euler(LeftShoeP, LeftShoeH, LeftShoeR);

        InputBroker.SetRotation(LeftShoeVicon, LeftShoeQuaternion);
    }