Class CameraInputController

    • Field Detail

      • rotateButton

        public int rotateButton
        The button for rotating the camera.
      • rotateAngle

        public float rotateAngle
        The angle to rotate when moved the full width or height of the screen.
      • translateButton

        public int translateButton
        The button for translating the camera along the up/right plane
      • translateUnits

        public float translateUnits
        The units to translate the camera when moved the full width or height of the screen.
      • forwardButton

        public int forwardButton
        The button for translating the camera along the direction axis
      • activateKey

        public int activateKey
        The key which must be pressed to activate rotate, translate and forward or 0 to always activate.
      • activatePressed

        protected boolean activatePressed
        Indicates if the activateKey is currently being pressed.
      • alwaysScroll

        public boolean alwaysScroll
        Whether scrolling requires the activeKey to be pressed (false) or always allow scrolling (true).
      • scrollFactor

        public float scrollFactor
        The weight for each scrolled amount.
      • pinchZoomFactor

        public float pinchZoomFactor
        World units per screen size
      • autoUpdate

        public boolean autoUpdate
        Whether to update the camera after it has been changed.
      • target

        public Vector3 target
        The target to rotate around.
      • translateTarget

        public boolean translateTarget
        Whether to update the target on translation
      • forwardTarget

        public boolean forwardTarget
        Whether to update the target on forward
      • scrollTarget

        public boolean scrollTarget
        Whether to update the target on scroll
      • forwardKey

        public int forwardKey
      • forwardPressed

        protected boolean forwardPressed
      • backwardKey

        public int backwardKey
      • backwardPressed

        protected boolean backwardPressed
      • rotateRightKey

        public int rotateRightKey
      • rotateRightPressed

        protected boolean rotateRightPressed
      • rotateLeftKey

        public int rotateLeftKey
      • rotateLeftPressed

        protected boolean rotateLeftPressed
      • controlsInverted

        protected boolean controlsInverted
      • camera

        public Camera camera
        The camera.
      • button

        protected int button
        The current (first) button being pressed.
    • Method Detail

      • update

        public void update()
      • touchDown

        public boolean touchDown​(int screenX,
                                 int screenY,
                                 int pointer,
                                 int button)
        Description copied from interface: InputProcessor
        Called when the screen was touched or a mouse button was pressed. The button parameter will be Input.Buttons.LEFT on iOS.
        Specified by:
        touchDown in interface InputProcessor
        Overrides:
        touchDown in class GestureDetector
        Parameters:
        screenX - The x coordinate, origin is in the upper left corner
        screenY - The y coordinate, origin is in the upper left corner
        pointer - the pointer for the event.
        button - the button
        Returns:
        whether the input was processed
      • touchUp

        public boolean touchUp​(int screenX,
                               int screenY,
                               int pointer,
                               int button)
        Description copied from interface: InputProcessor
        Called when a finger was lifted or a mouse button was released. The button parameter will be Input.Buttons.LEFT on iOS.
        Specified by:
        touchUp in interface InputProcessor
        Overrides:
        touchUp in class GestureDetector
        pointer - the pointer for the event.
        button - the button
        Returns:
        whether the input was processed
      • setInvertedControls

        public void setInvertedControls​(boolean invertControls)
        Sets the CameraInputControllers' control inversion.
        Parameters:
        invertControls - Whether or not to invert the controls
      • process

        protected boolean process​(float deltaX,
                                  float deltaY,
                                  int button)
      • touchDragged

        public boolean touchDragged​(int screenX,
                                    int screenY,
                                    int pointer)
        Description copied from interface: InputProcessor
        Called when a finger or the mouse was dragged.
        Specified by:
        touchDragged in interface InputProcessor
        Overrides:
        touchDragged in class GestureDetector
        pointer - the pointer for the event.
        Returns:
        whether the input was processed
      • scrolled

        public boolean scrolled​(float amountX,
                                float amountY)
        Description copied from interface: InputProcessor
        Called when the mouse wheel was scrolled. Will not be called on iOS.
        Specified by:
        scrolled in interface InputProcessor
        Overrides:
        scrolled in class InputAdapter
        Parameters:
        amountX - the horizontal scroll amount, negative or positive depending on the direction the wheel was scrolled.
        amountY - the vertical scroll amount, negative or positive depending on the direction the wheel was scrolled.
        Returns:
        whether the input was processed.
      • zoom

        public boolean zoom​(float amount)
      • pinchZoom

        protected boolean pinchZoom​(float amount)
      • keyDown

        public boolean keyDown​(int keycode)
        Description copied from interface: InputProcessor
        Called when a key was pressed
        Specified by:
        keyDown in interface InputProcessor
        Overrides:
        keyDown in class InputAdapter
        Parameters:
        keycode - one of the constants in Input.Keys
        Returns:
        whether the input was processed
      • keyUp

        public boolean keyUp​(int keycode)
        Description copied from interface: InputProcessor
        Called when a key was released
        Specified by:
        keyUp in interface InputProcessor
        Overrides:
        keyUp in class InputAdapter
        Parameters:
        keycode - one of the constants in Input.Keys
        Returns:
        whether the input was processed