com.jme.input.action
Class MouseLook
java.lang.Object
com.jme.input.action.InputAction
com.jme.input.action.MouseInputAction
com.jme.input.action.MouseLook
- All Implemented Interfaces:
- InputActionInterface
public class MouseLook
- extends MouseInputAction
MouseLook defines a mouse action that detects mouse movement
and converts it into camera rotations and camera tilts. Allows for looking
to be enabled only on button press, as well as defining which button activates
the looking.
- Version:
- $Id: MouseLook.java 4569 2009-08-07 00:10:26Z skye.book $
- Author:
- Mark Powell
|
Constructor Summary |
MouseLook(Mouse mouse,
Camera camera,
float speed)
Constructor creates a new MouseLook object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MouseLook
public MouseLook(Mouse mouse,
Camera camera,
float speed)
- Constructor creates a new
MouseLook object. It takes the
mouse, camera and speed of the looking.
- Parameters:
mouse - the mouse to calculate view changes.camera - the camera to move.speed - the speed at which to alter the camera.
setLockAxis
public void setLockAxis(Vector3f lockAxis)
setLockAxis sets the axis that should be locked down. This
prevents "rolling" about a particular axis. Typically, this is set to the
mouse's up vector. Note this is only a shallow copy.
- Parameters:
lockAxis - the axis that should be locked down to prevent rolling.
getLockAxis
public Vector3f getLockAxis()
- Returns the axis that is currently locked.
- Returns:
- The currently locked axis
- See Also:
setLockAxis(com.jme.math.Vector3f)
setSpeed
public void setSpeed(float speed)
setSpeed sets the speed of the mouse look.
- Overrides:
setSpeed in class InputAction
- Parameters:
speed - the speed of the mouse look.
performAction
public void performAction(InputActionEvent evt)
performAction checks for any movement of the mouse, and
calls the appropriate method to alter the camera's orientation when
applicable.
- Parameters:
evt - the event that triggered the perform action method.- See Also:
InputActionInterface.performAction(InputActionEvent)
getMouseButtonForRequired
public int getMouseButtonForRequired()
- Returns:
- the mouseButtonForRequired
setMouseButtonForRequired
public void setMouseButtonForRequired(int mouseButtonForRequired)
- Parameters:
mouseButtonForRequired - the mouseButtonForRequired to set
isButtonPressRequired
public boolean isButtonPressRequired()
setButtonPressRequired
public void setButtonPressRequired(boolean buttonPressRequired)
Copyright 2003-2009 jMonkeyEngine