Class OrbitControls

Hierarchy

  • OrbitControls

Constructors

  • Constructs an instance of the OrbitControls class

    Parameters

    • camera: Camera

      The camera to be controlled by the OrbitControls object

    • distance: number = 1

      The distance of the camera from the target point

    • zoomable: boolean = true

      Flag indicating whether the camera should be able to zoom

    Returns OrbitControls

Properties

camera: Camera
cameraOrbitX: Quaternion
cameraOrbitY: Quaternion
distance: number
mouseButton: number
mouseDrag: boolean
mouseMovement: Vector2
rotationDirection: Vector3
rotationSpeedX: number
rotationSpeedY: number
targetPoint: Vector3
zoomDirection: number
zoomSpeed: number
zoomable: boolean

Methods

  • Listens for mouse down events and sets the mouse drag flag to true if necessary

    Parameters

    • event: MouseEvent

      The mouse down event

    Returns void

  • onMouseMove updates the mouseMovement vector with the movementX and movementY properties of the mouse event

    Parameters

    • event: MouseEvent

      The mouse event

    Returns void

  • Listens for mouse up events and sets the mouse drag flag to false

    Parameters

    • event: MouseEvent

      The mouse up event

    Returns void

  • onMouseWheel updates the zoomDirection if the OrbitControls is zoomable

    Parameters

    • event: WheelEvent

      The mouse wheel event

    Returns void

  • Sets the distance of the camera from the target point

    Parameters

    • distance: number

      The distance of the camera from the target point

    Returns void

  • Sets the rotation angles of the camera around the target point

    Parameters

    • orbitX: number

      The rotation angle around the horizontal axis

    • orbitY: number

      The rotation angle around the vertical axis

    Returns void

  • update updates the cameraOrbitX, cameraOrbitY and distance according to the mouse movement, rotation and zoom direction

    Parameters

    • deltaTime: number

      The change in time since the last update

    Returns void

Generated using TypeDoc