Class Camera

The camera class

Hierarchy

  • Camera

Constructors

Properties

aspect: number = 1
displaySize: Vector = ...
matrix: Mat4 = ...
pos: Vector = ...
zoom: number = 1

Methods

  • Returns the camera matrix

    Returns Mat4

    The camera matrix

  • Converts a vector (position) in screen space into world space

    Parameters

    Returns Vector

    The Vector converted to World space

  • Sets the display size of the camera. Must be called whenever the canvas is resized.

    Parameters

    • displaySize: Vector

      The display size of the camera

    Returns void

  • Sets the zoom level of the camera

    Parameters

    • zoom: number

      The zoom level of the camera

    Returns void

  • Translates the camera

    Parameters

    • delta: Vector

      The amount to translate the camera by

    Returns void

  • Converts a vector (position) in world space into screen space

    Parameters

    Returns Vector

    The Vector converted to Screen space

Generated using TypeDoc