File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -122,13 +122,19 @@ void JoypadSDL::process_events() {
122122 SDL_Joystick *sdl_joy = SDL_GetJoystickFromID (joypads[i].sdl_instance_idx );
123123 Vector2 strength = Input::get_singleton ()->get_joy_vibration_strength (i);
124124
125- // If the vibration was requested to start, SDL_RumbleJoystick will start it.
126- // If the vibration was requested to stop, strength and duration will be 0, so SDL will stop the rumble.
125+ /*
126+ If the vibration was requested to start, SDL_RumbleJoystick will start it.
127+ If the vibration was requested to stop, strength and duration will be 0, so SDL will stop the rumble.
128+
129+ Here strength.y goes first and then strength.x, because Input.get_joy_vibration_strength().x
130+ is vibration's weak magnitude (high frequency rumble), and .y is strong magnitude (low frequency rumble),
131+ SDL_RumbleJoystick takes low frequency rumble first and then high frequency rumble.
132+ */
127133 SDL_RumbleJoystick (
128134 sdl_joy,
129135 // Rumble strength goes from 0 to 0xFFFF
130- strength.x * UINT16_MAX,
131136 strength.y * UINT16_MAX,
137+ strength.x * UINT16_MAX,
132138 Input::get_singleton ()->get_joy_vibration_duration (i) * 1000 );
133139 }
134140 }
You can’t perform that action at this time.
0 commit comments