org.xith3d.input.modules.fpih
Class FPIHConfig

java.lang.Object
  extended by org.xith3d.input.modules.fpih.FPIHConfig

public class FPIHConfig
extends java.lang.Object

This config can be used to fully setup a FirstPersonInputHandler.


Field Summary
static float DEFAULT_MAX_ANGLE_UP_DOWN
           
static float DEFAULT_MOUSE_X_SPEED
           
static boolean DEFAULT_MOUSE_Y_INVERTED
           
static float DEFAULT_MOUSE_Y_SPEED
           
static float DEFAULT_MOVEMENT_BACKWARD_SPEED
           
static float DEFAULT_MOVEMENT_FORWARD_SPEED
           
static float DEFAULT_MOVEMENT_SIDEWARD_SPEED
           
 
Constructor Summary
FPIHConfig()
          Creates a new FPIHConfig.
FPIHConfig(float mouseXSpeed, float mouseYSpeed, float movementSpeed)
          Creates a new FPIHConfig.
FPIHConfig(float mouseXSpeed, float mouseYSpeed, float movementSpeedForeward, float movementSpeedBackward, float movementSpeedSideward)
          Creates a new FPIHConfig.
 
Method Summary
 void addListener(FPIHConfigListener l)
           
 void flipMouseYAxis()
          Flips the mouse-y-axis movement.
 float getMouseXSpeed()
           
 float getMouseYSpeed()
           
 float getMovementSpeed()
           
 float getMovementSpeedBackward()
           
 float getMovementSpeedForward()
           
 float getMovementSpeedSideward()
           
protected  void onSettingChanged(java.lang.String setting, float oldValue, float value)
           
 void removeListener(FPIHConfigListener l)
           
 void setMouseXSpeed(float speedX)
          Sets the mouse movement speed for the x-axis.
 void setMouseYSpeed(float speedY)
          Sets the mouse movement speed for the y-axis.
 void setMovementSpeed(float speed)
          Sets the speed the player moves by forward and backward.
 void setMovementSpeedBackward(float speed)
          Sets the speed the player moves by backward.
 void setMovementSpeedForward(float speed)
          Sets the speed the player moves by forward.
 void setMovementSpeedSideward(float speed)
          Sets the speed the player moves by sideward.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MOUSE_X_SPEED

public static final float DEFAULT_MOUSE_X_SPEED
See Also:
Constant Field Values

DEFAULT_MOUSE_Y_SPEED

public static final float DEFAULT_MOUSE_Y_SPEED
See Also:
Constant Field Values

DEFAULT_MOUSE_Y_INVERTED

public static boolean DEFAULT_MOUSE_Y_INVERTED

DEFAULT_MOVEMENT_FORWARD_SPEED

public static final float DEFAULT_MOVEMENT_FORWARD_SPEED
See Also:
Constant Field Values

DEFAULT_MOVEMENT_BACKWARD_SPEED

public static final float DEFAULT_MOVEMENT_BACKWARD_SPEED
See Also:
Constant Field Values

DEFAULT_MOVEMENT_SIDEWARD_SPEED

public static final float DEFAULT_MOVEMENT_SIDEWARD_SPEED
See Also:
Constant Field Values

DEFAULT_MAX_ANGLE_UP_DOWN

public static final float DEFAULT_MAX_ANGLE_UP_DOWN
Constructor Detail

FPIHConfig

public FPIHConfig(float mouseXSpeed,
                  float mouseYSpeed,
                  float movementSpeedForeward,
                  float movementSpeedBackward,
                  float movementSpeedSideward)
Creates a new FPIHConfig.

Parameters:
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
movementSpeedForeward - the new foreward movement speed
movementSpeedBackward - the new backward movement speed
movementSpeedSideward - the new sideward movement speed

FPIHConfig

public FPIHConfig(float mouseXSpeed,
                  float mouseYSpeed,
                  float movementSpeed)
Creates a new FPIHConfig.

Parameters:
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
movementSpeed - the new movement speed

FPIHConfig

public FPIHConfig()
Creates a new FPIHConfig.

Method Detail

addListener

public void addListener(FPIHConfigListener l)

removeListener

public void removeListener(FPIHConfigListener l)

onSettingChanged

protected void onSettingChanged(java.lang.String setting,
                                float oldValue,
                                float value)

setMouseXSpeed

public void setMouseXSpeed(float speedX)
Sets the mouse movement speed for the x-axis.

Parameters:
speedX - the new speed for the x-axis

getMouseXSpeed

public final float getMouseXSpeed()
Returns:
the mouse movement speed for the x-axis

setMouseYSpeed

public void setMouseYSpeed(float speedY)
Sets the mouse movement speed for the y-axis.

Parameters:
speedY - the new speed for the y-axis

getMouseYSpeed

public final float getMouseYSpeed()
Returns:
the mouse movement speed for the y-axis

flipMouseYAxis

public void flipMouseYAxis()
Flips the mouse-y-axis movement.
This is the same as
setMouseSpeedY( -getMouseSpeedY() );


getMovementSpeed

public final float getMovementSpeed()
Returns:
the speed the player moves by forward and backward.

setMovementSpeedForward

public void setMovementSpeedForward(float speed)
Sets the speed the player moves by forward.

Parameters:
speed - the new (forward) moving speed

getMovementSpeedForward

public final float getMovementSpeedForward()
Returns:
the speed the player moves by forward.

setMovementSpeedBackward

public void setMovementSpeedBackward(float speed)
Sets the speed the player moves by backward.

Parameters:
speed - the new (backward) moving speed

getMovementSpeedBackward

public final float getMovementSpeedBackward()
Returns:
the speed the player moves by backward.

setMovementSpeedSideward

public void setMovementSpeedSideward(float speed)
Sets the speed the player moves by sideward.

Parameters:
speed - the new (sideward) moving speed

getMovementSpeedSideward

public final float getMovementSpeedSideward()
Returns:
the speed the player moves by sideward.

setMovementSpeed

public void setMovementSpeed(float speed)
Sets the speed the player moves by forward and backward.

Parameters:
speed - the new moving speed