Options
All
  • Public
  • Public/Protected
  • All
Menu

This class represents a FreeFloatingCamera in 3D space.

Hierarchy

  • Camera

Index

Constructors

constructor

  • Parameters

    • Default value position: Vector3 | Vector4 = new Vector3(0, 0, 50)
    • Default value direction: Vector3 | Vector4 = new Vector3(0, 0, -1)
    • Default value up: Vector3 | Vector4 = new Vector3(0, 1, 0)
    • Default value fov: number = (Math.PI / 180) * 45

    Returns Camera

Properties

Private changed

changed: boolean

Flag to check if the cameraparameters have changed.

direction

direction: Vector4

The dircetion of the view of the camera.

fov

fov: number

Holds the fiel of view parameter in radians.

pitch

pitch: number

The rotation around the x-axis in radians.

position

position: Vector4

The position of the camera.

up

The up direction of the camera.

yaw

yaw: number

The rotation around the y-axis in radians.

Methods

getLookAt

  • Returns a view Matrix of the camera.

    Returns Matrix4

getPerspective

  • getPerspective(width: number, height: number, near: number, far: number): Matrix4
  • Creates a Perspectivematrix with the parameters of the camera.

    Parameters

    • width: number

      The width of the canvas.

    • height: number

      The height of the canvas.

    • near: number

      The nearest value to be shown.

    • far: number

      The farrest value to be shown.

    Returns Matrix4

hasChanged

  • hasChanged(): boolean
  • Method to check if the camera has changed since the last check. Used for raycreation, rays are only created anew after the camera changed.

    Returns boolean

Private registerKeys

  • registerKeys(): void
  • Registers the keys for the FreeFlightCamera as mentioned in the documentation landingpage.

    Returns void

Generated using TypeDoc