- All Implemented Interfaces:
- com.jme3.input.Input, com.jme3.input.JoyInput
- Direct Known Subclasses:
- AndroidJoyInput14
public class AndroidJoyInput
extends java.lang.Object
implements com.jme3.input.JoyInput
Main class that manages various joystick devices. Joysticks can be many forms
including a simulated joystick to communicate the device orientation as well
as physical gamepads.
This class manages all the joysticks and feeds the inputs from each back
to jME's InputManager.
This handler also supports the joystick.rumble(rumbleAmount) method. In this
case, when joystick.rumble(rumbleAmount) is called, the Android device will vibrate
if the device has a built in vibrate motor.
Because Andorid does not allow for the user to define the intensity of the
vibration, the rumble amount (ie strength) is converted into vibration pulses
The stronger the strength amount, the shorter the delay between pulses. If
amount is 1, then the vibration stays on the whole time. If amount is 0.5,
the vibration will a pulse of equal parts vibration and delay.
To turn off vibration, set rumble amount to 0.
MainActivity needs the following line to enable Joysticks on Android platforms
joystickEventsEnabled = true;
This is done to allow for battery conservation when sensor data or gamepads
are not required by the application.
To use the joystick rumble feature, the following line needs to be
added to the Android Manifest File
- Author:
- iwgeric