This is the entry point into the application.
Create an instance to set up the viewer on your canvas.

const canvas = document.getElementById('babylon-canvas');
const viewer = Viewer(canvas, viewerSettings, defaultSceneSettings);

Use "manager" sub classes for interacting with the Babylon.js engine. (e.g. modelManager for loading models into the scene)

Hierarchy

  • Viewer

Constructors

Properties

canvas: HTMLCanvasElement
version: string = buildInfo.version

Accessors

Methods

  • Calculates size of the current scene.
    Only takes meshes into considerations that:

    • are visible
    • are not excluded by "excludeGeometry" parameter
    • do not have an infinite distance (like sky boxes)

    Parameters

    Returns BoundingInfo

  • Destroys this viewer instance and disposes Babylon.js engine and all scene content

    Returns void

  • Pause rendering can be usefull when doing internal scene processings that should not be visible to the user, e.g. cloning meshes for gltf export

    Returns void

Generated using TypeDoc