Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FirstPersonModifier

Math for camera modification based on the first person metaphor.

Hierarchy

Index

Properties

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 _reference

_reference: Camera = new Camera()

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

Protected _rotation

_rotation: mat4 = mat4.create()

Current rotation matrix.

Protected _sensitivity

_sensitivity: number = FirstPersonModifier.DEFAULT_SENSITIVITY

Static Protected DEFAULT_SENSITIVITY

DEFAULT_SENSITIVITY: 0.0008 = 0.0008

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 camera modification at a specific event position.

    Parameters

    • point: vec2

      Position of the current event to start the modification at.

    Returns void

process

  • process(point: vec2, movement?: vec2): void
  • Update the ... .r.t. a specific event position.

    Parameters

    • point: vec2

      Position of the current event used to update the yaw and pitch.

    • Optional movement: vec2

    Returns void

update

  • update(): void