sdr 0.7

net.cscott.sdr.anim
Class SdrFirstPersonHandler

java.lang.Object
  extended by com.jme.input.InputHandler
      extended by net.cscott.sdr.anim.SdrFirstPersonHandler

public abstract class SdrFirstPersonHandler
extends com.jme.input.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: SdrFirstPersonHandler.java,v 1.2 2007-03-07 19:17:20 cananian Exp $
Author:
Mark Powell

Field Summary
 
Fields inherited from class com.jme.input.InputHandler
AXIS_ALL, AXIS_NONE, BUTTON_ALL, BUTTON_NONE, DEVICE_ALL, DEVICE_KEYBOARD, DEVICE_MOUSE, event, mouse
 
Constructor Summary
SdrFirstPersonHandler(com.jme.renderer.Camera cam, float moveSpeed, float turnSpeed)
          Creates a first person handler.
 
Method Summary
abstract  void onAction()
          This method is called whenever an appropriate keyboard or mouse action is performed (that is, whenever this handler changes the camera position or angle.
 
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

SdrFirstPersonHandler

public SdrFirstPersonHandler(com.jme.renderer.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

onAction

public abstract void onAction()
This method is called whenever an appropriate keyboard or mouse action is performed (that is, whenever this handler changes the camera position or angle. Override in a subclass in order to register/react to this event.


sdr 0.7

Copyright © 2006-2009 C. Scott Ananian