Class UprightFlyControlTriggers

java.lang.Object
com.ardorcraft.control.UprightFlyControlTriggers
All Implemented Interfaces:
ITriggerGroup

public class UprightFlyControlTriggers extends Object implements ITriggerGroup
Triggers for flying that enforce an upright position.
  • 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 update
      upAxisParam - The up axis for the player
      mouseLookDragOnly - Whether the player needs to press a mouse button to turn.
      moveConfigParam - The keys and possibly mouse buttons to manage movement.
  • Method Details

    • AddToLayer

      public void AddToLayer(LogicalLayer layer)
      Add the triggers to the logical layer
      Specified by:
      AddToLayer in interface ITriggerGroup
      Parameters:
      layer - The logical layer to add the triggers to.
    • RemoveFromLayer

      public void RemoveFromLayer(LogicalLayer layer)
      Remove the triggers from the logical layer
      Specified by:
      RemoveFromLayer in interface ITriggerGroup
      Parameters:
      layer - The logical layer to remove the triggers from.
    • move

      protected void move(TwoInputStates state, double tpf)
      Move the player according to the triggers
      Parameters:
      state - The input state.
      tpf - The time per frame.
    • turn

      protected void turn(TwoInputStates state, double tpf)
      Turns the player
      Parameters:
      state - The input state for the turn
      tpf - 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 rotate
      dy - The y angle to rotate