• Public
  • Public/Protected
  • All

Class Navigation

This navigation is merely a design template/recipe for more refined, specialized navigation and provides some basic, commonly used camera modifier such as turntable, first-person, as well as trackball. This implementation is also unfinished and will be continued as soon as possible (e.g., first-person navigation is not usable for now).

  • Refine and comment this class to be usable at least as common/most-basic navigation auxiliary.


  • Navigation





Protected _activeEvents

_activeEvents: Map<number, PointerEvent>

This keeps track of all events that are currently interacting with the canvas. It maps from pointer id to the currecnt position.

Protected _alwaysRotateOnMove

_alwaysRotateOnMove: boolean = false

Specifies, whether or not rotation mode should be invoked on any move event, regardless of buttons.

Protected _camera

_camera: Camera


Protected _eventHandler

_eventHandler: EventHandler

Even handler used to forward/map events to specific camera modifiers.

Protected _firstPerson

_firstPerson: undefined | FirstPersonModifier

First person camera modifier.

Protected _invalidate

_invalidate: Invalidate

The navigation's invalidation callback. This should usually be setup by the owning renderer and invoke the same callback the renderer has been given by the canvas. This invalidation is required, when continuous rendering is not present, events might cause need for new rendering requests.

Protected _lastInteractionTime

_lastInteractionTime: number

Keep track of the latest interaction in order to allow a cooldown before the next interaction is allowed.

Protected _mode

_mode: undefined | Modes

Identifies the active camera modifier.

Protected _pan

Pan camera modifier.

Protected _pinch

Pinch camera modifier.

Protected _rotationMetaphor

_rotationMetaphor: RotationMetaphor

Currently active metaphor.

Protected _trackball

_trackball: undefined | TrackballModifier

Trackball camera modifier.

Protected _turntable

_turntable: undefined | TurntableModifier

Turntable camera modifier.

Protected _wheelZoom

_wheelZoom: WheelZoomModifier

Wheel zoom modifier.



  • set camera(camera: Camera): void



Protected getPrimaryEvent

  • getPrimaryEvent(events: PointerEvent[]): undefined | PointerEvent

Protected mode

  • mode(): undefined | Modes
  • Resolves the event to camera modifier mapping by returning the responsible camera modifier.

    Returns undefined | Modes

Protected onPointerCancel

  • onPointerCancel(latests: PointerEvent[], previous: PointerEvent[]): void

Protected onPointerDown

  • onPointerDown(latests: PointerEvent[], previous: PointerEvent[]): void

Protected onPointerEnter

  • onPointerEnter(latests: PointerEvent[], previous: PointerEvent[]): void

Protected onPointerLeave

  • onPointerLeave(latests: PointerEvent[], previous: PointerEvent[]): void

Protected onPointerMove

  • onPointerMove(latests: PointerEvent[], previous: PointerEvent[]): void

Protected onPointerUp

  • onPointerUp(latests: PointerEvent[], previous: PointerEvent[]): void

Protected onWheel

  • onWheel(latests: WheelEvent[], previous: WheelEvent[]): void

Protected pan

  • pan(start: boolean): void

Protected pinch

  • pinch(start: boolean): void

Protected resolveMultiTouch

  • resolveMultiTouch(): undefined | Modes

Protected rotate

  • rotate(start: boolean): void


  • update(): void
  • Update should invoke navigation specific event processing. When using, e.g., an event handler, the event handlers update method should be called in order to have navigation specific event processing invoked.

    Returns void