Package com.ardor3d.input.control
Class FirstPersonControl
java.lang.Object
com.ardor3d.input.control.FirstPersonControl
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected double
protected InputTrigger
protected double
protected double
protected double
protected InputTrigger
protected double
protected final Vector3
protected final Matrix3
protected final Vector3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
double
double
double
double
boolean
protected void
move
(Camera camera, KeyboardState kb, double tpf) static void
removeTriggers
(LogicalLayer layer, FirstPersonControl control) Unregister the triggers of the given FirstPersonControl from the given LogicalLayer.protected void
void
setClampVerticalAngle
(boolean clampVerticalAngle) void
setKeyRotateSpeed
(double speed) void
setMaxVerticalAngle
(double maxVerticalAngle) void
setMinVerticalAngle
(double minVerticalAngle) void
setMouseRotateSpeed
(double speed) void
setMoveSpeed
(double speed) void
setUpAxis
(ReadOnlyVector3 upAxis) void
setupMouseTriggers
(LogicalLayer layer, boolean dragOnly) static FirstPersonControl
setupTriggers
(LogicalLayer layer, ReadOnlyVector3 upAxis, boolean dragOnly)
-
Field Details
-
_upAxis
-
_mouseRotateSpeed
protected double _mouseRotateSpeed -
_moveSpeed
protected double _moveSpeed -
_keyRotateSpeed
protected double _keyRotateSpeed -
_workerMatrix
-
_workerStoreA
-
_mouseTrigger
-
_keyTrigger
-
_clampVerticalAngle
protected boolean _clampVerticalAngle -
_minVerticalAngle
protected double _minVerticalAngle -
_maxVerticalAngle
protected double _maxVerticalAngle
-
-
Constructor Details
-
FirstPersonControl
-
-
Method Details
-
getUpAxis
-
setUpAxis
-
getMouseRotateSpeed
public double getMouseRotateSpeed() -
setMouseRotateSpeed
public void setMouseRotateSpeed(double speed) -
getMoveSpeed
public double getMoveSpeed() -
setMoveSpeed
public void setMoveSpeed(double speed) -
getKeyRotateSpeed
public double getKeyRotateSpeed() -
setKeyRotateSpeed
public void setKeyRotateSpeed(double speed) -
move
-
rotate
-
setupTriggers
public static FirstPersonControl setupTriggers(LogicalLayer layer, ReadOnlyVector3 upAxis, boolean dragOnly) - Parameters:
layer
- the logical layer to register withupAxis
- the up axis of the cameradragOnly
- if true, mouse input will only rotate the camera if one of the mouse buttons (left, center or right) is down.- Returns:
- a new FirstPersonControl object
-
removeTriggers
Unregister the triggers of the given FirstPersonControl from the given LogicalLayer.- Parameters:
layer
- the logical layercontrol
- the first person control
-
setupMouseTriggers
-
setupKeyboardTriggers
-
getKeyTrigger
-
getMouseTrigger
-
isClampVerticalAngle
public boolean isClampVerticalAngle() -
setClampVerticalAngle
public void setClampVerticalAngle(boolean clampVerticalAngle) - Parameters:
clampVerticalAngle
- if true, the vertical angle of the camera is locked between the minimum and maximum angles (default is [-60, 60])
-
getMinVerticalAngle
public double getMinVerticalAngle() -
setMinVerticalAngle
public void setMinVerticalAngle(double minVerticalAngle) - Parameters:
minVerticalAngle
- the new minimum angle, in radians, to clamp our vertical angle to. Defaults to -60 degrees (in radians). Must be less than the max angle. Has no effect unless clampVerticalAngle is true.- See Also:
-
getMaxVerticalAngle
public double getMaxVerticalAngle() -
setMaxVerticalAngle
public void setMaxVerticalAngle(double maxVerticalAngle) - Parameters:
maxVerticalAngle
- the new maximum angle, in radians, to clamp our vertical angle to. Defaults to +60 degrees (in radians). Must be less than the max angle. Has no effect unless clampVerticalAngle is true.- See Also:
-