public class CameraInputController extends GestureDetector
| Modifier and Type | Class and Description |
|---|---|
protected static class |
CameraInputController.CameraGestureListener |
GestureDetector.GestureAdapter, GestureDetector.GestureListener| Modifier and Type | Field and Description |
|---|---|
int |
activateKey
The key which must be pressed to activate rotate, translate and forward or 0 to always activate.
|
protected boolean |
activatePressed
Indicates if the activateKey is currently being pressed.
|
boolean |
alwaysScroll
Whether scrolling requires the activeKey to be pressed (false) or always allow scrolling (true).
|
boolean |
autoUpdate
Whether to update the camera after it has been changed.
|
int |
backwardKey |
protected boolean |
backwardPressed |
protected int |
button
The current (first) button being pressed.
|
Camera |
camera
The camera.
|
int |
forwardButton
The button for translating the camera along the direction axis
|
int |
forwardKey |
protected boolean |
forwardPressed |
boolean |
forwardTarget
Whether to update the target on forward
|
protected CameraInputController.CameraGestureListener |
gestureListener |
float |
pinchZoomFactor
World units per screen size
|
float |
rotateAngle
The angle to rotate when moved the full width or height of the screen.
|
int |
rotateButton
The button for rotating the camera.
|
int |
rotateLeftKey |
protected boolean |
rotateLeftPressed |
int |
rotateRightKey |
protected boolean |
rotateRightPressed |
float |
scrollFactor
The weight for each scrolled amount.
|
boolean |
scrollTarget
Whether to update the target on scroll
|
Vector3 |
target
The target to rotate around.
|
int |
translateButton
The button for translating the camera along the up/right plane
|
boolean |
translateTarget
Whether to update the target on translation
|
float |
translateUnits
The units to translate the camera when moved the full width or height of the screen.
|
| Modifier | Constructor and Description |
|---|---|
|
CameraInputController(Camera camera) |
protected |
CameraInputController(CameraInputController.CameraGestureListener gestureListener,
Camera camera) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
keyDown(int keycode)
Called when a key was pressed
|
boolean |
keyUp(int keycode)
Called when a key was released
|
protected boolean |
pinchZoom(float amount) |
protected boolean |
process(float deltaX,
float deltaY,
int button) |
boolean |
scrolled(int amount)
Called when the mouse wheel was scrolled.
|
boolean |
touchDown(int screenX,
int screenY,
int pointer,
int button)
Called when the screen was touched or a mouse button was pressed.
|
boolean |
touchDragged(int screenX,
int screenY,
int pointer)
Called when a finger or the mouse was dragged.
|
boolean |
touchUp(int screenX,
int screenY,
int pointer,
int button)
Called when a finger was lifted or a mouse button was released.
|
void |
update() |
boolean |
zoom(float amount) |
cancel, invalidateTapSquare, isLongPressed, isLongPressed, isPanning, reset, setLongPressSeconds, setMaxFlingDelay, setTapCountInterval, setTapSquareSize, touchDown, touchDragged, touchUpkeyTyped, mouseMovedpublic int rotateButton
public float rotateAngle
public int translateButton
public float translateUnits
public int forwardButton
public int activateKey
protected boolean activatePressed
public boolean alwaysScroll
public float scrollFactor
public float pinchZoomFactor
public boolean autoUpdate
public Vector3 target
public boolean translateTarget
public boolean forwardTarget
public boolean scrollTarget
public int forwardKey
protected boolean forwardPressed
public int backwardKey
protected boolean backwardPressed
public int rotateRightKey
protected boolean rotateRightPressed
public int rotateLeftKey
protected boolean rotateLeftPressed
public Camera camera
protected int button
protected final CameraInputController.CameraGestureListener gestureListener
protected CameraInputController(CameraInputController.CameraGestureListener gestureListener, Camera camera)
public CameraInputController(Camera camera)
public void update()
public boolean touchDown(int screenX,
int screenY,
int pointer,
int button)
InputProcessorInput.Buttons.LEFT on iOS.touchDown in interface InputProcessortouchDown in class GestureDetectorscreenX - The x coordinate, origin is in the upper left cornerscreenY - The y coordinate, origin is in the upper left cornerpointer - the pointer for the event.button - the buttonpublic boolean touchUp(int screenX,
int screenY,
int pointer,
int button)
InputProcessorInput.Buttons.LEFT on iOS.touchUp in interface InputProcessortouchUp in class GestureDetectorpointer - the pointer for the event.button - the buttonprotected boolean process(float deltaX,
float deltaY,
int button)
public boolean touchDragged(int screenX,
int screenY,
int pointer)
InputProcessortouchDragged in interface InputProcessortouchDragged in class GestureDetectorpointer - the pointer for the event.public boolean scrolled(int amount)
InputProcessorscrolled in interface InputProcessorscrolled in class InputAdapteramount - the scroll amount, -1 or 1 depending on the direction the wheel was scrolled.public boolean zoom(float amount)
protected boolean pinchZoom(float amount)
public boolean keyDown(int keycode)
InputProcessorkeyDown in interface InputProcessorkeyDown in class InputAdapterkeycode - one of the constants in Input.Keyspublic boolean keyUp(int keycode)
InputProcessorkeyUp in interface InputProcessorkeyUp in class InputAdapterkeycode - one of the constants in Input.Keys