Skip to content

KeyboardCameraManipulator ​

Methods ​

calculateCurrentDirection ​

Update active camera direction, depending on currently pressed keys.

endMovement ​

Cancel any ongoing camera movement.

getDirectionFromKey ​

Returns the direction vector of the given camera for the given key.

ArgumentTypeRequiredDescription
keyYesthe movedkey
cameraYesthe camera

inMotion ​

Returns whether a movement is ongoing.

moveCamera ​

Moves the given camera, in the given direction, at the given speed.

ArgumentTypeRequiredDescription
cameraYesthe moved camera
directionYesthe direction of the movemnt
speedYesthe speed

onKeyDown ​

Handles a keydown event.

ArgumentTypeRequiredDescription
interactorYesthe interactor
rendererYesthe renderer
keyYesthe key

onKeyPress ​

Handles a keypress event.

ArgumentTypeRequiredDescription
interactorYesthe interactor
rendererYesthe renderer
keyYesthe key

onKeyUp ​

Handles a keyup event.

ArgumentTypeRequiredDescription
interactorYesthe interactor
rendererYesthe renderer
keyYesthe key

resetMovementSpeed ​

Reset the movement speed to be proportional to the longest length of the renderer's bounds.

startMovement ​

Initialize a movement of the current camera.