Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TrackballModifier

Math for camera rotation based on the trackball metaphor. The rotation computed by an initial (@see startRotate) and subsequent (@see updateRotate) event points and can be applied to a camera via an explicit update (@see update).

Hierarchy

Index

Constructors

constructor

Properties

Protected _camera

_camera: undefined | Camera = ...
see

camera

Protected _currentPoint

_currentPoint: vec2

Reference to the current point updating the camera modification.

Protected _initialPoint

_initialPoint: vec2

Reference to the initial point starting the camera modification.

Protected _reference

_reference: Camera = ...

Copy of a camera for ongoing camera modifications based on previous/initial camera settings.

Protected _rotation

_rotation: mat4 = ...

Current rotation matrix.

Protected _sensitivity

_sensitivity: number = ...

Static Protected Readonly DEFAULT_SENSITIVITY

DEFAULT_SENSITIVITY: 0.002 = 0.002

Accessors

camera

  • set camera(camera: undefined | Camera): void

sensitivity

  • get sensitivity(): number
  • set sensitivity(sensitivity: number): void

Methods

initiate

  • initiate(point: vec2): void
  • Initiate a new trackball rotation at a specific event position.

    Parameters

    • point: vec2

      Position of the current event to start the trackball rotation at.

    Returns void

process

  • process(point: vec2): void
  • Update the trackball rotation w.r.t. a specific event position.

    Parameters

    • point: vec2

      Position of the current event to continue/update the trackball rotation at.

    Returns void

update

  • update(): void