CameraComponent

CameraComponent

Holds a camera.

Constructor

new CameraComponent(camera)

Parameters:
Name Type Description
camera Camera

Camera to contain in this component.

Members

camera :Camera

The camera contained by the component.

dirVec :Vector3

Direction vector.

Default Value:
  • (0, 0, -1)

leftVec :Vector3

Left vector.

Default Value:
  • (-1, 0, 0)

upVec :Vector3

Up vector.

Default Value:
  • (0, 1, 0)

Methods

setUpVector(axisId)

Parameters:
Name Type Description
axisId number

Axis to use as up-vector (0=X, 1=Y, 2=Z).

updateCamera(transform)

Updates the contained camera according to a transform (coming from the TransformComponent).

Parameters:
Name Type Description
transform Transform