The constructor for the module:CameraApiInterface~CameraApiInterface.
Methods
-
<abstract> animateAsync(path [, transition])
-
Animate camera along a path
Parameters:
Name Type Argument Description path
Array.<CameraDefinition> Array of camera definition objects defining a camera path
transition
TransitionParameters <optional>
Definition of the parameters to use for the transition (tween)
Returns:
-
Type Description Promise.<APIResponse> APIResponse with a CameraDefinition according to the camera's final position.
-
-
<abstract> get()
-
Returns the position and target of the camera as a CameraDefinition. If no target is available for this type of camera, the property target is undefined.
Returns:
-
Type Description CameraDefinition The current camera definition
-
-
<abstract> resetAsync( [transition])
-
Reset camera to its currently configured default configuration
Parameters:
Name Type Argument Description transition
TransitionParameters <optional>
Definition of the parameters to use for the transition (tween)
Returns:
-
Type Description APIResponse APIResponse with a CameraDefinition of the camera's default definition.
-
-
<abstract> updateAsync(camera [, transition])
-
Update camera
If target and/or position are provided, the camera will be moved to its new orientation
Parameters:
Name Type Argument Description camera
CameraDefinition The new camera properties
transition
TransitionParameters <optional>
Definition of the parameters to use for the transition (tween)
Returns:
-
Type Description Promise.<APIResponse> APIResponse with a CameraDefinition according to the new properties.
-
-
<abstract> updateMatrices(viewMatrix, projectionMatrix)
-
Update camera based on raw camera view and projection matrices.
When providing raw updates to the camera matrices, the camera controls should typically be disabled using pause.
Parameters:
Name Type Description viewMatrix
THREE.Matrix4 camera view matrix, transforming world coordinates to camera coordinates
projectionMatrix
THREE.Matrix4 camera projection matrix
-
<abstract> zoomAsync( [scenePaths] [, transition])
-
Zoom to show some or all objects in the scene
Parameters:
Name Type Argument Description scenePaths
Array.<ScenePathType> <optional>
The paths of the scene which the camera should capture. If none are provided, the camera will zoom to the scene extents.
transition
TransitionParameters <optional>
Definition of the parameters to use for the transition (tween)
Returns:
-
Type Description Promise.<APIResponse> APIResponse with a CameraDefinition of the camera's new orientation.
-
Type Definitions
-
CameraDefinition
-
The camera definition including the camera's position and target as Point3d.
Type:
- Object
-
TransitionParameters
-
Definition of a transition function for camera movements
Type:
- Object
Properties:
Name Type Argument Default Description default
Boolean <optional>
false If true store final camera position and target as default.
duration
Number <optional>
1000 duration of the transition in milliseconds
easing
String | function <optional>
'Quartic.InOut' In case a string S is provided, the corresponding easing function TWEEN.Easing[S] will be used if it exists. The easing function may also be passed directly, e.g. one of the many provided by Tween, see also TweenExplained, or a manually defined one.
interpolation
String <optional>
'CatmullRom' In case a string S is provided, the corresponding interpolation function TWEEN.Interpolation[S] will be used if it exists. Tween supports Linear, Bezier, and CatmullRom.
coordinates
String <optional>
'cylindrical' Defines coordinate system to use for animated camera paths. One of 'spherical' or 'cylindrical'.