new ScreenSpaceCameraController(scene)
Camera orientation class.
| Name | Type | Description |
|---|---|---|
scene |
Scene |
Scene. |
Members
-
bounceAnimationTimeNumber
-
Set the duration (in seconds) of the rebound animation in 2D and Columbus views.
- Default Value: 3.0
enableCollisionDetectionBoolean
Enable or disable collision detection between the camera and the terrain.
- Default Value: true
enableIndoorColliDetectionBoolean
Turn on or off the collision detection of the camera indoors.
- Default Value: false
enableInputsBoolean
If true, inputs with enableTranslate, enableZoom, enableRotate, enableTilt, and enableLook flags are conditionally allowed. If false, disable all inputs.
Note: This setting is used for temporary use cases such as camera flight and area drag and drop selection (see Pick up demo). Usually, this type of event is set to false at the beginning and true upon completion. In order to keep the input disabled even after the camera flight ends, you must use other Boolean values (enableTranslate, enableZoom, enableRotate, enableTilt, and enableLook).
- Default Value: true
enableLookBoolean
If it is' true ', the user is allowed to use a free perspective. If it is' false ', the camera's view direction can only be changed by translating or rotating. This tag is only applicable to 3D and Columbus view modes.
- Default Value: true
enableRotateBoolean
If 'true', allows users to rotate the camera. If false, the camera will lock in the current position. This symbol is only applicable to 2D and 3D scenes.
- Default Value: true
enableTiltBoolean
If 'true', allow the user to tilt the camera. If it is' false ', the camera will be locked in the current position.
- Default Value: true
enableTranslateBoolean
If it is' true ', the user is allowed to pan on the map. If false, the camera will lock in its current position. This tag is only applicable to 2D and Columbus view modes.
- Default Value: true
enableZoomBoolean
If 'true', allow users to zoom in or out. If false, the camera will lock at the current distance of the ellipsoid.
- Default Value: true
inertiaSpinNumber
The parameter within the range of [0,1) is used to determine the time for the camera to continue rotating due to inertia. If the value is 0, the camera will have no inertia.
- Default Value: 0.9
inertiaTranslateNumber
The parameter within the range of [0,1) is used to determine the time for the camera to continue translating due to inertia. If the value is 0, the camera will have no inertia.
- Default Value: 0.9
inertiaZoomNumber
The parameter within the range of [0,1) is used to determine the time for the camera to continue zooming due to inertia. If the value is 0, the camera will have no inertia.
- Default Value: 0.8
inverseTiltBoolean
Set the up and down drag direction of the middle mouse button to be consistent with the camera's pitch direction (the same effect as Google_ earth). Set to true, drag the middle mouse button up and down in the opposite direction to the camera's pitch direction (with the same effect as Cesium).
- Default Value: false
Example
Scene.ScreenSpaceCameraController.inverseTilt = false
lookEventTypesCameraEventType Array undefined
Allow users to change the camera's viewing direction input. Only applicable to 3D and Columbus view modes.
The type can be CameraEventType, undefined object with event type (eventType) and modifier properties (cameraEventType and KeyboardEventModifier), or an array of any of the above types.
- Default Value: { eventType :
CameraEventType.LEFT_DRAG, modifier : KeyboardEventModifier.SHIFT }maximumMovementRatioNumber
A parameter within the range of [0,1), used to limit the range of various user inputs to the percentage of window width/height per animation frame.
- Default Value: 0.1
maximumZoomDistanceNumber
The maximum amplitude (in meters) of the camera position during zooming. The default is positive infinity.
- Default Value:
Number.POSITIVE_INFINITYminimumCollisionTerrainHeightNumber
The minimum height of the camera before testing collision with terrain.
- Default Value: 150000.0
minimumDetectDistanceNumber
Minimum collision detection distance.
minimumPickingTerrainHeightNumber
The minimum height that the camera must reach before selecting terrain instead of ellipsoids.
- Default Value: 150000.0
minimumTrackBallHeightNumber
The minimum height that the camera must reach before switching from a rotating orbit ball to a free view when clicking from the sky or space.
- Default Value: 7500000.0
minimumWalkingDetectDistanceNumber
Minimum indoor collision detection distance.
minimumZoomDistanceNumber
The minimum amplitude (in meters) of the camera position when zooming. The default is 1.0.
- Default Value: 1.0
rotateEventTypesCameraEventType Array undefined
Input that allows users to rotate around the Earth or other objects. Only applicable to 3D and Columbus view modes.
The type may be CameraEventType, undefined, an object with eventType and modifier properties, CameraEventType and KeyboardEventModifier, or an array of any of the above.
- Default Value:
CameraEventType.LEFT_DRAGtiltEventTypesCameraEventType Array undefined
Allow users to input 3D tilt, Columbus view, or 2D twist.
The type is CameraEventType, undefined, an object with eventType and modifier properties with CameraEventType and KeyboardEventModifier types, or any of the above arrays.
- Default Value: [
CameraEventType.MIDDLE_DRAG, CameraEventType.PINCH, {
eventType : CameraEventType.LEFT_DRAG,
modifier : KeyboardEventModifier.CTRL
}, {
eventType : CameraEventType.RIGHT_DRAG,
modifier : KeyboardEventModifier.CTRL
}]translateEventTypesCameraEventType Array undefined
Allow users to pan input on the map. This only applies to 2D and Columbus view modes.
The type may be CameraEventType, undefined, an object with eventType and modifier properties, CameraEventType and KeyboardEventModifier, or an array of any of the above.
- Default Value:
CameraEventType.LEFT_DRAGwalkParametersObject
The parameters of walking mode include speed and altitude.
- Default Value: {speed:1.0, height:2.0}
zoomEventTypesCameraEventType Array undefined
Allow users to zoom in/out of input.
The type may be CameraEventType, undefined, an object with eventType and modifier properties, CameraEventType and KeyboardEventModifier, or an array of any of the above.
- Default Value: [
CameraEventType.RIGHT_DRAG, CameraEventType.WHEEL, CameraEventType.PINCH]zoomFactorNumber
Gets or sets the camera zoom speed, with a default value of 5.0.
Methods
-
destroy(){undefined}
-
Remove the mouse listener held by the object. After the object is destroyed, it is prohibited to continue using it; If any method other than isDestroyed is called, a Developers Error exception will be thrown. Therefore, as shown in the example, the return value (undefined) needs to be reassigned to the object variable. ”
Throws:
-
The object has been destroyed, that is, the destroy() method has been called.
- Type
- DeveloperError
Returns:
Type Description undefined Example
controller = controller && controller.destroy(); -
-
isDestroyed(){Boolean}
-
If the object has been destroyed, return true; Otherwise, return false. If the object has been destroyed, it should not be used; Calling any function other than isDestroyed will result in a Developer Error exception.
Returns:
Type Description Boolean If the object has been destroyed to true; Otherwise, it is false.