Documentation - v20.0.0-dev
    Preparing search index...

    Class CameraModeAbstract

    Base class for a camera navigation mode. Wraps a camera-controls instance and drives it according to the current scene bounds; subclasses implement the actual navigation behavior (orbital, first person, floor plan…) selected via CameraModeType.

    Index

    Constructors

    Properties

    _viewport: Viewport
    center: Vector3
    controls: CameraControls
    distance: number

    Methods

    • Runs move, a transition of the controls, in duration seconds (camera-controls' smooth time), then gives the controls back the camera's inertia (settings.camera.smoothTime).

      Type Parameters

      • T

      Parameters

      • duration: number
      • move: () => Promise<T>

      Returns Promise<T>

    • Returns void

    • Parameters

      • sphere: Sphere
      • duration: number = 0.25

      Returns Promise<void>

    • Gets the scene sphere with the same framing margin as the regular camera reset.

      Parameters

      Returns void

    • Reads the previous view and replaces the short FirstPerson target with the scene center.

      Parameters

      Returns void

    • Moves the camera to given position looking at the given target.

      Parameters

      Returns Promise<void>

      A promise indicating when the animation is finished

    • Parameters

      • distance: number
      • duration: number = 0.25

      Returns Promise<void>

    • Parameters

      • distance: number
      • duration: number = 0.25

      Returns Promise<void>

    • Called by the viewport when the pointer is pressed, before the operator.

      Parameters

      • _event: PointerEvent

        The pointer event.

      • _intersections: PointerIntersections

        The objects under the pointer, raycast when read.

      Returns void

    • Called by the viewport when the pointer moves, before the operator.

      Parameters

      • _event: PointerEvent

        The pointer event.

      • _intersections: PointerIntersections

        The objects under the pointer, raycast when read.

      Returns void

    • Called by the viewport when the pointer is released, before the operator.

      Parameters

      • _event: PointerEvent

        The pointer event.

      • _intersections: PointerIntersections

        The objects under the pointer, raycast when read.

      Returns void

    • Parameters

      • _: WheelEvent

      Returns void

    • Parameters

      • factor: number = 1.5
      • duration: number = 0.25

      Returns Promise<void>

    • Resets perspective framing when leaving an orthographic projection.

      Parameters

      Returns Promise<void> | null

    • Parameters

      • position: Vector3
      • duration: number = 0.25

      Returns Promise<void>

    • Parameters

      • target: Vector3
      • duration: number = 0.25

      Returns Promise<void>

    • Sets up the camera mode from another camera mode.

      Parameters

      • from: CameraMode

        The camera mode to initialize from

      • Optionalduration: number

      Returns Promise<void>

    • Updates the scene bounds used to configure the camera mode.

      Parameters

      Returns boolean

      Whether the bounds changed

    • Parameters

      • distance: number
      • Optionalduration: number

      Returns Promise<void>

    • Parameters

      • distance: number
      • Optionalduration: number

      Returns Promise<void>

    • Parameters

      • newValue: number
      • duration: number = 0.25

      Returns Promise<void>