Skip to main content

FlixelLwjgl3HapticsProvider

View source

class

org.flixelgdx.backend.lwjgl3.input.FlixelLwjgl3HapticsProvider

public final class FlixelLwjgl3HapticsProvider implements FlixelHapticsProvider

Desktop FlixelHapticsProvider backed by SDL via Jamepad. Supports true independent dual-motor vibration by calling ControllerIndex.doVibration(left, right, duration) directly, which maps to SDL_JoystickRumble with separate low-frequency (left) and high-frequency (right) motor channels.

This provider is installed automatically by FlixelLwjgl3Launcher and replaces the default org.flixelgdx.input.gamepad.FlixelDefaultHapticsProvider. You do not need to install it manually.

Fallback behavior

Reflection is used to reach the private controllerIndex field on JamepadController. If reflection is unavailable (for example, under certain security managers or after module-system hardening), the provider falls back to Controller.startVibration with the stronger of the two intensities driving both motors, matching the behavior of the default provider.

Constructors

FlixelLwjgl3HapticsProvider()

public FlixelLwjgl3HapticsProvider()

Methods

vibrate(int, float, float, float)

public void vibrate(int slot, float leftIntensity, float rightIntensity, float durationSecs)

stopVibration(int)

public void stopVibration(int slot)

canVibrate(int)

public boolean canVibrate(int slot)