示例#1
0
        public RumbleHelper(XInputController controller, RumbleType rType)
        {
            input       = controller;
            rumbleType  = rType;
            rumbleState = 0;
            rumbleCount = 0;
            rumbleTimer = new DispatcherTimer();
            switch (rumbleType)
            {
            case RumbleType.wobbleRumble:
                rumbleTimer.Interval = new TimeSpan(0, 0, 0, 0, SHORT_RUMBLE_TIME);
                break;

            case RumbleType.burstRumble:
                rumbleTimer.Interval = new TimeSpan(0, 0, 0, 0, SHORT_RUMBLE_TIME);
                break;

            case RumbleType.shortRumble:
                rumbleTimer.Interval = new TimeSpan(0, 0, 0, 0, RUMBLE_TIME);
                break;

            case RumbleType.longRumble:
                rumbleTimer.Interval = new TimeSpan(0, 0, 0, 0, LONG_RUMBLE_TIME);
                break;
            }
            rumbleTimer.Tick           += new EventHandler(rumbleTimer_Tick);
            noVibration                 = new Vibration();
            noVibration.LeftMotorSpeed  = 0;
            noVibration.RightMotorSpeed = 0;
        }
示例#2
0
 public void Rumble(InputDevice inputDevice, RumbleType rumbleType)
 {
     if (rumbleEnabled && inputDevice != null)
     {
         StartCoroutine(rumbleMethodNames[rumbleType], inputDevice);
     }
 }
示例#3
0
        public override void SetRumble(RumbleType type)
        {
            StopRumbling();
            CustomRumble = false;
            switch (type)
            {
            case RumbleType.RumblingHuge:
                shakerFSM.FsmVariables.GetFsmBool("RumblingHuge").Value = true;
                break;

            case RumbleType.RumblingBig:
                shakerFSM.FsmVariables.GetFsmBool("RumblingBig").Value = true;
                break;

            case RumbleType.RumblingSmall:
                shakerFSM.FsmVariables.GetFsmBool("RumblingSmall").Value = true;
                break;

            case RumbleType.RumblingMed:
                shakerFSM.FsmVariables.GetFsmBool("RumblingMed").Value = true;
                break;

            case RumbleType.RumblingFocus:
                shakerFSM.FsmVariables.GetFsmBool("RumblingFocus").Value = true;
                break;

            case RumbleType.RumblingFocus2:
                shakerFSM.FsmVariables.GetFsmBool("RumblingFocus2").Value = true;
                break;

            case RumbleType.RumblingFall:
                shakerFSM.FsmVariables.GetFsmBool("RumblingFall").Value = true;
                break;
            }
        }
示例#4
0
        private amBXRumbleSetting CreateRumbleSetting(RumbleType rumbleType, float speed, float intensity)
        {
            log.Debug("Create Settings " + rumbleType + " " + speed + " " + intensity);
            var setting = new amBXRumbleSetting();

            setting.Type      = rumbleType;
            setting.Speed     = speed;
            setting.Intensity = intensity;
            return(setting);
        }
示例#5
0
 public void SetRumble(RumbleType type, double value)
 {
     if (value < 0)
     {
         value = 0;
     }
     else if (value > 1)
     {
         value = 1;
     }
     if (type == RumbleType.kLeftRumble)
     {
         m_leftRumble = (short)(value * 65535);
     }
     else
     {
         m_rightRumble = (short)(value * 65535);
     }
     Hal.DriverStationLowLevel.SetJoystickOutputs(Port, m_outputs, m_leftRumble, m_rightRumble);
 }
示例#6
0
        public override void SetRumble(RumbleType type)
        {
            switch (type)
            {
            case RumbleType.None:
                SetRumble(default(Vector3));
                break;

            case RumbleType.RumblingHuge:
                SetRumble(new Vector3(1f, 1f, 0f));
                break;

            case RumbleType.RumblingBig:
                SetRumble(new Vector3(0.5f, 0.5f, 0f));
                break;

            case RumbleType.RumblingSmall:
                SetRumble(new Vector3(0.08f, 0.08f, 0f));
                break;

            case RumbleType.RumblingMed:
                SetRumble(new Vector3(0.15f, 0.15f, 0f));
                break;

            case RumbleType.RumblingFocus:
                SetRumble(new Vector3(0.015f, 0.015f, 0f));
                break;

            case RumbleType.RumblingFocus2:
                SetRumble(new Vector3(0.03f, 0.03f, 0f));
                break;

            case RumbleType.RumblingFall:
                SetRumble(new Vector3(0.015f, 0.015f, 0f));
                break;

            default:
                SetRumble(default(Vector3));
                break;
            }
        }
示例#7
0
 public void SetRumble(RumbleType type)
 {
     impl.SetRumble(type);
 }
示例#8
0
 public void SetRumble(RumbleType type, float value)
 {
     if (value < 0)
         value = 0;
     else if (value > 1)
         value = 1;
     if (type == RumbleType.LeftRumble)
         m_leftRumble = (ushort)(value * 65535);
     else
         m_rightRumble = (ushort)(value * 65535);
     HAL.HALSetJoystickOutputs((byte)m_port, (uint)m_outputs, m_leftRumble, m_rightRumble);
 }
示例#9
0
 public abstract void SetRumble(RumbleType type);