Ejemplo n.º 1
0
        private static void Update_R_MicrosoftMR(IVRModuleDeviceState prevState, IVRModuleDeviceStateRW currState)
        {
            var menuPress    = GetUnityButton(0);
            var padPress     = GetUnityButton(9);
            var triggerPress = GetUnityButton(15);
            var padTouch     = GetUnityButton(17);

            var stickX  = GetUnityAxis(4);
            var stickY  = GetUnityAxis(5);
            var trigger = GetUnityAxis(10);
            var grip    = GetUnityAxis(12);
            var padX    = GetUnityAxis(19);
            var padY    = GetUnityAxis(20);

            currState.SetButtonPress(VRModuleRawButton.ApplicationMenu, menuPress);
            currState.SetButtonPress(VRModuleRawButton.Touchpad, padPress);
            currState.SetButtonPress(VRModuleRawButton.Trigger, triggerPress);
            currState.SetButtonPress(VRModuleRawButton.Grip, grip >= 1f);

            currState.SetButtonTouch(VRModuleRawButton.Touchpad, padTouch);
            currState.SetButtonTouch(VRModuleRawButton.Trigger, AxisToPress(prevState.GetButtonPress(VRModuleRawButton.Trigger), trigger, 0.25f, 0.20f));

            currState.SetAxisValue(VRModuleRawAxis.TouchpadX, padX);
            currState.SetAxisValue(VRModuleRawAxis.TouchpadY, -padY);
            currState.SetAxisValue(VRModuleRawAxis.Trigger, trigger);
            currState.SetAxisValue(VRModuleRawAxis.JoystickX, stickX);
            currState.SetAxisValue(VRModuleRawAxis.JoystickY, -stickY);
        }
Ejemplo n.º 2
0
        private static void Update_R_Knuckles(IVRModuleDeviceState prevState, IVRModuleDeviceStateRW currState)
        {
            var innerPress   = GetUnityButton(0);
            var outerPress   = GetUnityButton(1);
            var padPress     = GetUnityButton(9);
            var triggerTouch = GetUnityButton(15);
            var padTouch     = GetUnityButton(17);

            var padX    = GetUnityAxis(4);
            var padY    = GetUnityAxis(5);
            var trigger = GetUnityAxis(10);
            var grip    = GetUnityAxis(12);
            var index   = GetUnityAxis(21);
            var middle  = GetUnityAxis(23);
            var ring    = GetUnityAxis(25);
            var pinky   = GetUnityAxis(27);

            currState.SetButtonPress(VRModuleRawButton.ApplicationMenu, outerPress);
            currState.SetButtonPress(VRModuleRawButton.A, innerPress);
            currState.SetButtonPress(VRModuleRawButton.Touchpad, padPress);
            currState.SetButtonPress(VRModuleRawButton.Trigger, AxisToPress(prevState.GetButtonPress(VRModuleRawButton.Trigger), trigger, 0.55f, 0.45f));
            currState.SetButtonPress(VRModuleRawButton.Grip, grip >= 1.0f);

            currState.SetButtonTouch(VRModuleRawButton.Touchpad, padTouch);
            currState.SetButtonTouch(VRModuleRawButton.Trigger, triggerTouch);

            currState.SetAxisValue(VRModuleRawAxis.TouchpadX, padX);
            currState.SetAxisValue(VRModuleRawAxis.TouchpadY, -padY);
            currState.SetAxisValue(VRModuleRawAxis.Trigger, trigger);
            currState.SetAxisValue(VRModuleRawAxis.CapSenseGrip, grip);
            currState.SetAxisValue(VRModuleRawAxis.IndexCurl, index);
            currState.SetAxisValue(VRModuleRawAxis.MiddleCurl, middle);
            currState.SetAxisValue(VRModuleRawAxis.RingCurl, ring);
            currState.SetAxisValue(VRModuleRawAxis.PinkyCurl, pinky);
        }
Ejemplo n.º 3
0
        private static void Update_R_Vive(IVRModuleDeviceState prevState, IVRModuleDeviceStateRW currState)
        {
            var primaryButtonPress = GetUnityButton(1);
            var menuPress          = GetUnityButton(0);
            var padPress           = GetUnityButton(9);
            var triggerTouch       = GetUnityButton(15);
            var padTouch           = GetUnityButton(17);

            var padX    = GetUnityAxis(4);
            var padY    = GetUnityAxis(5);
            var trigger = GetUnityAxis(10);
            var grip    = GetUnityAxis(12);

            currState.SetButtonPress(VRModuleRawButton.A, primaryButtonPress);
            currState.SetButtonPress(VRModuleRawButton.ApplicationMenu, menuPress);
            currState.SetButtonPress(VRModuleRawButton.Touchpad, padPress);
            currState.SetButtonPress(VRModuleRawButton.Trigger, AxisToPress(prevState.GetButtonPress(VRModuleRawButton.Trigger), trigger, 0.55f, 0.45f));
            currState.SetButtonPress(VRModuleRawButton.Grip, grip >= 1.0f);

            currState.SetButtonTouch(VRModuleRawButton.Touchpad, padTouch);
            currState.SetButtonTouch(VRModuleRawButton.Trigger, triggerTouch);

            currState.SetAxisValue(VRModuleRawAxis.TouchpadX, padX);
            currState.SetAxisValue(VRModuleRawAxis.TouchpadY, -padY);
            currState.SetAxisValue(VRModuleRawAxis.Trigger, trigger);
        }
Ejemplo n.º 4
0
        private static void Update_R_OculusTouch(IVRModuleDeviceState prevState, IVRModuleDeviceStateRW currState)
        {
            var aPress       = GetUnityButton(0);
            var bPress       = GetUnityButton(1);
            var stickPress   = GetUnityButton(9);
            var gripPress    = GetUnityButton(5);
            var aTouch       = GetUnityButton(10);
            var bTouch       = GetUnityButton(11);
            var triggerTouch = GetUnityButton(15);
            var stickTouch   = GetUnityButton(17);

            var stickX  = GetUnityAxis(4);
            var stickY  = GetUnityAxis(5);
            var trigger = GetUnityAxis(10);
            var grip    = GetUnityAxis(12);

            currState.SetButtonPress(VRModuleRawButton.ApplicationMenu, bPress);
            currState.SetButtonPress(VRModuleRawButton.A, aPress);
            currState.SetButtonPress(VRModuleRawButton.Touchpad, stickPress);
            currState.SetButtonPress(VRModuleRawButton.Trigger, AxisToPress(prevState.GetButtonPress(VRModuleRawButton.Trigger), trigger, 0.55f, 0.45f));
            currState.SetButtonPress(VRModuleRawButton.Grip, gripPress);
            currState.SetButtonPress(VRModuleRawButton.CapSenseGrip, gripPress);

            currState.SetButtonTouch(VRModuleRawButton.ApplicationMenu, bTouch);
            currState.SetButtonTouch(VRModuleRawButton.A, aTouch);
            currState.SetButtonTouch(VRModuleRawButton.Touchpad, stickTouch);
            currState.SetButtonTouch(VRModuleRawButton.Trigger, triggerTouch);
            currState.SetButtonTouch(VRModuleRawButton.Grip, grip >= 0.05f);
            currState.SetButtonTouch(VRModuleRawButton.CapSenseGrip, grip >= 0.05f);

            currState.SetAxisValue(VRModuleRawAxis.TouchpadX, stickX);
            currState.SetAxisValue(VRModuleRawAxis.TouchpadY, -stickY);
            currState.SetAxisValue(VRModuleRawAxis.Trigger, trigger);
            currState.SetAxisValue(VRModuleRawAxis.CapSenseGrip, grip);
        }
        private static void Update_L_OculusTouch(IVRModuleDeviceState prevState, IVRModuleDeviceStateRW currState)
        {
            var xPress       = GetUnityButton(2);
            var yPress       = GetUnityButton(3);
            var stickPress   = GetUnityButton(8);
            var gripPress    = GetUnityButton(4);
            var xTouch       = GetUnityButton(12);
            var yTouch       = GetUnityButton(13);
            var triggerTouch = GetUnityButton(14);
            var stickTouch   = GetUnityButton(16);

            var stickX  = GetUnityAxis(1);
            var stickY  = GetUnityAxis(2);
            var trigger = GetUnityAxis(9);
            var grip    = GetUnityAxis(11);

            currState.SetButtonPress(VRModuleRawButton.ApplicationMenu, yPress);
            currState.SetButtonPress(VRModuleRawButton.A, xPress);
            currState.SetButtonPress(VRModuleRawButton.Touchpad, stickPress);
            currState.SetButtonPress(VRModuleRawButton.Trigger, AxisToPress(prevState.GetButtonPress(VRModuleRawButton.Trigger), trigger, 0.55f, 0.45f));
            currState.SetButtonPress(VRModuleRawButton.Grip, gripPress);
            currState.SetButtonPress(VRModuleRawButton.CapSenseGrip, gripPress);

            currState.SetButtonTouch(VRModuleRawButton.ApplicationMenu, yTouch);
            currState.SetButtonTouch(VRModuleRawButton.A, xTouch);
            currState.SetButtonTouch(VRModuleRawButton.Touchpad, stickTouch);
            currState.SetButtonTouch(VRModuleRawButton.Trigger, triggerTouch);
            currState.SetButtonTouch(VRModuleRawButton.Grip, grip >= 0.05f);
            currState.SetButtonTouch(VRModuleRawButton.CapSenseGrip, grip >= 0.05f);

            currState.SetAxisValue(VRModuleRawAxis.TouchpadX, stickX);
            currState.SetAxisValue(VRModuleRawAxis.TouchpadY, -stickY);
            currState.SetAxisValue(VRModuleRawAxis.Trigger, trigger);
            currState.SetAxisValue(VRModuleRawAxis.CapSenseGrip, grip);
        }