Package com.jme3.input
Class DefaultJoystickAxis
java.lang.Object
com.jme3.input.DefaultJoystickAxis
- All Implemented Interfaces:
- JoystickAxis
- Direct Known Subclasses:
- AndroidSensorJoyInput.AndroidSensorJoystickAxis
Default implementation of the JoystickAxis interface.
- 
Field SummaryFields inherited from interface com.jme3.input.JoystickAxisLEFT_TRIGGER, POV_X, POV_Y, RIGHT_TRIGGER, X_AXIS, Y_AXIS, Z_AXIS, Z_ROTATION
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultJoystickAxis(InputManager inputManager, Joystick parent, int axisIndex, String name, String logicalId, boolean isAnalog, boolean isRelative, float deadZone) Creates a new joystick axis instance.
- 
Method SummaryModifier and TypeMethodDescriptionvoidassignAxis(String positiveMapping, String negativeMapping) Assign the mappings to receive events from the given joystick axis.intReturns the axisId of this joystick axis.floatReturns the suggested dead zone for this axis.Returns the joystick to which this axis object belongs.Returns the logical identifier of this joystick axis.getName()Returns the name of this joystick.booleanisAnalog()Returns true if this is an analog axis, meaning the values are a continuous range instead of 1, 0, and -1.booleanReturns true if this axis presents relative values.voidsetDeadZone(float f) Sets/overrides the dead zone for this axis.toString()
- 
Constructor Details- 
DefaultJoystickAxispublic DefaultJoystickAxis(InputManager inputManager, Joystick parent, int axisIndex, String name, String logicalId, boolean isAnalog, boolean isRelative, float deadZone) Creates a new joystick axis instance. Only used internally.- Parameters:
- inputManager- (alias created)
- parent- (alias created)
- axisIndex- index for the new axis
- name- name for the new axis
- logicalId- logical identifier for the new axis
- isAnalog- true→continuous range, false→discrete values
- isRelative- true→presents relative values
- deadZone- the radius of the dead zone
 
 
- 
- 
Method Details- 
assignAxisAssign the mappings to receive events from the given joystick axis.- Specified by:
- assignAxisin interface- JoystickAxis
- Parameters:
- positiveMapping- The mapping to receive events when the axis is negative
- negativeMapping- The mapping to receive events when the axis is positive
 
- 
getJoystickReturns the joystick to which this axis object belongs.- Specified by:
- getJoystickin interface- JoystickAxis
- Returns:
- the pre-existing instance
 
- 
getNameReturns the name of this joystick.- Specified by:
- getNamein interface- JoystickAxis
- Returns:
- the name of this joystick.
 
- 
getLogicalIdReturns the logical identifier of this joystick axis.- Specified by:
- getLogicalIdin interface- JoystickAxis
- Returns:
- the logical identifier of this joystick.
 
- 
getAxisIdpublic int getAxisId()Returns the axisId of this joystick axis.- Specified by:
- getAxisIdin interface- JoystickAxis
- Returns:
- the axisId of this joystick axis.
 
- 
isAnalogpublic boolean isAnalog()Returns true if this is an analog axis, meaning the values are a continuous range instead of 1, 0, and -1.- Specified by:
- isAnalogin interface- JoystickAxis
- Returns:
- true if analog, otherwise false
 
- 
isRelativepublic boolean isRelative()Returns true if this axis presents relative values.- Specified by:
- isRelativein interface- JoystickAxis
- Returns:
- true if relative, otherwise false
 
- 
getDeadZonepublic float getDeadZone()Returns the suggested dead zone for this axis. Values less than this can be safely ignored.- Specified by:
- getDeadZonein interface- JoystickAxis
- Returns:
- the radius of the dead zone
 
- 
setDeadZonepublic void setDeadZone(float f) Sets/overrides the dead zone for this axis. This indicates that values within +/- deadZone should be ignored.- Parameters:
- f- the desired radius
 
- 
toString
 
-