Package com.ardorcraft.control
Class WalkControlTriggers
java.lang.Object
com.ardorcraft.control.WalkControlTriggers
- All Implemented Interfaces:
ITriggerGroup
Set of triggers to use for walking.
-
Constructor Summary
ConstructorDescriptionWalkControlTriggers
(PlayerBase playerParam, ReadOnlyVector3 upAxisParam, boolean mouseLookDragOnly, UprightFPSMoveConfig moveConfigParam) Constructor for the WalkControlTriggers -
Method Summary
Modifier and TypeMethodDescriptionvoid
AddToLayer
(LogicalLayer layer) Add the triggers to the specified logical layer.protected void
move
(TwoInputStates state, double tpf) Move in response to the controlsvoid
RemoveFromLayer
(LogicalLayer layer) Removes the trigger from the specified logival layerprotected void
rotate
(double dx, double dy) Rotate the player by the desired amountsprotected void
turn
(TwoInputStates state, double tpf) Turn the player in response to the input state.
-
Constructor Details
-
WalkControlTriggers
public WalkControlTriggers(PlayerBase playerParam, ReadOnlyVector3 upAxisParam, boolean mouseLookDragOnly, UprightFPSMoveConfig moveConfigParam) Constructor for the WalkControlTriggers- Parameters:
playerParam
- The player for the triggers to updateupAxisParam
- The up axis of the playermouseLookDragOnly
- True if mouse look requires dragingmoveConfigParam
- The keys for for moving and turning.
-
-
Method Details
-
move
Move in response to the controls- Parameters:
state
- The input statetpf
- The time per frame.
-
turn
Turn the player in response to the input state.- Parameters:
state
- The input statetpf
- The time per frame.
-
rotate
protected void rotate(double dx, double dy) Rotate the player by the desired amounts- Parameters:
dx
- The x angle to rotatedy
- The y angle to rotate
-
AddToLayer
Description copied from interface:ITriggerGroup
Add the triggers to the specified logical layer.- Specified by:
AddToLayer
in interfaceITriggerGroup
- Parameters:
layer
- The logical layer to add the triggers to.
-
RemoveFromLayer
Description copied from interface:ITriggerGroup
Removes the trigger from the specified logival layer- Specified by:
RemoveFromLayer
in interfaceITriggerGroup
- Parameters:
layer
- The logical layer to remove the triggers from.
-