com.jme.input.action
Class KeyNodeRotateLeftAction
java.lang.Object
com.jme.input.action.InputAction
com.jme.input.action.KeyInputAction
com.jme.input.action.KeyNodeRotateLeftAction
- All Implemented Interfaces:
- InputActionInterface
public class KeyNodeRotateLeftAction
- extends KeyInputAction
KeyNodeRotateLeftAction
rotates a node to the left. 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: KeyNodeRotateLeftAction.java,v 1.12 2004/08/22 02:00:34 cep21
Exp $
- Author:
- Mark Powell
Constructor Summary |
KeyNodeRotateLeftAction(Spatial node,
float speed)
Constructor instantiates a new KeyNodeRotateLeftAction
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KeyNodeRotateLeftAction
public KeyNodeRotateLeftAction(Spatial node,
float speed)
- Constructor instantiates a new
KeyNodeRotateLeftAction
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.
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)