# FluxCameras

#### new FluxCameras(width, height)

Class for managing multiple cameras used in a viewport.

##### Parameters:

Name | Type | Description
--- | --- | ---
`width` | Number | Width of the viewport
`height` | Number | Height of the viewport

Source:
  - FluxCameras.js, line 5

### Members

#### (static) VIEWS :Object

Enumeration of all possible views for the camera. Values are perspective, top, bottom, front, back, right, left.

##### Type:

- Object

Source:
  - FluxCameras.js, line 28

### Methods

#### (static) cameraFromJSON(camera, data)

Rehydrate camera instance from an object property tree.

##### Parameters:

Name | Type | Description
--- | --- | ---
`camera` | THREE.camera | The camera to receive data
`data` | Object | The data to parse and apply

Source:
  - FluxCameras.js, line 171

#### (static) cameraToJSON(camera) → {Object}

Extract only relevant properties from a camera

##### Parameters:

Name | Type | Description
--- | --- | ---
`camera` | THREE.Camera | The camera source

Source:
  - FluxCameras.js, line 115

##### Returns:

The camera data

Type
  Object

#### fromJSON(serializableCameras)

Update the corresponding cameras in this object from a serialized object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`serializableCameras` | Object | The camera data to use.

Source:
  - FluxCameras.js, line 211

#### getCamera() → {THREE.Camera}

Get the current camera object

Source:
  - FluxCameras.js, line 43

##### Returns:

The current camera

Type
  THREE.Camera

#### setView(view)

Set the camera to the default coordinates for the given view.

##### Parameters:

Name | Type | Description
--- | --- | ---
`view` | FluxCameras.VIEWS | The new view

Source:
  - FluxCameras.js, line 78

#### toJSON() → {Object}

Make serializable by pruning all references and building an object property tree

Source:
  - FluxCameras.js, line 198

##### Returns:

The simplified model

Type
  Object

#### updateCamera(width, height)

Recompute derived state when the camera is changed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`width` | Number | Width of the viewport (used to calculate aspect ratio)
`height` | Number | Height of the viewport (used to calculate aspect ratio)

Source:
  - FluxCameras.js, line 97