Camera

This module is for manipulating the camera.

Camera

orbit(dx, dy)

Orbit the active camera.
Kind: inner method of Camera

parametertype
dxinteger
dyinteger
player.camera.orbit(1, 0);

pan(dx, dy)

Pan the active camera.
Kind: inner method of Camera

parametertype
dxinteger
dyinteger
player.camera.pan(1, 0);

zoom(delta)

Zoom the active camera.
Kind: inner method of Camera

parametertype
deltainteger
player.camera.zoom(1);

frameBoundingSphere([assetIds], [direction], [options], [useCameraAspectRatio])

Frame the active camera.
Kind: inner method of Camera

parametertype
[assetIds]array, string
[direction]vector3
[options]any
[useCameraAspectRatio]boolean
player.camera.frameBoundingSphere();

useCameraAspectRatio - Defaults to false. It can be used to frame the camera correctly when switching between cameras quickly to take a snapshot. This option determines whether to use the aspect ratio of the camera, vs the player's aspect ratio. If the camera's aspect ratio is less than 1 (ie: portrait instead of landscape), then the framing needs to be more zoomed out to ensure the left/right of the subject isn't cropped.

getPosition([target])

Get the active camera's position
Kind: inner method of Camera

parametertype
[target]vector3
player.camera.getPosition(tmpVector3)

setPosition([position])

Set the active camera's position
Kind: inner method of Camera

parametertype
[position]vector3
player.camera.setPosition(new Vector3(0, 0, 10));

getQuaternion()

Get the active camera's quaternion
Kind: inner method of Camera

parametertype
[target]quaternion
player.camera.getQuaternion()

setQuaternion([quaternion])

Set the active camera's quaternion
Kind: inner method of Camera

parametertype
[quaternion]quaternion
player.camera.setQuaternion(new Quaternion().setFromAxisAngle(new Vector3(0,1,0), Math.PI));