Bitbybit Docs
    Preparing search index...

    Class Navigation

    Camera navigation in the 3D scene: clickable points of interest that fly the camera to a saved view, and calls that fly, zoom or turn the camera to frame meshes. Every move animates the active arc-rotate camera, which orbits a target point, over a number of seconds along a named easing curve. pointOfInterest returns an entity that draw.drawAnyAsync adds to the scene, and advanced.dimensions holds the measurement annotations.

    Index

    Constructors

    camera

    • Flies the camera to a new position and target, the same motion a clicked point of interest uses.

      The camera turns the shorter way around over animationSpeed seconds along ease, and 0 or less jumps straight there. The call returns at once while the flight plays. If the active camera is not an arc-rotate camera, a new one replaces it.

      Parameters

      • inputs: FlyToDto

        The camera position and target to fly to, the flight time and the easing curve

      Returns void

      Nothing; the flight continues after the call returns

      bitbybit.advanced.navigation.flyTo({ cameraPosition: [10, 10, 10], cameraTarget: [0, 0, 0], animationSpeed: 1.5, ease: Bit.Inputs.Math.easeEnum.easeOutQuart });
      
    • Animates the camera so the given meshes fill the view, keeping its viewing angle.

      The target moves to the meshes and the distance to the camera's own framing of them, times 1 plus offset, over animationSpeed seconds along ease. Without an arc-rotate camera, or without meshes that have vertices, it logs a warning and does not move the camera.

      Parameters

      • inputs: ZoomOnDto

        The meshes, whether their children count, the margin, the clipping option and the motion

      Returns Promise<void>

      Nothing; the promise resolves when the camera stops

    • Animates the camera so the meshes fit the view's width and height, keeping its viewing angle.

      The target moves to the bounding box center of the meshes, at the distance where the box fits the field of view and aspect ratio, times 1 plus offset. Without an arc-rotate camera, or with no meshes, it logs a warning and does nothing.

      Parameters

      • inputs: ZoomOnDto

        The meshes to frame, whether their children count, the margin and the motion

      Returns Promise<void>

      Nothing; the promise resolves when the camera stops

    • Animates the camera to look at the given meshes from a chosen direction.

      The target moves to the bounding box center of the meshes and the camera orbits to the angle orientation sets, at distance or at one worked out from the box size and padding, over animationSpeed seconds along ease. Without an arc-rotate camera it logs a warning and does nothing.

      Parameters

      • inputs: FocusFromAngleDto

        The meshes, whether children count, the viewing direction, the distance and the motion

      Returns Promise<void>

      Nothing; the promise resolves when the camera stops

    point of interest

    • Describes a clickable marker that flies the camera to a saved view, ready to draw.

      The marker is a sphere inside a pulsing ring with name as its label. It changes color under the pointer, and a click flies the camera to cameraPosition looking at cameraTarget. Pass the result to draw.drawAnyAsync to add it to the scene.

      Parameters

      • inputs: PointOfInterestDto

        Where the marker sits, its label, the view a click flies to, the flight and the style

      Returns PointOfInterestEntity

      A point-of-interest entity to draw

      const poi = bitbybit.advanced.navigation.pointOfInterest({
      name: "Entrance", position: [0, 1, 0], cameraPosition: [10, 10, 10], cameraTarget: [0, 0, 0],
      });