This module is for manipulating the camera.
Camera
orbit(dx, dy)
Orbit the active camera.
Kind: inner method of Camera
| parameter | type |
|---|---|
| dx | integer |
| dy | integer |
player.camera.orbit(1, 0);pan(dx, dy)
Pan the active camera.
Kind: inner method of Camera
| parameter | type |
|---|---|
| dx | integer |
| dy | integer |
player.camera.pan(1, 0);zoom(delta)
Zoom the active camera.
Kind: inner method of Camera
| parameter | type |
|---|---|
| delta | integer |
player.camera.zoom(1);frameBoundingSphere([assetIds], [direction], [options], [useCameraAspectRatio])
Frame the active camera.
Kind: inner method of Camera
| parameter | type |
|---|---|
| [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
| parameter | type |
|---|---|
| [target] | vector3 |
player.camera.getPosition(tmpVector3)setPosition([position])
Set the active camera's position
Kind: inner method of Camera
| parameter | type |
|---|---|
| [position] | vector3 |
player.camera.setPosition(new Vector3(0, 0, 10));getQuaternion()
Get the active camera's quaternion
Kind: inner method of Camera
| parameter | type |
|---|---|
| [target] | quaternion |
player.camera.getQuaternion()setQuaternion([quaternion])
Set the active camera's quaternion
Kind: inner method of Camera
| parameter | type |
|---|---|
| [quaternion] | quaternion |
player.camera.setQuaternion(new Quaternion().setFromAxisAngle(new Vector3(0,1,0), Math.PI));