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.
| Argument | Type | Required | Description |
|---|---|---|---|
key | Yes | the movedkey | |
camera | Yes | the camera |
inMotion
Returns whether a movement is ongoing.
moveCamera
Moves the given camera, in the given direction, at the given speed.
| Argument | Type | Required | Description |
|---|---|---|---|
camera | Yes | the moved camera | |
direction | Yes | the direction of the movemnt | |
speed | Yes | the speed |
onKeyDown
Handles a keydown event.
| Argument | Type | Required | Description |
|---|---|---|---|
interactor | Yes | the interactor | |
renderer | Yes | the renderer | |
key | Yes | the key |
onKeyPress
Handles a keypress event.
| Argument | Type | Required | Description |
|---|---|---|---|
interactor | Yes | the interactor | |
renderer | Yes | the renderer | |
key | Yes | the key |
onKeyUp
Handles a keyup event.
| Argument | Type | Required | Description |
|---|---|---|---|
interactor | Yes | the interactor | |
renderer | Yes | the renderer | |
key | Yes | the 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.