Class CameraControls

事件派发管理

Hierarchy (view full)

Constructor

Methods

Other

Properties

Statics

Constructor

  • Creates a CameraControls instance.

    Note: You must install three.js before using camera-controls. see #install Not doing so will lead to runtime errors (undefined references to THREE).

    e.g.

    CameraControls.install( { THREE } );
    const cameraControls = new CameraControls( camera, domElement );

    Parameters

    • app: App
    • Optional domElement: HTMLElement

      A HTMLElement for the draggable area, usually renderer.domElement.

    • Optional eventFromInputModule: boolean

    Returns CameraControls

Methods

cancel: (() => void) = ...

Force cancel user dragging.

Type declaration

    • (): void
    • Force cancel user dragging.

      Returns void

lockPointer: (() => void)

Still an experimental feature. This could change at any time.

Type declaration

    • (): void
    • Still an experimental feature. This could change at any time.

      Returns void

unlockPointer: (() => void)

Still an experimental feature. This could change at any time.

Type declaration

    • (): void
    • Still an experimental feature. This could change at any time.

      Returns void

  • Adds the specified event listener. Applicable event types (which is K) are:

    Event name Timing
    'controlstart' When the user starts to control the camera via mouse / touches. ¹
    'control' When the user controls the camera (dragging).
    'controlend' When the user ends to control the camera. ¹
    'transitionstart' When any kind of transition starts, either user control or using a method with enableTransition = true
    'update' When the camera position is updated.
    'wake' When the camera starts moving.
    'rest' When the camera movement is below .restThreshold ².
    'sleep' When the camera end moving.
    1. mouseButtons.wheel (Mouse wheel control) does not emit 'controlstart' and 'controlend'. mouseButtons.wheel uses scroll-event internally, and scroll-event happens intermittently. That means "start" and "end" cannot be detected.
    2. Due to damping, sleep will usually fire a few seconds after the camera appears to have stopped moving. If you want to do something (e.g. enable UI, perform another transition) at the point when the camera has stopped, you probably want the rest event. This can be fine tuned using the .restThreshold parameter. See the Rest and Sleep Example.

    e.g.

    cameraControl.addEventListener( 'controlstart', myCallbackFunction );
    

    Type Parameters

    • K extends keyof CameraControlsEventMap

    Parameters

    • type: K

      event name

    • listener: ((event) => any)

      handler function

        • (event): any
        • Parameters

          • event: CameraControlsEventMap[K]

          Returns any

    Returns void

  • Apply current camera-up direction to the camera. The orbit system will be re-initialized with the current position.

    Returns void

  • Attach all internal event handlers to enable drag control.

    Parameters

    • domElement: HTMLElement

    Returns void

  • Dispose the cameraControls instance itself, remove all eventListeners.

    Returns void

  • Dolly in/out camera position.

    Parameters

    • distance: number

      Distance of dollyIn. Negative number for dollyOut.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately.

    Returns Promise<void>

  • Dolly in, but does not change the distance between the target and the camera, and moves the target position instead. Specify a negative value for dolly out.

    Parameters

    • distance: number

      Distance of dolly.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately.

    Returns Promise<void>

  • Dolly in/out camera position to given distance.

    Parameters

    • distance: number

      Distance of dolly.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately.

    Returns Promise<void>

  • Move up / down.

    Parameters

    • height: number

      Amount to move up / down. Negative value to move down

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Fit the viewport to the box or the bounding box of the object, using the nearest axis. paddings are in unit. set cover: true to fill enter screen. e.g.

    cameraControls.fitToBox( myMesh );
    

    Parameters

    • box3OrObject: Box3 | Object3D<Object3DEventMap>

      Axis aligned bounding box to fit the view.

    • enableTransition: boolean

      Whether to move smoothly or immediately.

    • options: Partial<FitToOptions> = {}

      | <object> { cover: boolean, paddingTop: number, paddingLeft: number, paddingBottom: number, paddingRight: number }

    Returns Promise<void[]>

    Transition end promise

  • Fit the viewport to the sphere or the bounding sphere of the object.

    Parameters

    • sphereOrMesh: Sphere | Object3D<Object3DEventMap>
    • enableTransition: boolean

    Returns Promise<void[]>

  • Move forward / backward.

    Parameters

    • distance: number

      Amount to move forward / backward. Negative value to move backward

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Reproduce the control state with JSON. enableTransition is where anim or not in a boolean.

    Parameters

    • json: string
    • enableTransition: boolean = false

    Returns void

  • Calculate the distance to fit the box.

    Parameters

    • width: number

      box width

    • height: number

      box height

    • depth: number

      box depth

    • cover: boolean = false

    Returns number

    distance

  • Calculate the distance to fit the sphere.

    Parameters

    • radius: number

      sphere radius

    Returns number

    distance

  • Returns the focal offset, which is how much the camera appears to be translated in screen parallel coordinates.

    Parameters

    • out: Vector3

      The receiving Vector3 instance to copy the result

    • receiveEndValue: boolean = true

      Whether receive the transition end coords or current. default is true

    Returns Vector3

  • Returns the camera position.

    Parameters

    • out: Vector3

      The receiving Vector3 instance to copy the result

    • receiveEndValue: boolean = true

      Whether receive the transition end coords or current. default is true

    Returns Vector3

  • Returns the spherical coordinates of the orbit.

    Parameters

    • out: Spherical

      The receiving Spherical instance to copy the result

    • receiveEndValue: boolean = true

      Whether receive the transition end coords or current. default is true

    Returns Spherical

  • Returns the orbit center position, where the camera looking at.

    Parameters

    • out: Vector3

      The receiving Vector3 instance to copy the result

    • receiveEndValue: boolean = true

      Whether receive the transition end coords or current. default is true

    Returns Vector3

  • Similar to setLookAt, but it interpolates between two states.

    Parameters

    • positionAX: number
    • positionAY: number
    • positionAZ: number
    • targetAX: number
    • targetAY: number
    • targetAZ: number
    • positionBX: number
    • positionBY: number
    • positionBZ: number
    • targetBX: number
    • targetBY: number
    • targetBZ: number
    • t: number
    • enableTransition: boolean = false

    Returns Promise<void>

  • Look in the given point direction.

    Parameters

    • x: number

      point x.

    • y: number

      point y.

    • z: number

      point z.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately.

    Returns Promise<void>

    Transition end promise

  • Move target position to given point.

    Parameters

    • x: number

      x coord to move center position

    • y: number

      y coord to move center position

    • z: number

      z coord to move center position

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Normalize camera azimuth angle rotation between 0 and 360 degrees.

    Returns void

  • pan and pedestal camera using current azimuthal angle

    Parameters

    • x: number

      Horizontal translate amount

    • y: number

      Vertical translate amount

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Removes the specified event listener e.g.

    cameraControl.addEventListener( 'controlstart', myCallbackFunction );
    

    Type Parameters

    • K extends keyof CameraControlsEventMap

    Parameters

    • type: K

      event name

    • listener: ((event) => any)

      handler function

        • (event): any
        • Parameters

          • event: CameraControlsEventMap[K]

          Returns any

    Returns void

  • Reset all rotation and position to defaults.

    Parameters

    • enableTransition: boolean = false

    Returns Promise<void[]>

  • Rotate azimuthal angle(horizontal) and polar angle(vertical). Every value is added to the current value.

    Parameters

    • azimuthAngle: number

      Azimuth rotate angle. In radian.

    • polarAngle: number

      Polar rotate angle. In radian.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Rotate azimuthal angle(horizontal) to the given angle and keep the same polar angle(vertical) target.

    e.g.

    cameraControls.rotateAzimuthTo( 30 * MathUtils.DEG2RAD, true );
    

    Parameters

    • azimuthAngle: number

      Azimuth rotate angle. In radian.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Rotate polar angle(vertical) to the given angle and keep the same azimuthal angle(horizontal) target.

    e.g.

    cameraControls.rotatePolarTo( 30 * MathUtils.DEG2RAD, true );
    

    Parameters

    • polarAngle: number

      Polar rotate angle. In radian.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Rotate azimuthal angle(horizontal) and polar angle(vertical) to the given angle. Camera view will rotate over the orbit pivot absolutely:

    azimuthAngle

          0º
    \
    90º -----+----- -90º
    \
    180º
    direction angle
    front
    left 90º (Math.PI / 2)
    right -90º (- Math.PI / 2)
    back 180º (Math.PI)

    polarAngle

        180º
    |
    90º
    |
    0º
    direction angle
    top/sky 180º (Math.PI)
    horizontal from view 90º (Math.PI / 2)
    bottom/floor

    Parameters

    • azimuthAngle: number

      Azimuth rotate angle to. In radian.

    • polarAngle: number

      Polar rotate angle to. In radian.

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Set the boundary box that encloses the target of the camera. box3 is in Box3

    Parameters

    • Optional box3: Box3

    Returns void

  • Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly.

    Parameters

    • x: number
    • y: number
    • z: number
    • enableTransition: boolean = false

    Returns Promise<void>

  • Look at the target from the position.

    Parameters

    • positionX: number
    • positionY: number
    • positionZ: number
    • targetX: number
    • targetY: number
    • targetZ: number
    • enableTransition: boolean = false

    Returns Promise<void>

  • Set orbit point without moving the camera. SHOULD NOT RUN DURING ANIMATIONS. setOrbitPoint() will immediately fix the positions.

    Parameters

    • targetX: number
    • targetY: number
    • targetZ: number

    Returns void

  • Set angle and distance by given position. An alias of setLookAt(), without target change. Thus keep gazing at the current target

    Parameters

    • positionX: number
    • positionY: number
    • positionZ: number
    • enableTransition: boolean = false

    Returns Promise<void>

  • Set the target position where gaze at. An alias of setLookAt(), without position change. Thus keep the same position.

    Parameters

    • targetX: number
    • targetY: number
    • targetZ: number
    • enableTransition: boolean = false

    Returns Promise<void>

  • Set (or unset) the current viewport. Set this when you want to use renderer viewport and .dollyToCursor feature at the same time.

    Parameters

    • viewportOrX: number | Vector4
    • y: number
    • width: number
    • height: number

    Returns void

  • Get all state in JSON string

    Returns string

  • Update camera position and directions. This should be called in your tick loop every time, and returns true if re-rendering is needed.

    Parameters

    • delta: number

    Returns boolean

    updated

  • Sync camera-up direction. When camera-up vector is changed, .updateCameraUp() must be called.

    Returns void

  • Zoom in/out camera. The value is added to camera zoom. Limits set with .minZoom and .maxZoom

    Parameters

    • zoomStep: number

      zoom scale

    • enableTransition: boolean = false

      Whether to move smoothly or immediately

    Returns Promise<void>

  • Zoom in/out camera to given scale. The value overwrites camera zoom. Limits set with .minZoom and .maxZoom

    Parameters

    • zoom: number
    • enableTransition: boolean = false

    Returns Promise<void>

Other

_activePointers: PointerInput[] = []
_boundary: Box3
_boundaryEnclosesCamera: boolean = false
_camera: PerspectiveCamera | OrthographicCamera
_cameraUp0: Vector3
_changedDolly: number = 0
_changedZoom: number = 0
_dollyControlCoord: Vector2
_domElement?: HTMLElement
_elementRect: DOMRect = ...
_enabled: boolean = true
_focalOffset: Vector3
_focalOffset0: Vector3
_focalOffsetEnd: Vector3
_focalOffsetVelocity: Vector3 = ...
_hasRested: boolean = true
_interactiveArea: DOMRect = ...
_isDragging: boolean = false
_isUserControllingDolly: boolean = false
_isUserControllingOffset: boolean = false
_isUserControllingRotate: boolean = false
_isUserControllingTruck: boolean = false
_isUserControllingZoom: boolean = false
_lastDistance: number
_lastDollyDirection: DOLLY_DIRECTION = DOLLY_DIRECTION.NONE
_lastZoom: number
_lockedPointer: PointerInput = null
_nearPlaneCorners: [Vector3, Vector3, Vector3, Vector3]
_needsUpdate: boolean = true
_phiVelocity: RefTypeValue = ...
_position0: Vector3
_radiusVelocity: RefTypeValue = ...
_spherical: Spherical
_sphericalEnd: Spherical
_state: number = ACTION.NONE
_target: Vector3
_target0: Vector3
_targetEnd: Vector3
_targetMarker: Marker2D
_targetVelocity: Vector3 = ...
_thetaVelocity: RefTypeValue = ...
_updatedLastTime: boolean = false
_viewport: Vector4 = null
_yAxisUpSpace: Quaternion
_yAxisUpSpaceInverse: Quaternion
_zoom: number
_zoom0: number
_zoomEnd: number
_zoomVelocity: RefTypeValue = ...
app: App
dblClickSetToCenter: boolean
enableWheelWhenCtrlDisabled: boolean = true
eventFromInputModule: boolean = true
  • Parameters

    • _domElement: HTMLElement

    Returns void

  • Returns number

  • Parameters

    • resolveImmediately: boolean

    Returns Promise<void>

  • Parameters

    • pointer: PointerInput

    Returns void

  • Parameters

    • delta: number
    • x: number
    • y: number

    Returns void

  • Parameters

    • distance: number
    • enableTransition: boolean = false

    Returns Promise<void>

  • Parameters

    • position: Vector3
    • offset: Vector3
    • friction: number

    Returns Vector3

  • Parameters

    • pointerId: number

    Returns PointerInput

  • Parameters

    • mouseButton: MOUSE_BUTTON

    Returns PointerInput

  • Parameters

    • out: Vector3

    Returns Vector3

  • Get its client rect and package into given DOMRect .

    Parameters

    • target: DOMRect

    Returns DOMRect

  • Parameters

    • out: Vector3

    Returns Vector3

  • Returns void

  • Parameters

    • deltaX: number
    • deltaY: number

    Returns void

  • Parameters

    • deltaX: number
    • deltaY: number
    • dragToOffset: boolean

    Returns void

  • Returns void

  • Parameters

    • delta: number
    • x: number
    • y: number

    Returns void

  • Detach all internal event handlers to disable drag control.

    Returns void

  • 触发指定事件名称.

    Parameters

    • event: string

      Event name

    • Rest ...data: any

      Data

    Returns boolean

    • Whether the dispatching is successful
  • Parameters

    • event: string
    • Rest ...data: any

    Returns void

  • 返回注册的所有事件名.

    Returns string[]

    所有事件名

  • Parameters

    • rect: {
          center: [number, number, number];
          height: number;
          normal: [number, number, number];
          width: number;
      }
      • center: [number, number, number]
      • height: number
      • normal: [number, number, number]
      • width: number

    Returns void

  • 对状态进行设置,采用堆栈方案,会保存之前的状态,退出时还原之前的状态

    Parameters

    • Optional enabledControl: boolean

      是否启用 默认false

    • Optional enableWheelWhenCtrlDisabled: boolean

      是否滚轮缩放 默认true

    Returns {
        pop: (() => void);
        push: (() => void);
    }

    • pop: (() => void)
        • (): void
        • Returns void

    • push: (() => void)
        • (): void
        • Returns void

  • 确定是否存在事件侦听

    Parameters

    • event: string

      事件名

    Returns boolean

    返回是否存在相应的事件

  • 返回具有指定事件名称的侦听总数.

    Parameters

    • event: string

      Event name

    Returns number

    The count of listeners

  • load current camera position

    Parameters

    Returns void

  • load current camera position

    Parameters

    • state: CameraState
    • Optional duration: number
    • Optional opts: {
          easing?: Easing;
          id?: string;
          repeatTimes?: number;
          tag?: string;
          yoyoTimes?: number;
      }
      • Optional easing?: Easing

        easing

      • Optional id?: string

        id

      • Optional repeatTimes?: number

        重复次数

      • Optional tag?: string

        分类

      • Optional yoyoTimes?: number

        往返次数

    Returns Promise<unknown>

  • 通过事件名移除所有监听.

    Parameters

    • Optional event: string

      Event name, delete all events if not passed

    Returns void

  • 相机抖动

    Parameters

    • Optional duration: number

      每次持续时长 (ms) 默认 1000

    • Optional frequency: number

      抖动频率 默认 10

    • Optional strength: number

      强度 默认 1

    • Optional isLoop: boolean

      是否循环抖动 默认 false

    Returns {
        cancelShake: (() => boolean);
    }

    • cancelShake: (() => boolean)
        • (): boolean
        • Returns boolean

  • Parameters

    • object3d: Object3D<Object3DEventMap>
    • out: Sphere = ...

    Returns Sphere

  • Returns void

Properties

azimuthRotateSpeed: number = 1.0

Speed of azimuth (horizontal) rotation.

boundaryFriction: number = 0.0

Friction ratio of the boundary.

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.

dollyDragInverted: boolean = false

true to invert direction when dollying or zooming via drag

dollySpeed: number = 1.0

Speed of mouse-wheel dollying.

dollyToCursor: boolean = false

true to enable Dolly-in to the mouse cursor coords.

dragToOffset: boolean = false
draggingSmoothTime: number = 0.125

the smoothTime while dragging

infinityDolly: boolean = false

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.

maxAzimuthAngle: number = Infinity

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

e.g.

cameraControls.maxAzimuthAngle = Infinity;
maxDistance: number = Infinity

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

maxPolarAngle: number = Math.PI

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

e.g.

cameraControls.maxPolarAngle = Math.PI;
maxSpeed: number = Infinity

Max transition speed in unit-per-seconds

maxZoom: number = Infinity

Maximum camera zoom.

minAzimuthAngle: number = -Infinity

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

e.g.

cameraControls.minAzimuthAngle = - Infinity;
minDistance: number = Number.EPSILON

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

minPolarAngle: number = 0

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

e.g.

cameraControls.maxPolarAngle = 0;
minZoom: number = 0.01

Minimum camera zoom.

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 = 1.0

Speed of polar (vertical) rotation.

restThreshold: number = 0.01

Controls how soon the rest event fires as the camera slows.

smoothTime: number = 0.25

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

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.
truckSpeed: number = 2.0

Speed of drag for pan and pedestal.

verticalDragToForward: boolean = true

if true, pan in screen-space

  • get active(): boolean
  • Returns true if the controls are active updating. readonly value.

    Returns boolean

  • get azimuthAngle(): number
  • get/set the azimuth angle (horizontal) in radians. Every 360 degrees turn is added to .azimuthAngle value, which is accumulative.

    Returns number

  • set azimuthAngle(azimuthAngle): void
  • Parameters

    • azimuthAngle: number

    Returns void

  • get boundaryEnclosesCamera(): boolean
  • Whether camera position should be enclosed in the boundary or not.

    Returns boolean

  • set boundaryEnclosesCamera(boundaryEnclosesCamera): void
  • Parameters

    • boundaryEnclosesCamera: boolean

    Returns void

  • get camera(): PerspectiveCamera | OrthographicCamera
  • The camera to be controlled

    Returns PerspectiveCamera | OrthographicCamera

  • set camera(camera): void
  • Parameters

    • camera: PerspectiveCamera | OrthographicCamera

    Returns void

  • get currentAction(): number
  • Getter for the current ACTION. readonly value.

    Returns number

  • get distance(): number
  • get/set Current distance.

    Returns number

  • set distance(distance): void
  • Parameters

    • distance: number

    Returns void

  • get enabled(): boolean
  • Whether or not the controls are enabled. false to disable user dragging/touch-move, but all methods works.

    Returns boolean

  • set enabled(enabled): void
  • Parameters

    • enabled: boolean

    Returns void

  • set interactiveArea(interactiveArea): void
  • Set drag-start, touches and wheel enable area in the domElement. each values are between 0 and 1 inclusive, where 0 is left/top and 1 is right/bottom of the screen. e.g. { x: 0, y: 0, width: 1, height: 1 } for entire area.

    Parameters

    • interactiveArea: DOMRect | {
          height: number;
          width: number;
          x: number;
          y: number;
      }

    Returns void

  • get polarAngle(): number
  • get/set the polar angle (vertical) in radians.

    Returns number

  • set polarAngle(polarAngle): void
  • Parameters

    • polarAngle: number

    Returns void

Statics

  • get ACTION(): Readonly<{
        DOLLY: 8;
        NONE: 0;
        OFFSET: 4;
        ROTATE: 1;
        TOUCH_DOLLY: 256;
        TOUCH_DOLLY_OFFSET: 2048;
        TOUCH_DOLLY_ROTATE: 4096;
        TOUCH_DOLLY_TRUCK: 1024;
        TOUCH_OFFSET: 128;
        TOUCH_ROTATE: 32;
        TOUCH_TRUCK: 64;
        TOUCH_ZOOM: 512;
        TOUCH_ZOOM_OFFSET: 16384;
        TOUCH_ZOOM_ROTATE: 32768;
        TOUCH_ZOOM_TRUCK: 8192;
        TRUCK: 2;
        ZOOM: 16;
    }>
  • list all ACTIONs

    Returns Readonly<{
        DOLLY: 8;
        NONE: 0;
        OFFSET: 4;
        ROTATE: 1;
        TOUCH_DOLLY: 256;
        TOUCH_DOLLY_OFFSET: 2048;
        TOUCH_DOLLY_ROTATE: 4096;
        TOUCH_DOLLY_TRUCK: 1024;
        TOUCH_OFFSET: 128;
        TOUCH_ROTATE: 32;
        TOUCH_TRUCK: 64;
        TOUCH_ZOOM: 512;
        TOUCH_ZOOM_OFFSET: 16384;
        TOUCH_ZOOM_ROTATE: 32768;
        TOUCH_ZOOM_TRUCK: 8192;
        TRUCK: 2;
        ZOOM: 16;
    }>