gophergfx
    Preparing search index...

    Class OrbitControls

    Index
    • 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

    camera: Camera
    mouseButton: number
    rotationSpeedX: number
    rotationSpeedY: number
    zoomable: boolean
    zoomSpeed: number
    • 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

    • Sets the target point which the camera will orbit around

      Parameters

      • targetPoint: Vector3

        The point around which the camera will orbit

      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