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)

isPickable :boolean

Can the entity on which this component resides be picked using this component

Default Value:
  • true

leftVec :Vector3

Left vector.

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

pickBounds :BoundingBox

A BoundingBox used for frustum selection of CameraComponents

upVec :Vector3

Up vector.

Default Value:
  • (0, 1, 0)

Methods

getFrustumPickResult(entity, view) → {string}

Default frustum picking behavior for entities with CameraComponents

Parameters:
Name Type Description
entity

the entity to be picked or not

view

the view containing the frustum to check against

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