com.jme.input.action
Class KeyNodeRotateRightAction

java.lang.Object
  extended by com.jme.input.action.InputAction
      extended by com.jme.input.action.KeyInputAction
          extended by com.jme.input.action.KeyNodeRotateRightAction
All Implemented Interfaces:
InputActionInterface

public class KeyNodeRotateRightAction
extends KeyInputAction

KeyNodeRotateRightAction rotates a node to the right. The axis of rotation is dependant on the setting of the lock axis. If no lock axis is set, the node rotates about it's y-axis. This will allow the node to roll. However, to prevent rolling, setting the lock axis to the world's y-axis (or any desired axis for that matter), will cause the node to rotate about the world. The locking of the axis is particularly useful for control schemes similar to first person shooters.

Version:
$Id: KeyNodeRotateRightAction.java,v 1.12 2004/08/22 02:00:34 cep21 Exp $
Author:
Mark Powell

Field Summary
 
Fields inherited from class com.jme.input.action.InputAction
speed
 
Constructor Summary
KeyNodeRotateRightAction(Spatial node, float speed)
          Constructor instantiates a new KeyNodeRotateRightAction object using the node and speed parameters for it's attributes.
 
Method Summary
 void performAction(InputActionEvent evt)
          performAction rotates the camera about it's up vector or lock axis at a speed of movement speed * time.
 void setLockAxis(Vector3f lockAxis)
          setLockAxis allows a certain axis to be locked, meaning the camera will always be within the plane of the locked axis.
 
Methods inherited from class com.jme.input.action.InputAction
getSpeed, setSpeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyNodeRotateRightAction

public KeyNodeRotateRightAction(Spatial node,
                                float speed)
Constructor instantiates a new KeyNodeRotateRightAction object using the node and speed parameters for it's attributes.

Parameters:
node - the node that will be affected by this action.
speed - the speed at which the node can move.
Method Detail

setLockAxis

public void setLockAxis(Vector3f lockAxis)
setLockAxis allows a certain axis to be locked, meaning the camera will always be within the plane of the locked axis. For example, if the node is a first person camera, the user might lock the node's up vector. This will keep the node vertical with the ground.

Parameters:
lockAxis - the axis to lock - should be unit length (normalized).

performAction

public void performAction(InputActionEvent evt)
performAction rotates the camera about it's up vector or lock axis at a speed of movement speed * time. Where time is the time between frames and 1 corresponds to 1 second.

Parameters:
evt - the event that triggered the perform action method.
See Also:
InputActionInterface.performAction(InputActionEvent)