Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Camera

Creates camera object.

class
constructor

Hierarchy

  • Camera

Index

Constructors

constructor

Properties

Private _position

_position: Vector3 = new Vector3(0, 400, 500)

animatedMoving

animatedMoving: Vector3 = new Vector3(0, 0, 0)

Vector3 for animated

collisionBox

collisionBox: CollisionBox = new CollisionBox()

Collision box for camera.

collisions

collisions: boolean = true

True if camera have collisions.

engine

engine: Engine

fieldOfView

fieldOfView: number = 90

Field of view for drawing in angles.

fieldOfViewRad

fieldOfViewRad: number = Math.degToRad(90)

Field of view in radians.

inverseMatrix

inverseMatrix: Array<number> = Matrixes.unit()

Inverse matrix of this camera.

inverseRotationMatrix

inverseRotationMatrix: Array<number> = Matrixes.unit()

Inverse matrix of this camera rotation.

matrix

matrix: Array<number> = Matrixes.unit()

Matrix of camera.

moved

moved: boolean = false

True if camera move.

moving

moving: Vector3 = new Vector3(0, 0, 0)

Array of moving values for camera for frame.

range

range: number = 20000

Set range of camera for view.

default

20000

rotation

rotation: Vector3 = new Vector3(0, 0, 0)

Camera rotation.

readonly

rotationMatrix

rotationMatrix: Array<number> = Matrixes.unit()

Rotation matrix of this camera.

Accessors

position

Methods

computeMatrix

  • computeMatrix(): void
  • Compute camera matrix with rotation, positions.

    Returns void

move

  • move(x: number, y: number, z: number): void
  • Move camera.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

moveAnimate

  • moveAnimate(x: number, y: number, z: number, time?: number): void
  • Smooth moving camera.

    Parameters

    • x: number
    • y: number
    • z: number
    • Default value time: number = 100

    Returns void

onCollision

  • onCollision(object: Entity): void
  • Execute when camera have collision with object

    Parameters

    Returns void

rotate

  • rotate(x: number, y: number, z: number): void
  • Rotate for x, y, z degrees.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

setCollisions

  • setCollisions(bool: boolean): void
  • Sets collision.

    Parameters

    • bool: boolean

    Returns void

setCubeCollisionBox

  • setCubeCollisionBox(size: number): void
  • Parameters

    • size: number

    Returns void

setFieldOfView

  • setFieldOfView(angle: number): void
  • Sets field of view for camera.

    Parameters

    • angle: number

    Returns void

setPosition

  • setPosition(x: number, y: number, z: number): void
  • Absolutely sets position for camera.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

setRotation

  • setRotation(x: number, y: number, z: number): void
  • Sets rotation angles

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

Generated using TypeDoc