com.jme.input
Class FirstPersonHandler

java.lang.Object
  extended by com.jme.input.InputHandler
      extended by com.jme.input.FirstPersonHandler

public class FirstPersonHandler
extends InputHandler

FirsPersonController defines an InputHandler that sets input to be controlled similar to First Person Shooting games. By default the commands are, WSAD moves the camera forward, backward and strafes. The arrow keys rotate and tilt the camera and the mouse also rotates and tilts the camera.
This is a handler that is composed from KeyboardLookHandler and MouseLookHandler.

Version:
$Id: FirstPersonHandler.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell

Field Summary
 
Fields inherited from class com.jme.input.InputHandler
activeTriggers, allTriggers, AXIS_ALL, AXIS_NONE, BUTTON_ALL, BUTTON_NONE, DEVICE_ALL, DEVICE_KEYBOARD, DEVICE_MOUSE, event, mouse
 
Constructor Summary
FirstPersonHandler(Camera cam)
          Creates a first person handler.
FirstPersonHandler(Camera cam, float moveSpeed, float turnSpeed)
          Creates a first person handler.
 
Method Summary
 KeyboardLookHandler getKeyboardLookHandler()
           
 MouseLookHandler getMouseLookHandler()
           
 void setButtonPressRequired(boolean value)
           
 
Methods inherited from class com.jme.input.InputHandler
addAction, addAction, addAction, addAction, addAction, addAction, addDevice, addToAttachedHandlers, clearActions, getBooleanProp, getDevices, getFloatProp, getFromAttachedHandlers, getIntProp, getObjectProp, getParent, isEnabled, processTriggers, removeAction, removeAction, removeAllActions, removeAllFromAttachedHandlers, removeFromAttachedHandlers, setActionSpeed, setActionSpeed, setEnabled, setEnabledOfAttachedHandlers, setParent, sizeOfAttachedHandlers, update, updateAttachedHandlers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstPersonHandler

public FirstPersonHandler(Camera cam)
Creates a first person handler.

Parameters:
cam - The camera to move by this handler.

FirstPersonHandler

public FirstPersonHandler(Camera cam,
                          float moveSpeed,
                          float turnSpeed)
Creates a first person handler.

Parameters:
cam - The camera to move by this handler.
moveSpeed - action speed for move actions
turnSpeed - action speed for rotating actions
Method Detail

getKeyboardLookHandler

public KeyboardLookHandler getKeyboardLookHandler()
Returns:
handler for keyboard controls

getMouseLookHandler

public MouseLookHandler getMouseLookHandler()
Returns:
handler for mouse controls

setButtonPressRequired

public void setButtonPressRequired(boolean value)