com.jme.input.joystick.lwjgl
Class LWJGLJoystick

java.lang.Object
  extended by com.jme.input.joystick.lwjgl.LWJGLJoystick
All Implemented Interfaces:
Joystick

 class LWJGLJoystick
extends java.lang.Object
implements Joystick

LWJGL Implementation of Joystick.


Constructor Summary
LWJGLJoystick(Controller controller)
           
 
Method Summary
 int findAxis(java.lang.String name)
          Look through the axis for a given name.
 int getAxisCount()
           
 java.lang.String[] getAxisNames()
          Query the names of the joysticks axes.
 float getAxisValue(int axis)
          Query the current position of a single axis.
 int getButtonCount()
           
 java.lang.String getName()
           
 boolean isButtonPressed(int button)
          Query state of a button.
 void rumble(int axis, float intensity)
          Cause the rumbler (if existent) for specified axis to change force.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LWJGLJoystick

LWJGLJoystick(Controller controller)
Method Detail

rumble

public void rumble(int axis,
                   float intensity)
Description copied from interface: Joystick
Cause the rumbler (if existent) for specified axis to change force.

Specified by:
rumble in interface Joystick
Parameters:
axis - index of the axis to be rumbled
intensity - new force intensity

getAxisNames

public java.lang.String[] getAxisNames()
Description copied from interface: Joystick
Query the names of the joysticks axes. Indices correspond with Joystick.getAxisValue(int).

Specified by:
getAxisNames in interface Joystick
Returns:
an array of axis names

getAxisCount

public int getAxisCount()
Specified by:
getAxisCount in interface Joystick
Returns:
number of axes this joystick has

getAxisValue

public float getAxisValue(int axis)
Description copied from interface: Joystick
Query the current position of a single axis. Remember to call Input.update() prior to using these method.

Specified by:
getAxisValue in interface Joystick
Parameters:
axis - index of the axis of interest
Returns:
the current position of the axis between -1 and 1

getButtonCount

public int getButtonCount()
Specified by:
getButtonCount in interface Joystick
Returns:
number of buttons this joystick has

isButtonPressed

public boolean isButtonPressed(int button)
Description copied from interface: Joystick
Query state of a button. Remember to call Input.update() prior to using these method.

Specified by:
isButtonPressed in interface Joystick
Parameters:
button - index of a button (0 <= index < Joystick.getButtonCount())
Returns:
true if button is currently pressed

getName

public java.lang.String getName()
Specified by:
getName in interface Joystick
Returns:
name of this joystick

findAxis

public int findAxis(java.lang.String name)
Description copied from interface: Joystick
Look through the axis for a given name.

Specified by:
findAxis in interface Joystick
Parameters:
name - the name of the axis we are looking for
Returns:
the index of the matching axis or -1 if none.