Package com.ardorcraft.control
Class UprightFlyControlTriggers
java.lang.Object
com.ardorcraft.control.UprightFlyControlTriggers
- All Implemented Interfaces:
ITriggerGroup
Triggers for flying that enforce
an upright position.
-
Constructor Summary
ConstructorDescriptionUprightFlyControlTriggers
(PlayerBase playerParam, ReadOnlyVector3 upAxisParam, boolean mouseLookDragOnly, UprightFPSMoveConfig moveConfigParam) Creates a trigger set for flying in an upright first person shooter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
AddToLayer
(LogicalLayer layer) Add the triggers to the logical layerprotected void
move
(TwoInputStates state, double tpf) Move the player according to the triggersvoid
RemoveFromLayer
(LogicalLayer layer) Remove the triggers from the logical layerprotected void
rotate
(double dx, double dy) Rotate the player by the desired amountsprotected void
turn
(TwoInputStates state, double tpf) Turns the player
-
Constructor Details
-
UprightFlyControlTriggers
public UprightFlyControlTriggers(PlayerBase playerParam, ReadOnlyVector3 upAxisParam, boolean mouseLookDragOnly, UprightFPSMoveConfig moveConfigParam) Creates a trigger set for flying in an upright first person shooter.- Parameters:
playerParam
- The player object to updateupAxisParam
- The up axis for the playermouseLookDragOnly
- Whether the player needs to press a mouse button to turn.moveConfigParam
- The keys and possibly mouse buttons to manage movement.
-
-
Method Details
-
AddToLayer
Add the triggers to the logical layer- Specified by:
AddToLayer
in interfaceITriggerGroup
- Parameters:
layer
- The logical layer to add the triggers to.
-
RemoveFromLayer
Remove the triggers from the logical layer- Specified by:
RemoveFromLayer
in interfaceITriggerGroup
- Parameters:
layer
- The logical layer to remove the triggers from.
-
move
Move the player according to the triggers- Parameters:
state
- The input state.tpf
- The time per frame.
-
turn
Turns the player- Parameters:
state
- The input state for the turntpf
- The time per frame for the last 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
-