apps.mt3dmaps.orbittest
Class OrbitAction

java.lang.Object
  extended by com.jme.input.action.InputAction
      extended by apps.mt3dmaps.orbittest.OrbitAction
All Implemented Interfaces:
com.jme.input.action.InputActionInterface

public class OrbitAction
extends com.jme.input.action.InputAction

Orbits the camera around a specified target position and also handles translation of the target position.

Author:
Andrew Carter

Constructor Summary
OrbitAction(com.jme.renderer.Camera camera)
          Constructor.
 
Method Summary
 boolean getEnabled()
          Returns the enabled state of this input action.
 com.jme.math.Vector3f getTargetPosition()
          Returns a copy of the target position in world coordinates.
 void performAction(com.jme.input.action.InputActionEvent evt)
          Handles camera updates based on input events.
 void setEnabled(boolean enabled)
          Sets the enabled state of this input action.
 void setSpeed(float speed)
          setSpeed sets the sensitivity of the input.
 void setTargetPosition(com.jme.math.Vector3f position, boolean updateCamera)
          Sets the orbit target position in world coordinates.
 void setWheelDirection(boolean reversed)
          Reverse the direction of the mouse wheel input.
 
Methods inherited from class com.jme.input.action.InputAction
getSpeed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrbitAction

public OrbitAction(com.jme.renderer.Camera camera)
Constructor.

Parameters:
camera - That camera that will be controlled by this input handler.
Method Detail

getEnabled

public boolean getEnabled()
Returns the enabled state of this input action.

Returns:
True if enabled

getTargetPosition

public com.jme.math.Vector3f getTargetPosition()
Returns a copy of the target position in world coordinates.

Returns:
Cloned target position

performAction

public void performAction(com.jme.input.action.InputActionEvent evt)
Handles camera updates based on input events.

Parameters:
evt - the evt

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled state of this input action.

Parameters:
enabled - True to enable

setSpeed

public void setSpeed(float speed)
setSpeed sets the sensitivity of the input.

Overrides:
setSpeed in class com.jme.input.action.InputAction
Parameters:
speed - sensitivity of the input.

setTargetPosition

public void setTargetPosition(com.jme.math.Vector3f position,
                              boolean updateCamera)
Sets the orbit target position in world coordinates.

Parameters:
position - Values are set from this position
updateCamera - Forces the camera to update its direction

setWheelDirection

public void setWheelDirection(boolean reversed)
Reverse the direction of the mouse wheel input. The mouse wheel trigger delta is opposite when used with a canvas.

Parameters:
reversed - the new wheel direction