Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TurntableModifier

Math for camera rotation based on the turntable 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). In contrast to the trackball, this metaphor is usually less confusing for non-professionals.

Hierarchy

Index

Properties

Protected _azimuth

_azimuth: number

Protected _camera

_camera: Camera | undefined = undefined
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 _maxAzimuth

_maxAzimuth: number | undefined = +Math.PI * 0.5 - 1e-4

Protected _minAzimuth

_minAzimuth: number | undefined = -Math.PI * 0.5 + 1e-4

Protected _reference

_reference: Camera = new Camera()

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

Protected _rotation

_rotation: mat4 = m4()

Current rotation matrix.

Protected _sensitivity

_sensitivity: number = TurntableModifier.DEFAULT_SENSITIVITY

Protected _xAxisScreenSpace

_xAxisScreenSpace: vec3 = v3()

Static Protected DEFAULT_SENSITIVITY

DEFAULT_SENSITIVITY: 0.002 = 0.002

Accessors

camera

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

sensitivity

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

Methods

initiate

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

    Parameters

    • point: vec2

      Position of the current event to derive the magnitude for rotation from.

    Returns void

process

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

    Parameters

    • point: vec2

      Position of the current event to derive the magnitude for rotation from.

    Returns void

update

  • update(): void