Package com.ardorcraft.control
Class WalkControl
java.lang.Object
com.ardorcraft.control.WalkControl
-
Constructor Summary
ConstructorDescriptionWalkControl
(PlayerBase player, LogicalLayer layer, ReadOnlyVector3 upAxis, UprightFPSMoveConfig moveConfigParam) -
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
void
enable()
double
double
double
protected void
move
(TwoInputStates state, double tpf) static void
removeTriggers
(LogicalLayer layer, WalkControl control) Deregister the triggers of the given FlyControl from the given LogicalLayer.protected void
rotate
(double dx, double dy) void
setKeyRotateSpeed
(double speed) void
setMouseRotateSpeed
(double speed) void
setMoveSpeed
(double speed) void
setUpAxis
(ReadOnlyVector3 upAxis) void
setupMouseTriggers
(LogicalLayer layer, boolean dragOnly) static WalkControl
setupTriggers
(PlayerBase player, LogicalLayer layer, ReadOnlyVector3 upAxis, boolean dragOnly)
-
Constructor Details
-
WalkControl
public WalkControl(PlayerBase player, LogicalLayer layer, ReadOnlyVector3 upAxis, UprightFPSMoveConfig moveConfigParam)
-
-
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
protected void rotate(double dx, double dy) -
setupTriggers
public static WalkControl setupTriggers(PlayerBase player, LogicalLayer layer, ReadOnlyVector3 upAxis, boolean dragOnly) - Parameters:
player
- the playerlayer
- 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 FlyControl object
-
removeTriggers
Deregister the triggers of the given FlyControl from the given LogicalLayer.- Parameters:
layer
- the logical layercontrol
- the FlyControl
-
setupMouseTriggers
-
setupKeyboardTriggers
-
getKeyTrigger
-
getMouseTrigger
-
enable
public void enable() -
disable
public void disable()
-