de.rico.engine.input
Class KeyBoardMouseSwitcherControls

java.lang.Object
  extended by de.rico.engine.input.KeyBoardMouseSwitcherControls

public class KeyBoardMouseSwitcherControls
extends java.lang.Object

This class represents an input controls scheme which moves the camera by keyboard keys and rotates it either by keyboard keys or by mouse movement. This class privides functionality to switch between those two modes.
The key settings are:

If the mouse camera is enabled you can use the mouse to look into the direction you want.

Author:
Frank Bruns

Constructor Summary
KeyBoardMouseSwitcherControls(InputManager im)
          Creates a new first person control scheme
 
Method Summary
 float getSpeedMove()
          Returns the value for movement speed.
 float getSpeedRotate()
          Returns the value for keyboard camera rotation speed.
 boolean isEnabledMouseCam()
          Determines whether or not the freelook mouse camera mode is enabled.
 void setEnabledMouseCam(boolean enable)
          Sets whether or not the freelook mouse camera ought to be enabled.
 void setSpeedMove(float speed)
          Sets a value for the movement speed.
 void setSpeedRotate(float speed)
          Sets a value for the rotation speed of the keyboard camera rotation.
 void update(long elapsedTime)
          Updates the first person control movements
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyBoardMouseSwitcherControls

public KeyBoardMouseSwitcherControls(InputManager im)
Creates a new first person control scheme

Parameters:
im - the input of the game
Method Detail

setSpeedMove

public void setSpeedMove(float speed)
Sets a value for the movement speed.

Parameters:
speed - movement speed

getSpeedMove

public float getSpeedMove()
Returns the value for movement speed.

Returns:
movement speed

setSpeedRotate

public void setSpeedRotate(float speed)
Sets a value for the rotation speed of the keyboard camera rotation.

Parameters:
speed - rotation speed

getSpeedRotate

public float getSpeedRotate()
Returns the value for keyboard camera rotation speed.

Returns:
rotation speed

setEnabledMouseCam

public void setEnabledMouseCam(boolean enable)
Sets whether or not the freelook mouse camera ought to be enabled.

Parameters:
enable - enabled mouse cam? --> true=yes, false=no

isEnabledMouseCam

public boolean isEnabledMouseCam()
Determines whether or not the freelook mouse camera mode is enabled.

Returns:
is mouse cam enabled? --> true=yes, false=no

update

public void update(long elapsedTime)
Updates the first person control movements

Parameters:
elapsedTime - time between two frames