Interface OrbitControlModuleOptions

interface OrbitControlModuleOptions {
    azimuthRotateSpeed?: number;
    boundaryFriction?: number;
    colliderMeshes?: Object3D<Object3DEventMap>;
    dblClickAddDebugMarker?: boolean;
    dblClickSetToCenter?: boolean;
    disableUpdate?: boolean;
    dollyDragInverted?: boolean;
    dollySpeed?: number;
    dollyToCursor?: boolean;
    dragToOffset?: boolean;
    draggingSmoothTime?: number;
    enable?: boolean;
    eventFromInputModule?: boolean;
    infinityDolly?: boolean;
    initState?: CameraState & {
        enableTransition?: boolean;
    };
    leftButtonPan?: boolean;
    maxAzimuthAngle?: number;
    maxDistance?: number;
    maxPolarAngle?: number;
    maxSpeed?: number;
    maxZoom?: number;
    minAzimuthAngle?: number;
    minDistance?: number;
    minPolarAngle?: number;
    minZoom?: number;
    mouseButtons?: MouseButtons;
    polarRotateSpeed?: number;
    restThreshold?: number;
    rotateShowTargetMarker?: boolean;
    smoothTime?: number;
    targetMarkerColor?: string;
    targetMarkerImage?: string;
    targetMarkerOpacity?: number;
    targetMarkerSize?: number;
    touches?: Touches;
    truckSpeed?: number;
    unProjectUseDepth?: boolean;
    verticalDragToForward?: boolean;
    zoomShowTargetMarker?: boolean;
}

Other

azimuthRotateSpeed?: number

Speed of azimuth (horizontal) rotation. Default is 1.0.

boundaryFriction?: number

Friction ratio of the boundary..Default is 0.0.

colliderMeshes?: Object3D<Object3DEventMap>

An array of Meshes to collide with camera. Be aware colliderMeshes may decrease performance. The collision test uses 4 raycasters from the camera since the near plane has 4 corners.

dblClickAddDebugMarker?: boolean

双击定位时把当前坐标用Marker调试输出,默认false

dblClickSetToCenter?: boolean

开启双击定位到中心点,默认是

disableUpdate?: boolean

允许更新

dollyDragInverted?: boolean

true to invert direction when dollying or zooming via drag Default is false.

dollySpeed?: number

Speed of mouse-wheel dollying. Default is 1.0.

dollyToCursor?: boolean

true to enable Dolly-in to the mouse cursor coords. Default is false.

dragToOffset?: boolean

Properties Default is false.

draggingSmoothTime?: number

the smoothTime while draggingDefault is 0.125.

enable?: boolean

是否启用

eventFromInputModule?: boolean

事件来源于输入模块

infinityDolly?: boolean

true to enable Infinity Dolly for wheel and pinch. Use this with minDistance and maxDistance If the Dolly distance is less (or over) than the minDistance (or maxDistance), infinityDolly will keep the distance and pushes the target position instead.

initState?: CameraState & {
    enableTransition?: boolean;
}

初始状态

Type declaration

  • Optional enableTransition?: boolean
leftButtonPan?: boolean

左键用于平移 (同时右键将用于旋转)

maxAzimuthAngle?: number

Maximum horizontal angle in radians. The angle has to be greater than .minAzimuthAngle. The default value is Infinity.

e.g.

cameraControl.maxAzimuthAngle = Infinity;
maxDistance?: number

Maximum distance for dolly. The value must be higher than minDistance. Default is Infinity. PerspectiveCamera only.

maxPolarAngle?: number

Maximum vertical angle in radians. The angle has to be between .maxPolarAngle and Math.PI inclusive. The default value is Math.PI.

e.g.

cameraControl.maxPolarAngle = Math.PI;
maxSpeed?: number

Max transition speed in unit-per-seconds. Default is Infinity.

maxZoom?: number

Maximum camera zoom.Default is Infinity.

minAzimuthAngle?: number

Minimum horizontal angle in radians. The angle has to be less than .maxAzimuthAngle. The default value is - Infinity.

e.g.

cameraControl.minAzimuthAngle = - Infinity;
minDistance?: number

Minimum distance for dolly. The value must be higher than 0. Default is Number.EPSILON. PerspectiveCamera only.

minPolarAngle?: number

Minimum vertical angle in radians. The angle has to be between 0 and .maxPolarAngle inclusive. The default value is 0.

e.g.

cameraControl.maxPolarAngle = 0;
minZoom?: number

Minimum camera zoom. Default is 0.01.

mouseButtons?: MouseButtons

User's mouse input config.

button to assign behavior
mouseButtons.left CameraControls.ACTION.ROTATE* | CameraControls.ACTION.TRUCK | CameraControls.ACTION.OFFSET | CameraControls.ACTION.DOLLY | CameraControls.ACTION.ZOOM | CameraControls.ACTION.NONE
mouseButtons.right CameraControls.ACTION.ROTATE | CameraControls.ACTION.TRUCK* | CameraControls.ACTION.OFFSET | CameraControls.ACTION.DOLLY | CameraControls.ACTION.ZOOM | CameraControls.ACTION.NONE
mouseButtons.wheel ¹ CameraControls.ACTION.ROTATE | CameraControls.ACTION.TRUCK | CameraControls.ACTION.OFFSET | CameraControls.ACTION.DOLLY | CameraControls.ACTION.ZOOM | CameraControls.ACTION.NONE
mouseButtons.middle ² CameraControls.ACTION.ROTATE | CameraControls.ACTION.TRUCK | CameraControls.ACTION.OFFSET | CameraControls.ACTION.DOLLY* | CameraControls.ACTION.ZOOM | CameraControls.ACTION.NONE
  1. Mouse wheel event for scroll "up/down" on mac "up/down/left/right"
  2. Mouse click on wheel event "button"
  • * is the default.
  • The default of mouseButtons.wheel is:
    • DOLLY for Perspective camera.
    • ZOOM for Orthographic camera, and can't set DOLLY.
polarRotateSpeed?: number

Speed of polar (vertical) rotation. Default is 1.0.

restThreshold?: number

Controls how soon the rest event fires as the camera slows. .Default is 0.01.

rotateShowTargetMarker?: boolean

旋转时显示旋转中心点坐标位置图标(默认是)

smoothTime?: number

Approximate time in seconds to reach the target. A smaller value will reach the target faster.Default is 0.25.

targetMarkerColor?: string

旋转中心点坐标位置图标颜色,默认 #d4237a

targetMarkerImage?: string

旋转中心点坐标位置图标

targetMarkerOpacity?: number

旋转中心点坐标位置图标透明度(0-1)

targetMarkerSize?: number

旋转中心点坐标位置图标大小

truckSpeed?: number

Speed of drag for pan and pedestal. Default is 2.0.

unProjectUseDepth?: boolean

双击定位时屏幕坐标转世界坐标使用深度,默认是

verticalDragToForward?: boolean

if true, pan in screen-space default true

zoomShowTargetMarker?: boolean

缩放时显示旋转中心点坐标位置图标(默认是)

Properties

touches?: Touches

User's touch input config.

fingers to assign behavior
touches.one CameraControls.ACTION.TOUCH_ROTATE* | CameraControls.ACTION.TOUCH_TRUCK | CameraControls.ACTION.TOUCH_OFFSET | CameraControls.ACTION.DOLLY
touches.two ACTION.TOUCH_DOLLY_TRUCK | ACTION.TOUCH_DOLLY_OFFSET | ACTION.TOUCH_DOLLY_ROTATE | ACTION.TOUCH_ZOOM_TRUCK | ACTION.TOUCH_ZOOM_OFFSET | ACTION.TOUCH_ZOOM_ROTATE | ACTION.TOUCH_DOLLY | ACTION.TOUCH_ZOOM | CameraControls.ACTION.TOUCH_ROTATE | CameraControls.ACTION.TOUCH_TRUCK | CameraControls.ACTION.TOUCH_OFFSET | CameraControls.ACTION.NONE
touches.three ACTION.TOUCH_DOLLY_TRUCK | ACTION.TOUCH_DOLLY_OFFSET | ACTION.TOUCH_DOLLY_ROTATE | ACTION.TOUCH_ZOOM_TRUCK | ACTION.TOUCH_ZOOM_OFFSET | ACTION.TOUCH_ZOOM_ROTATE | CameraControls.ACTION.TOUCH_ROTATE | CameraControls.ACTION.TOUCH_TRUCK | CameraControls.ACTION.TOUCH_OFFSET | CameraControls.ACTION.NONE
  • * is the default.
  • The default of touches.two and touches.three is:
    • TOUCH_DOLLY_TRUCK for Perspective camera.
    • TOUCH_ZOOM_TRUCK for Orthographic camera, and can't set TOUCH_DOLLY_TRUCK and TOUCH_DOLLY.