Пример #1
0
        protected void SetControllerInput(ControllerSide controllerSide)
        {
            controllerSide.stickHorizontal += mixedRealityController.touchPad.x + mixedRealityController.joystick.x;
            controllerSide.stickVertical   += mixedRealityController.touchPad.y + mixedRealityController.joystick.y;
            controllerSide.stickButton     |= (mixedRealityController.touchPad.z > 0.5F || mixedRealityController.joystick.z > 0.5F);

            controllerSide.buttons[0] |= mixedRealityController.menuButton > 0.5F;

            controllerSide.trigger1 = mixedRealityController.trigger;
            controllerSide.trigger2 = mixedRealityController.gripButton;

            controllerSide.option |= mixedRealityController.menuButton > 0.5F;
        }
Пример #2
0
        private void UpdateInputSide(ControllerSide controllerInputSide)
        {
            controllerInputSide.stickHorizontal = oculusController.joystick.x;
            controllerInputSide.stickVertical   = oculusController.joystick.y;
            controllerInputSide.stickButton    |= (oculusController.joystick.z > 0.5F);
            controllerInputSide.stickTouch     |= (oculusController.joystick.z > -0.5F);

            controllerInputSide.buttons[0] |= (oculusController.buttonAX > 0.5F);
            controllerInputSide.buttons[1] |= (oculusController.buttonBY > 0.5F);

            controllerInputSide.trigger1 = oculusController.indexTrigger;
            controllerInputSide.trigger2 = oculusController.handTrigger;
        }
Пример #3
0
        protected void SetControllerInput(ControllerSide controllerSide)
        {
            controllerSide.stickHorizontal += steamVrController.touchPad.x;
            controllerSide.stickVertical   += steamVrController.touchPad.y;
            controllerSide.stickButton     |= (steamVrController.touchPad.z > 0.5F);

            controllerSide.buttons[0] |= steamVrController.aButton > 0.5F;
            controllerSide.buttons[1] |= steamVrController.menuButton > 0.5F;

            controllerSide.trigger1 += steamVrController.trigger;
            controllerSide.trigger2 += steamVrController.gripButton;

            controllerSide.option |= steamVrController.menuButton > 0.5F;
        }
Пример #4
0
        private void UpdateInputSide(ControllerSide controllerInputSide)
        {
            if (vrtkControllerEvents == null)
            {
                return;
            }

            controllerInputSide.stickButton = vrtkControllerEvents.touchpadPressed;
            controllerInputSide.stickTouch  = vrtkControllerEvents.touchpadTouched;

            controllerInputSide.trigger1   = GetTrigger();
            controllerInputSide.trigger2   = GetGrip();
            controllerInputSide.buttons[0] = vrtkControllerEvents.buttonOnePressed;
            controllerInputSide.buttons[1] = vrtkControllerEvents.buttonTwoPressed;
            controllerInputSide.option     = vrtkControllerEvents.startMenuPressed;
        }
        private void UpdateFingerMovementsSide(FingersTarget fingers, ControllerSide controllerSide)
        {
            float thumbCurl = Mathf.Max(controllerSide.trigger2, controllerSide.trigger1);

            fingers.thumb.curl = !controllerSide.stickTouch ? -0.5F : thumbCurl;

            float indexValue = controllerSide.trigger1;

            SetFingerCurl(fingers.index, indexValue);

            float fingersValue = Mathf.Max(controllerSide.trigger2, controllerSide.trigger1);

            SetFingerCurl(fingers.middle, fingersValue);
            SetFingerCurl(fingers.ring, fingersValue);
            SetFingerCurl(fingers.little, fingersValue);
        }
Пример #6
0
        protected void SetControllerInput(ControllerSide controllerSide)
        {
            controllerSide.stickHorizontal += hydraController.joystick.x;
            controllerSide.stickVertical   += hydraController.joystick.y;
            controllerSide.stickButton     |= (hydraController.joystick.z > 0.5F);
            controllerSide.stickTouch       = true;

            controllerSide.buttons[0] |= hydraController.button1 > 0.5F;
            controllerSide.buttons[1] |= hydraController.button2 > 0.5F;
            controllerSide.buttons[2] |= hydraController.button3 > 0.5F;
            controllerSide.buttons[3] |= hydraController.button4 > 0.5F;

            controllerSide.trigger1 += hydraController.bumper;
            controllerSide.trigger2 += hydraController.trigger;

            controllerSide.option |= hydraController.option > 0.5F;
        }
Пример #7
0
        protected void SetControllerInput(ControllerSide controllerSide, ArmController armController)
        {
            controllerSide.stickHorizontal += armController.input.stickHorizontal;
            controllerSide.stickVertical   += armController.input.stickVertical;
            controllerSide.stickButton     |= armController.input.stickPress;

            //controllerSide.up |= armController.input.up;
            //controllerSide.down |= armController.input.down;
            //controllerSide.left |= armController.input.left;
            //controllerSide.right |= armController.input.right;

            controllerSide.buttons[0] |= armController.input.buttons[0];
            controllerSide.buttons[1] |= armController.input.buttons[1];
            controllerSide.buttons[2] |= armController.input.buttons[2];
            controllerSide.buttons[3] |= armController.input.buttons[3];

            controllerSide.trigger1 += armController.input.trigger1;
            controllerSide.trigger2 += armController.input.trigger2;

            controllerSide.option |= armController.input.option;
        }
 /// <summary>Constructor for access to the controller input</summary>
 public Controller()
 {
     left  = new ControllerSide();
     right = new ControllerSide();
 }