Camera

Camera

Common interface for all cameras. Only one camera can be active at a time.

Members

active :boolean

Camera activity state.

Type:
  • boolean

name :string

Camera name.

Type:
  • string

Methods

(async) activate()

Activates the camera.

(async) disableHmdMode()

Switches to regular rendering mode for handheld devices.

(async) enableHmdMode()

Switches to stereoscopic rendering mode for use in HMDs.

(async) getColorsAtWorldPositions(positions, radiusnullable) → {Array.<ColorRgb>}

Get average camera colors at given world positions within a radius.

Parameters:
Name Type Attributes Default Description
positions Array.<Vector3d>

a list of 3d world space coordinates.

radius number <nullable>
10

radius in pixels to average colors around a position.

Returns:

list of colors at the positions

Type
Array.<ColorRgb>

(async) getPoseInViewingDirection(distance, projectToFloornullable) → {Vector3d}

Calculates a point in the 3d space in front of the camera at a specified distance and returns its pose assigning the camera’s orientation.
The distance is measured horizontally starting from the camera position and is not related to the camera orientation (angle).

Parameters:
Name Type Attributes Default Description
distance number

distance from camera

projectToFloor boolean <nullable>
false

if true, projects the resulting point onto the xz plane

Returns:

resulting position

Type
Vector3d