Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OrbitControl

The camera's track controller, can rotate, zoom, pan, support mouse and touch events.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

STATE: { NONE: number; PAN: number; ROTATE: number; TOUCH_PAN: number; TOUCH_ROTATE: number; TOUCH_ZOOM: number; ZOOM: number }

Type declaration

  • NONE: number
  • PAN: number
  • ROTATE: number
  • TOUCH_PAN: number
  • TOUCH_ROTATE: number
  • TOUCH_ZOOM: number
  • ZOOM: number
_isLocalMatrixDirty: boolean
_isMouseUp: any
_listeners: Map<string, TinoeEventListener[]>
_localMatrix: Matrix4
_offset: any
_panDelta: any
_panEnd: any
_panOffset: any
_panStart: any
_position: any
_rotateDelta: any
_rotateEnd: any
_rotateStart: any
_scale: any
_shouldUpdateWorldMatrix: boolean
_spherical: any
_sphericalDelta: any
_sphericalDump: any
_state: any
_vPan: any
_zoomDelta: any
_zoomEnd: any
_zoomFrag: any
_zoomStart: any
autoRotate: boolean
autoRotateSpeed: number

The radian of automatic rotation per second.

camera: Camera
changed: boolean
children: Object3D[]
constEvents: { element?: Document | Window; listener: any; type: string }[]
dampingFactor: number
domElement: Document | HTMLElement
enableDamping: boolean
enableKeys: boolean
enablePan: boolean
enableRotate: boolean
enableZoom: boolean
fov: number
keyPanSpeed: number
keys: { BOTTOM: number; LEFT: number; RIGHT: number; UP: number }

Type declaration

  • BOTTOM: number
  • LEFT: number
  • RIGHT: number
  • UP: number
maxAzimuthAngle: number
maxDistance: number
maxPolarAngle: number
maxZoom: number
minAzimuthAngle: number
minDistance: number
minPolarAngle: number
minZoom: number
mouseButtons: { ORBIT: number; PAN: number; ZOOM: number }

Type declaration

  • ORBIT: number
  • PAN: number
  • ZOOM: number
mouseUpEvents: { listener: any; type: string }[]
name: string
parent: Object3D
position: Vector3
rotateSpeed: number
rotation: Quaternion
scale: Vector3
target: Vector3
touchFingers: { ORBIT: number; PAN: number; ZOOM: number }

Type declaration

  • ORBIT: number
  • PAN: number
  • ZOOM: number
visible: boolean
worldMatrix: Matrix4
zoomFactor: number
zoomSpeed: number

Accessors

  • Returns Matrix4

Methods

  • 添加子节点

    Parameters

    Returns void

  • _onPositionChange(): void
  • _onRotationChange(): void
  • _onScaleChange(): void
  • _onTransformChange(): void
  • addChildren(...children: Object3D[]): void
  • 添加1~n个子节点

    Parameters

    • Rest ...children: Object3D[]

      待添加节点

    Returns void

  • addEventListener(type: string, handler: ((data: any) => any), once?: boolean): void
  • 注册handler

    memberof

    EventEmitter

    Parameters

    • type: string
    • handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • destroy(): void
  • 销毁 TODO: Mesh的销毁是否需要特殊处理

    Returns void

  • disable(): void
  • Returns void

  • 派发事件

    Parameters

    Returns void

  • enable(): void
  • Returns void

  • getAutoRotationAngle(dtime: number): number
  • Get the radian of automatic rotation.

    Parameters

    • dtime: number

    Returns number

  • 根据name标识查找子节点

    Parameters

    • name: string

      标识

    • Optional findAll: boolean

      是否查找所有符合name标识的节点

    Returns Object3D | Node<Node<any>>[]

    查找到的节点

  • getZoomScale(): number
  • Get zoom value.

    Returns number

  • handleKeyDown(event: KeyboardEvent): void
  • Pan parameter update when keyboard is pressed.

    Parameters

    • event: KeyboardEvent

    Returns void

  • handleMouseDownPan(event: any): void
  • Pan parameter update on mouse click.

    Parameters

    • event: any

    Returns void

  • handleMouseDownRotate(event: any): void
  • Rotation parameter update on mouse click.

    Parameters

    • event: any

    Returns void

  • handleMouseDownZoom(event: any): void
  • Zoom parameter update on mouse click.

    Parameters

    • event: any

    Returns void

  • handleMouseMovePan(event: MouseEvent): void
  • Pan parameters update when the mouse moves.

    Parameters

    • event: MouseEvent

    Returns void

  • handleMouseMoveRotate(event: any): void
  • Rotation parameter update when the mouse moves.

    Parameters

    • event: any

    Returns void

  • handleMouseMoveZoom(event: any): void
  • Zoom parameters update when the mouse moves.

    Parameters

    • event: any

    Returns void

  • handleMouseWheel(event: WheelEvent): void
  • Zoom parameter update when the mouse wheel is scrolled.

    Parameters

    • event: WheelEvent

    Returns void

  • handleTouchMovePan(event: TouchEvent): void
  • Pan parameter update when touch moves.

    Parameters

    • event: TouchEvent

    Returns void

  • handleTouchMoveRotate(event: TouchEvent): void
  • Rotation parameter update when touch to move.

    Parameters

    • event: TouchEvent

    Returns void

  • handleTouchMoveZoom(event: any): void
  • Zoom parameter update when touch to move.

    Parameters

    • event: any

    Returns void

  • handleTouchStartPan(event: TouchEvent): void
  • Update the translation parameter when touch down.

    Parameters

    • event: TouchEvent

    Returns void

  • handleTouchStartRotate(event: TouchEvent): void
  • Rotation parameter update when touch is dropped.

    Parameters

    • event: TouchEvent

    Returns void

  • handleTouchStartZoom(event: TouchEvent): void
  • Zoom parameter update when touch down.

    Parameters

    • event: TouchEvent

    Returns void

  • off(type?: string, handler?: ((data: any) => any)): void
  • 注销事件

    memberof

    EventEmitter

    Parameters

    • Optional type: string
    • Optional handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    Returns void

    {void}

  • on(type: string, handler: ((data: any) => any), once?: boolean): void
  • 注册handler

    memberof

    EventEmitter

    Parameters

    • type: string
    • handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • onContextMenu(event: any): void
  • Context event hiding.

    Parameters

    • event: any

    Returns void

  • onDestroy(): void
  • Returns void

  • onDisable(): void
  • Returns void

  • onKeyDown(event: KeyboardEvent): void
  • Total handling of keyboard down events.

    Parameters

    • event: KeyboardEvent

    Returns void

  • onMouseDown(event: MouseEvent): void
  • Total handling of mouse down events.

    Parameters

    • event: MouseEvent

    Returns void

  • onMouseMove(event: MouseEvent): void
  • Total handling of mouse movement events.

    Parameters

    • event: MouseEvent

    Returns void

  • onMouseUp(): void
  • Total handling of mouse up events.

    Returns void

  • onMouseWheel(event: WheelEvent): void
  • Total handling of mouse wheel events.

    Parameters

    • event: WheelEvent

    Returns void

  • onTouchEnd(): void
  • Total handling of touch end events.

    Returns void

  • onTouchMove(event: TouchEvent): void
  • Total handling of touch movement events.

    Parameters

    • event: TouchEvent

    Returns void

  • onTouchStart(event: TouchEvent): void
  • Total handling of touch start events.

    Parameters

    • event: TouchEvent

    Returns void

  • onUpdate(dtime: any): void
  • Parameters

    • dtime: any

    Returns void

  • pan(deltaX: number, deltaY: number): void
  • Pan.

    Parameters

    • deltaX: number

      The amount of translation from the screen distance in the x direction

    • deltaY: number

      The amount of translation from the screen distance in the y direction

    Returns void

  • panLeft(distance: number, worldMatrix?: Matrix4): void
  • Pan left.

    Parameters

    • distance: number
    • Optional worldMatrix: Matrix4

    Returns void

  • panUp(distance: number, worldMatrix?: Matrix4): void
  • Pan right.

    Parameters

    • distance: number
    • Optional worldMatrix: Matrix4

    Returns void

  • removeChildren(...children: Object3D[]): void
  • 删除1~n个字节点

    Parameters

    • Rest ...children: Object3D[]

      待删除节点

    Returns void

  • removeEventListener(type?: string, handler?: ((data: any) => any), once?: boolean): void
  • 注销handler

    memberof

    EventEmitter

    Parameters

    • Optional type: string
    • Optional handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • removeFromParent(): void
  • rotate(axis: Vector3, degrees: number): void
  • 旋转

    Parameters

    • axis: Vector3

      旋转中心轴

    • degrees: number

      旋转角度

    Returns void

  • rotateLeft(radian: number): void
  • Rotate to the left by a certain randian.

    Parameters

    • radian: number

      Radian value of rotation

    Returns void

  • rotateUp(radian: number): void
  • Rotate to the right by a certain randian.

    Parameters

    • radian: number

      Radian value of rotation

    Returns void

  • rotateX(degrees: number): void
  • 沿x轴旋转

    Parameters

    • degrees: number

      旋转角度

    Returns void

  • rotateY(degrees: number): void
  • 沿y轴旋转

    Parameters

    • degrees: number

      旋转角度

    Returns void

  • rotateZ(degrees: number): void
  • 沿z轴旋转

    Parameters

    • degrees: number

      旋转角度

    Returns void

  • scaleX(factor: number): void
  • 沿x轴方向缩放

    Parameters

    • factor: number

      缩放因子

    Returns void

  • scaleY(factor: number): void
  • 沿y轴方向缩放

    Parameters

    • factor: number

      缩放因子

    Returns void

  • scaleZ(factor: number): void
  • 沿z轴方向缩放

    Parameters

    • factor: number

      缩放因子

    Returns void

  • scaling(x: number, y: number, z: number): void
  • 缩放

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • translate(x: number, y: number, z: number): void
  • 平移

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • translateX(shift: number): void
  • 沿x轴方向平移

    Parameters

    • shift: number

      平移量

    Returns void

  • translateY(shift: number): void
  • 沿y轴方向平移

    Parameters

    • shift: number

      平移量

    Returns void

  • translateZ(shift: number): void
  • 沿z轴方向平移

    Parameters

    • shift: number

      平移量

    Returns void

  • traverse(callback: ((n: Object3D) => void), isIncludingSelf?: boolean): void
  • 遍历节点

    Parameters

    • callback: ((n: Object3D) => void)

      回调函数

    • Optional isIncludingSelf: boolean

      自己是否执行回调函数,默认为true

    Returns void

  • Parameters

    Returns void

  • updateWorldMatrix(updateChildren?: boolean, isParentDirty?: boolean): boolean
  • 更新世界矩阵

    Parameters

    • Optional updateChildren: boolean

      是否更新后代节点

    • Optional isParentDirty: boolean

      是否父节点有变更

    Returns boolean

  • zoomIn(zoomScale: number): void
  • Zoom in.

    Parameters

    • zoomScale: number

    Returns void

  • zoomOut(zoomScale: number): void
  • Zoom out.

    Parameters

    • zoomScale: number

    Returns void

Generated using TypeDoc