camera

vgl. camera

new camera(arg) → {vgl.camera}

Description:
  • Create a new instance of class camera.

Source:
Parameters:
Name Type Description
arg object
Properties
Name Type Attributes Description
parallelProjection boolean <nullable>

Optionally start with a parallel projection.

Returns:
Type
vgl.camera

Extends

Methods

addChild(childNode) → {boolean}

Description:
  • Make the incoming node a child of the group node.

Source:
Inherited From:
Parameters:
Name Type Description
childNode vgl.node
Returns:
Type
boolean

children() → {Array.<vgl.node>}

Description:
  • Return children of this group node.

Source:
Inherited From:
Returns:
Type
Array.<vgl.node>

clearColor() → {Array}

Description:
  • Get clear color (background color) of the camera.

Source:
Returns:
Type
Array

clearDepth() → {number}

Description:
  • Get the clear depth value.

Source:
Returns:
Type
number

clearMask() → {number}

Description:
  • Return clear mask used by this camera.

Source:
Returns:
Type
number

computeDirectionOfProjection()

Description:
  • Compute direction of projection.

Source:

computeProjectionMatrix() → {mat4}

Description:
  • Compute camera projection matrix.

Source:
Returns:
Type
mat4

computeViewMatrix() → {mat4}

Description:
  • Compute camera view matrix.

Source:
Returns:
Type
mat4

hasChild(node) → {boolean}

Description:
  • Return true if this group node has node as a child, false otherwise.

Source:
Inherited From:
Parameters:
Name Type Description
node vgl.node
Returns:
Type
boolean

parallelExtents() → {object}

Description:
  • Get parallel projection extents parameters.

Source:
Returns:

Extents object with width, height, zoom, and tilesize.

Type
object

projectionMatrix() → {mat4}

Description:
  • Return camera projection matrix This method does not compute the projection-matrix for the camera. It is assumed that a call to computeProjectionMatrix has been made earlier.

Source:
Returns:
Type
mat4

removeChild(childNode) → {boolean}

Description:
  • Remove parent-child relationship between the group and incoming node.

Source:
Inherited From:
Parameters:
Name Type Description
childNode vgl.node
Returns:
Type
boolean

removeChildren()

Description:
  • Remove parent-child relationship between child nodes and the group node.

Source:
Inherited From:

setParallelExtents(extents)

Description:
  • Set parallel projection extents parameters.

Source:
Parameters:
Name Type Description
extents object

Extents object with width, height, zoom, and tilesize.

setProjectionMatrix(proj)

Description:
  • Set the projection-matrix for the camera and mark that it is up to date so that it won't be recomputed unless something else changes.

Source:
Parameters:
Name Type Description
proj mat4

New projection matrix.

setViewAspect(aspect)

Description:
  • Set view aspect.

Source:
Parameters:
Name Type Description
aspect number

Aspect ration (width / height).

setViewMatrix(view, preserveType)

Description:
  • Set the view-matrix for the camera and mark that it is up to date so that it won't be recomputed unless something else changes.

Source:
Parameters:
Name Type Description
view mat4

new view matrix.

preserveType boolean

If true, clone the input using slice. This can be used to ensure the array is a specific precision.

unitsPerPixel(zoom, tilesize) → {number}

Description:
  • Compute the units per pixel.

Source:
Parameters:
Name Type Description
zoom number

Tile zoom level.

tilesize number

Number of pixels per tile (defaults to 256).

Returns:

unitsPerPixel.

Type
number

viewMatrix() → {mat4}

Description:
  • Return view-matrix for the camera This method does not compute the view-matrix for the camera. It is assumed that a call to computeViewMatrix has been made earlier.

Source:
Returns:
Type
mat4