org.xith3d.input
Class FirstPersonInputHandler

java.lang.Object
  extended by org.jagatoo.input.handlers.InputHandler<FPIHInputAction>
      extended by org.xith3d.input.FirstPersonInputHandler

public class FirstPersonInputHandler
extends org.jagatoo.input.handlers.InputHandler<FPIHInputAction>

This class handles the Keyboard and Mouse input for first person shooter like Views (EGO-perspective).


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
           
 
Fields inherited from class org.jagatoo.input.handlers.InputHandler
CONTROLLERS_SUSPENDED, FIRST_USER_SUSPEND_FLAG, KEYBOARD_SUSPENDED, MOUSE_BUTTONS_SUSPENDED, MOUSE_MOVEMENT_SUSPENDED, MOUSE_WHEEL_SUSPENDED, suspendMask
 
Constructor Summary
FirstPersonInputHandler(Transformable view, int resolutionX, int resolutionY)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, int resolutionX, int resolutionY, float mouseXSpeed, float mouseYSpeed, boolean mouseYInverted, float movementSpeed)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, int resolutionX, int resolutionY, float mouseXSpeed, float mouseYSpeed, float movementSpeed)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, int resolutionX, int resolutionY, float mouseXSpeed, float mouseYSpeed, float movementSpeedForeward, float movementSpeedBackward, float movementSpeedSideward)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, int resolutionX, int resolutionY, FPIHConfig config)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, org.openmali.types.twodee.Sized2iRO resolution)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, float mouseXSpeed, float mouseYSpeed, boolean yInverted, float movementSpeed)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, float mouseXSpeed, float mouseYSpeed, float movementSpeed)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, float mouseXSpeed, float mouseYSpeed, float movementSpeedForeward, float movementSpeedBackward, float movementSpeedSideward)
          Creates a new FirstPersonInputHandler.
FirstPersonInputHandler(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, FPIHConfig config)
          Creates a new FirstPersonInputHandler.
 
Method Summary
 void addAvatar(AvatarTransform at)
          Adds an Avatar to the FPIH,
An Avatar always follows the main Transformable (View) possibly with an offset.
 void addMovementListener(MovementListener l)
          Adds a MovementListener to the List.
 void applyConfig(FPIHConfig config)
          Applies the given FPIHConfig to this FirstPersonInputHandler.
static FirstPersonInputHandler createDefault(Transformable view, int resolutionX, int resolutionY)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, int resolutionX, int resolutionY, boolean mouseYInverted)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, int resolutionX, int resolutionY, float mouseXSpeed, float mouseYSpeed, float movementSpeed)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, int resolutionX, int resolutionY, float mouseXSpeed, float mouseYSpeed, float movementSpeedForeward, float movementSpeedBackward, float movementSpeedSideward)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, int resolutionX, int resolutionY, FPIHConfig config)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, org.openmali.types.twodee.Sized2iRO resolution)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, boolean mouseYInverted)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, float mouseXSpeed, float mouseYSpeed, boolean mouseYInverted, float movementSpeed)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, float mouseXSpeed, float mouseYSpeed, float movementSpeed)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, float mouseXSpeed, float mouseYSpeed, float movementSpeedForeward, float movementSpeedBackward, float movementSpeedSideward)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
static FirstPersonInputHandler createDefault(Transformable view, org.openmali.types.twodee.Sized2iRO resolution, FPIHConfig config)
          Creates a new FirstPersonInputHandler and applies default key-bindings.
protected  FPIHInputStatesManager createInputStatesManager(org.jagatoo.input.managers.InputBindingsManager<FPIHInputAction> bindingsManager)
           
 void extractConfig(FPIHConfig config)
          Extracts a FPIHConfig from this FirstPersonInputHandler.
 void flipMouseYAxis()
          Flips the mouse-y-axis movement.
 FPIHInputBindingsManager getBindingsManager()
          
 float getDiscreteThirdPersonStepSize()
           
 float getMaxThirdPersonDistance()
           
 float getMinThirdPersonDistance()
           
 float getMouseXSpeed()
           
 float getMouseYSpeed()
           
 FPIHMovementConstraints getMovementConstraints()
           
 float getMovementSpeed()
           
 float getMovementSpeedBackward()
           
 float getMovementSpeedForward()
           
 float getMovementSpeedSideward()
           
 FPIHPhysics getPhysicsObject()
           
 float getPlayerCrouchSizeRegression()
           
 FPIHInputStatesManager getStatesManager()
          
 org.openmali.vecmath2.Vector3f getThirdPersonOffset()
           
 Transformable getTransformNode()
           
 org.openmali.spatial.AxisIndicator getUpAxis()
           
 View getView()
           
 void removeAvatar(AvatarTransform at)
          Removes an Avatar from the FPIH,
An Avatar always follows the main Transformable (View) possibly with an offset.
 void removeMovementListener(MovementListener l)
          Removes a MovementListener from the List.
 void setDiscreteThirdPersonStepSize(float stepSize)
          Sets the stepsize of discrete third-person offset manipulation.
 void setInputSystem(org.jagatoo.input.InputSystem inputSystem)
          
 void setMaxThirdPersonDistance(float maxDist)
          Sets the maximum third-person distance.
 void setMinThirdPersonDistance(float minDist)
          Sets the minimum third-person distance.
 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 setMovementConstraints(FPIHMovementConstraints constraints)
          Sets the constraints to be used by this FirstPersonInputHandler.
 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.
 void setPhysicsObject(FPIHPhysics physicsObject)
           
 void setPlayerCrouchSizeRegression(float sizeDelta)
          Sets the value the view will we lowered with the player crouches.
 boolean setSuspendMask(int suspendMask)
          
 void setThirdPersonDistance(float dist)
           
 void setThirdPersonOffset(float tpOffsetX, float tpOffsetY, float tpOffsetZ)
          Sets the third-person-offset in view-local coordinates.
 void setThirdPersonOffset(float tpDirectionX, float tpDirectionY, float tpDirectionZ, float distance)
          Sets the third-person-offset in view-local coordinates.
 void setThirdPersonOffset(org.openmali.vecmath2.Tuple3f tpOffset)
          Sets the third-person-offset in view-local coordinates.
 void setThirdPersonOffset(org.openmali.vecmath2.Tuple3f tpDirection, float distance)
          Sets the third-person-offset in view-local coordinates.
 void setUpAxis(org.openmali.spatial.AxisIndicator upAxis)
          Sets the up-axis to use.
 void startCrouch()
          Makes the player crouch.
 boolean startJump()
          Called, when the player jumped.
 void startMovement(FPIHInputAction command)
          Called when the player starts to move into any direction.
 void stopCrouch()
          Makes the player stand up from crouch.
 void stopMovement(FPIHInputAction command)
          Called when the player stopps to move into any direction.
 void update(long nanoSeconds, float seconds, long nanoFrame, float frameSeconds)
          
protected  void updateAvatars(long gameMicros, long frameMicros, Transformable view, org.openmali.vecmath2.Vector3f viewTranslation, float rotX, float rotY, org.openmali.vecmath2.Vector3f thirdPersonOffset)
          This transforms additional Transformables to follow the main Transformable (View).
 void updateViewInverse()
          Calculates internal angle-values from the current View-rotation.
 
Methods inherited from class org.jagatoo.input.handlers.InputHandler
areControllersSuspended, attachToSourceWindow, getAttachedSourceWindow, getInputSystem, getSuspendMask, isKeyboardSuspended, isMouseButtonsSuspended, isMouseMovementSuspended, isMouseSmoothingEnabled, isMouseSuspended, isMouseWheelSuspended, isSuspended, setControllersSuspended, setKeyboardSuspended, setMouseButtonsSuspended, setMouseMovementSuspended, setMouseSmoothingEnabled, setMouseSuspended, setMouseWheelSuspended, setSuspended, update, updateInputStates
 
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 final 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

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               int resolutionX,
                               int resolutionY,
                               float mouseXSpeed,
                               float mouseYSpeed,
                               float movementSpeedForeward,
                               float movementSpeedBackward,
                               float movementSpeedSideward)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
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

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               int resolutionX,
                               int resolutionY,
                               float mouseXSpeed,
                               float mouseYSpeed,
                               float movementSpeed)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
movementSpeed - the new movement speed

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               int resolutionX,
                               int resolutionY,
                               float mouseXSpeed,
                               float mouseYSpeed,
                               boolean mouseYInverted,
                               float movementSpeed)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
mouseYInverted -
movementSpeed - the new movement speed

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               org.openmali.types.twodee.Sized2iRO resolution,
                               float mouseXSpeed,
                               float mouseYSpeed,
                               float movementSpeedForeward,
                               float movementSpeedBackward,
                               float movementSpeedSideward)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolution - the Canvas3D to take as calculation basis for resolution-independent turn speed
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

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               org.openmali.types.twodee.Sized2iRO resolution,
                               float mouseXSpeed,
                               float mouseYSpeed,
                               float movementSpeed)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolution - the Canvas3D to take as calculation basis for resolution-independent turn speed
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
movementSpeed - the new movement speed

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               org.openmali.types.twodee.Sized2iRO resolution,
                               float mouseXSpeed,
                               float mouseYSpeed,
                               boolean yInverted,
                               float movementSpeed)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolution - the Canvas3D to take as calculation basis for resolution-independent turn speed
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
yInverted -
movementSpeed - the new movement speed

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               int resolutionX,
                               int resolutionY)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               org.openmali.types.twodee.Sized2iRO resolution)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolution - the Canvas to take as calculation basis for resolution-independent turn speed

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               int resolutionX,
                               int resolutionY,
                               FPIHConfig config)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
config -

FirstPersonInputHandler

public FirstPersonInputHandler(Transformable view,
                               org.openmali.types.twodee.Sized2iRO resolution,
                               FPIHConfig config)
Creates a new FirstPersonInputHandler.

Parameters:
view - the View to be used.
resolution - the Canvas to take as calculation basis for resolution-independent turn speed
config -
Method Detail

setUpAxis

public void setUpAxis(org.openmali.spatial.AxisIndicator upAxis)
Sets the up-axis to use.
Default is AxisIndicator.POSITIVE_Y_AXIS.

Parameters:
upAxis -

getUpAxis

public final org.openmali.spatial.AxisIndicator getUpAxis()
Returns:
the up-axis to use.
Default is AxisIndicator.POSITIVE_Y_AXIS.

getTransformNode

public final Transformable getTransformNode()
Returns:
the View used by this FirstPersonInputAdapter

getView

public final View getView()
Returns:
the View used by this FirstPersonInputAdapter

addMovementListener

public void addMovementListener(MovementListener l)
Adds a MovementListener to the List.

Parameters:
l - the new MovmentListener to add

removeMovementListener

public void removeMovementListener(MovementListener l)
Removes a MovementListener from the List.

Parameters:
l - the MovmentListener to be removed

startMovement

public void startMovement(FPIHInputAction command)
Called when the player starts to move into any direction. This method will never contain any code and can easily been overridden.

Parameters:
command - the KeyCommand, that invoked this event

stopMovement

public void stopMovement(FPIHInputAction command)
Called when the player stopps to move into any direction. This method will never contain any code and can easily been overridden.

Parameters:
command - the KeyCommand, that invoked this event

startCrouch

public void startCrouch()
Makes the player crouch.


stopCrouch

public void stopCrouch()
Makes the player stand up from crouch.


startJump

public boolean startJump()
Called, when the player jumped.


updateViewInverse

public void updateViewInverse()
Calculates internal angle-values from the current View-rotation. Invoke this method, when the view has been rotated from something else than this class instance.


getBindingsManager

public final FPIHInputBindingsManager getBindingsManager()

Overrides:
getBindingsManager in class org.jagatoo.input.handlers.InputHandler<FPIHInputAction>

getStatesManager

public final FPIHInputStatesManager getStatesManager()

Overrides:
getStatesManager in class org.jagatoo.input.handlers.InputHandler<FPIHInputAction>

setThirdPersonOffset

public void setThirdPersonOffset(float tpDirectionX,
                                 float tpDirectionY,
                                 float tpDirectionZ,
                                 float distance)
Sets the third-person-offset in view-local coordinates.

Parameters:
tpDirectionX -
tpDirectionY -
tpDirectionZ -
distance -

setThirdPersonDistance

public void setThirdPersonDistance(float dist)

setThirdPersonOffset

public void setThirdPersonOffset(float tpOffsetX,
                                 float tpOffsetY,
                                 float tpOffsetZ)
Sets the third-person-offset in view-local coordinates.

Parameters:
tpOffsetX -
tpOffsetY -
tpOffsetZ -

setThirdPersonOffset

public void setThirdPersonOffset(org.openmali.vecmath2.Tuple3f tpDirection,
                                 float distance)
Sets the third-person-offset in view-local coordinates.

Parameters:
tpDirection -

setThirdPersonOffset

public void setThirdPersonOffset(org.openmali.vecmath2.Tuple3f tpOffset)
Sets the third-person-offset in view-local coordinates.

Parameters:
tpOffset -

getThirdPersonOffset

public final org.openmali.vecmath2.Vector3f getThirdPersonOffset()
Returns:
the third-person-offset in view-local coordinates.

setMinThirdPersonDistance

public void setMinThirdPersonDistance(float minDist)
Sets the minimum third-person distance.

Parameters:
minDist -

getMinThirdPersonDistance

public final float getMinThirdPersonDistance()
Returns:
the minimum third-person distance.

setMaxThirdPersonDistance

public void setMaxThirdPersonDistance(float maxDist)
Sets the maximum third-person distance.

Parameters:
maxDist -

getMaxThirdPersonDistance

public final float getMaxThirdPersonDistance()
Returns:
the maximum third-person distance.

setDiscreteThirdPersonStepSize

public void setDiscreteThirdPersonStepSize(float stepSize)
Sets the stepsize of discrete third-person offset manipulation.

Parameters:
stepSize -

getDiscreteThirdPersonStepSize

public final float getDiscreteThirdPersonStepSize()
Returns:
the stepsize of discrete third-person offset manipulation.

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() );


setMovementSpeed

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

Parameters:
speed - the new moving speed

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.

applyConfig

public void applyConfig(FPIHConfig config)
Applies the given FPIHConfig to this FirstPersonInputHandler. The config instance is stored in this object and is notified of any change.

Parameters:
config -

extractConfig

public void extractConfig(FPIHConfig config)
Extracts a FPIHConfig from this FirstPersonInputHandler.

Parameters:
config -

setPlayerCrouchSizeRegression

public void setPlayerCrouchSizeRegression(float sizeDelta)
Sets the value the view will we lowered with the player crouches.

Parameters:
sizeDelta - the value the view will be lowered on crouch

getPlayerCrouchSizeRegression

public float getPlayerCrouchSizeRegression()
Returns:
value the view will we lowered with the player crouches.

setMovementConstraints

public void setMovementConstraints(FPIHMovementConstraints constraints)
Sets the constraints to be used by this FirstPersonInputHandler.

Parameters:
constraints -

getMovementConstraints

public final FPIHMovementConstraints getMovementConstraints()
Returns:
the constraints to be used by this FirstPersonInputHandler.

setSuspendMask

public boolean setSuspendMask(int suspendMask)

Overrides:
setSuspendMask in class org.jagatoo.input.handlers.InputHandler<FPIHInputAction>

addAvatar

public void addAvatar(AvatarTransform at)
Adds an Avatar to the FPIH,
An Avatar always follows the main Transformable (View) possibly with an offset.

Parameters:
at -

removeAvatar

public void removeAvatar(AvatarTransform at)
Removes an Avatar from the FPIH,
An Avatar always follows the main Transformable (View) possibly with an offset.

Parameters:
at - the avatar Transformable

setPhysicsObject

public void setPhysicsObject(FPIHPhysics physicsObject)

getPhysicsObject

public final FPIHPhysics getPhysicsObject()

updateAvatars

protected void updateAvatars(long gameMicros,
                             long frameMicros,
                             Transformable view,
                             org.openmali.vecmath2.Vector3f viewTranslation,
                             float rotX,
                             float rotY,
                             org.openmali.vecmath2.Vector3f thirdPersonOffset)
This transforms additional Transformables to follow the main Transformable (View).

Parameters:
gameMicros -
view -
rotX -
rotY -
thirdPersonOffset -

update

public void update(long nanoSeconds,
                   float seconds,
                   long nanoFrame,
                   float frameSeconds)
            throws org.jagatoo.input.InputSystemException

Specified by:
update in class org.jagatoo.input.handlers.InputHandler<FPIHInputAction>
Throws:
org.jagatoo.input.InputSystemException

setInputSystem

public void setInputSystem(org.jagatoo.input.InputSystem inputSystem)

Overrides:
setInputSystem in class org.jagatoo.input.handlers.InputHandler<FPIHInputAction>

createInputStatesManager

protected FPIHInputStatesManager createInputStatesManager(org.jagatoo.input.managers.InputBindingsManager<FPIHInputAction> bindingsManager)
Overrides:
createInputStatesManager in class org.jagatoo.input.handlers.InputHandler<FPIHInputAction>

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          int resolutionX,
                                                          int resolutionY,
                                                          float mouseXSpeed,
                                                          float mouseYSpeed,
                                                          float movementSpeedForeward,
                                                          float movementSpeedBackward,
                                                          float movementSpeedSideward)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
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

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          int resolutionX,
                                                          int resolutionY,
                                                          float mouseXSpeed,
                                                          float mouseYSpeed,
                                                          float movementSpeed)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
movementSpeed - the new movement speed

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          org.openmali.types.twodee.Sized2iRO resolution,
                                                          float mouseXSpeed,
                                                          float mouseYSpeed,
                                                          float movementSpeedForeward,
                                                          float movementSpeedBackward,
                                                          float movementSpeedSideward)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolution - the Canvas3D to take as calculation basis for resolution-independent turn speed
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

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          org.openmali.types.twodee.Sized2iRO resolution,
                                                          float mouseXSpeed,
                                                          float mouseYSpeed,
                                                          float movementSpeed)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolution - the Canvas3D to take as calculation basis for resolution-independent turn speed
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
movementSpeed - the new movement speed

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          org.openmali.types.twodee.Sized2iRO resolution,
                                                          float mouseXSpeed,
                                                          float mouseYSpeed,
                                                          boolean mouseYInverted,
                                                          float movementSpeed)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolution - the Canvas3D to take as calculation basis for resolution-independent turn speed
mouseXSpeed - the new x-axis mouse speed
mouseYSpeed - the new y-axis mouse speed
mouseYInverted -
movementSpeed - the new movement speed

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          int resolutionX,
                                                          int resolutionY,
                                                          boolean mouseYInverted)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
mouseYInverted -

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          int resolutionX,
                                                          int resolutionY)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          org.openmali.types.twodee.Sized2iRO resolution,
                                                          boolean mouseYInverted)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolution - the Canvas to take as calculation basis for resolution-independent turn speed
mouseYInverted -

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          org.openmali.types.twodee.Sized2iRO resolution)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolution - the Canvas to take as calculation basis for resolution-independent turn speed

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          int resolutionX,
                                                          int resolutionY,
                                                          FPIHConfig config)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolutionX - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
resolutionY - the Canvas3D-width to take as calculation basis for resolution-independent turn speed
config -

createDefault

public static final FirstPersonInputHandler createDefault(Transformable view,
                                                          org.openmali.types.twodee.Sized2iRO resolution,
                                                          FPIHConfig config)
Creates a new FirstPersonInputHandler and applies default key-bindings.

Parameters:
view - the View to be used.
resolution - the Canvas to take as calculation basis for resolution-independent turn speed
config -