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

getInteractor ​

Get the interactor associated with the current movement.

getMoveBackwardKeys ​

Get the keys that trigger a backward movement.

getMoveDownKeys ​

Get the keys that trigger a downward movement.

getMoveForwardKeys ​

Get the keys that trigger a forward movement.

getMoveLeftKeys ​

Get the keys that trigger a leftward movement.

getMoveRightKeys ​

Get the keys that trigger a rightward movement.

getMoveUpKeys ​

Get the keys that trigger an upward movement.

getMovementSpeed ​

Get the movement speed.

getRenderer ​

Get the renderer associated with the current movement.

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.

setInteractor ​

Set the interactor associated with the current movement.

ArgumentTypeRequiredDescription
interactorYes

setMoveBackwardKeys ​

Set the keys that trigger a backward movement.

ArgumentTypeRequiredDescription
keysYes

setMoveDownKeys ​

Set the keys that trigger a downward movement.

ArgumentTypeRequiredDescription
keysYes

setMoveForwardKeys ​

Set the keys that trigger a forward movement.

ArgumentTypeRequiredDescription
keysYes

setMoveLeftKeys ​

Set the keys that trigger a leftward movement.

ArgumentTypeRequiredDescription
keysYes

setMoveRightKeys ​

Set the keys that trigger a rightward movement.

ArgumentTypeRequiredDescription
keysYes

setMoveUpKeys ​

Set the keys that trigger an upward movement.

ArgumentTypeRequiredDescription
keysYes

setMovementSpeed ​

Set the movement speed.

ArgumentTypeRequiredDescription
speedYes

setRenderer ​

Set the renderer associated with the current movement.

ArgumentTypeRequiredDescription
rendererYes

startMovement ​

Initialize a movement of the current camera.