new FluxCameras(width, height)
Class for managing multiple cameras used in a viewport.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
width |
Number
|
Width of the viewport |
height |
Number
|
Height of the viewport |
Members
(static) VIEWS :Object
Enumeration of all possible views for the camera.
Values are perspective, top, bottom, front, back, right, left.
- Source:
Type:
-
Object
Methods
(static) cameraFromJSON(camera, data)
Rehydrate camera instance from an object property tree.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
camera |
THREE.camera
|
The camera to receive data |
data |
Object
|
The data to parse and apply |
(static) cameraToJSON(camera) → {Object}
Extract only relevant properties from a camera
- Source:
Parameters:
Name | Type | Description |
---|---|---|
camera |
THREE.Camera
|
The camera source |
Returns:
- Type:
-
Object
The camera data
fromJSON(serializableCameras)
Update the corresponding cameras in this object from a serialized object.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
serializableCameras |
Object
|
The camera data to use. |
getCamera() → {THREE.Camera}
Get the current camera object
- Source:
Returns:
- Type:
-
THREE.Camera
The current camera
setView(view)
Set which camera view to use (ex perspective, top etc.).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
view |
FluxCameras.VIEWS
|
The new view mode |
toJSON() → {Object}
Make serializable by pruning all references and building an object property tree
- Source:
Returns:
- Type:
-
Object
The simplified model
updateCamera(width, height)
Recompute derived state when the camera is changed.
- Source:
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) |