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

    The objects of the viewer, composed: the MeshController that stores the meshes, the SpriteController of the sprites, their boxTree (TeiaViewer's scene BVH of the parts' and the sprites' world boxes), the CuttingPlanesController that cut them, the Raycaster that picks them, the frame the files are placed in (origin), how they look (settings, lighting), and the three.js scenes a Renderer draws (threeScene, then the toolScene).

    The objects are added, changed and removed through their controller (scene.meshController, scene.spriteController) or their proxy: the controller is their only writer, of their leaves of the BoxTree too. The scene tells the tree's changes (signals).

    Index

    Constructors

    • Creates an empty scene, for any backend.

      Parameters

      • settings: EngineSettings = ...

        The engine's, its renderer's too: how the objects look (background, lighting, selection, x-ray...), each applied live; and how they are stored, loaded and picked, most read now (e.g. loaded from a storage before). Default: the default ones.

      Returns Scene

    Properties

    boxTree: BoxTree

    The BVH of the world boxes of the mesh parts and of the sprites, for the culling and the picking: a leaf per part or sprite, its id telling which (see LeafIds), with the same flags (shown, layer). Written by a worker, which rebuilds it by itself once degraded, from the changes the controllers send; followed a message later (see BoxTree.whenApplied).

    boxTreeHelper: BoxTreeHelper

    Draws the nodes of the boxTree, for debugging: hidden at first, in the threeScene. Ask for a frame after changing it, or when its tree changed while shown.

    cuttingPlanesController: CuttingPlanesController

    What lies behind one of these planes is neither drawn nor picked, except the objects that ignore them. Kept by clear: the application's, as the camera.

    cuttingPlanesHelper: CuttingPlanesHelper

    Draws the cuttingPlanesController's planes, as the viewer: shown at first, in the threeScene. Ask for a frame after hiding or showing it.

    lighting: Lighting

    How the objects are lit, from its settings' and an environment image.

    meshController: MeshController

    Stores the meshes: add, change, remove and find them.

    raycaster: Raycaster

    Ray queries on the objects.

    settings: EngineSettings = ...

    The engine's, its renderer's too: how the objects look (background, lighting, selection, x-ray...), each applied live; and how they are stored, loaded and picked, most read now (e.g. loaded from a storage before). Default: the default ones.

    signals: { changed: Signal<() => void> } = ...

    Tells what the scene changed by itself, asynchronously: to draw again.

    Type Declaration

    • Readonlychanged: Signal<() => void>

      The boxTree applied changes or was rebuilt, by its worker, or a setting changed.

    spriteController: SpriteController

    Stores the sprites: add, change, remove and find them.

    threeScene: Scene<Object3DEventMap> = ...

    The three.js scene drawn by the Renderer: the objects' meshes and sprites (meshController.group, spriteController.group, filled by the backend), the cuttingPlanesHelper and the boxTreeHelper; the application may add its own objects.

    toolScene: Scene<Object3DEventMap> = ...

    The application's tools (a transform gizmo, a cursor): a three.js scene drawn by the Renderer after the threeScene, over it whatever their depth, without its post-processing (ambient occlusion, antialiasing). Ask for a frame after changing it.

    Accessors

    • get byteLength(): number

      Memory of the scene, in bytes: the stored meshes and sprites, and the BoxTree.

      Returns number

    • get origin(): Vector3 | null

      World coordinates of the scene's frame origin: world = origin + scene coordinates, which stay small (float32 precision) whatever the georeferencing. The offset of the first batch of objects loaded (MeshLoader.applyFileOffsets), or set by setOrigin; null until then, and again after clear.

      Returns Vector3 | null

    Methods

    • Removes every object, meshes and sprites, and forgets the origin: the next files give it again.

      Returns void

    • Stops the workers of its BoxTree, frees its helpers, stops following its settings (which it does not own): the scene is not used after.

      Returns void

    • World bounds of every object, meshes and sprites (the BoxTree's root, a message after their changes); empty without objects.

      Parameters

      Returns Box3

    • Sets the scene's frame origin (see origin), copied; null forgets it.

      Parameters

      Returns void