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

    Reader of the .mgeom files (schema/maquette-geom.fbs, format 1), for the engine's MeshLoader: it reads in workers on this module (see FileReader). One InputMesh per representation of an object: its uuid is the object id (the key of its .mdata), its name the object type, its tag the representation ('3D' or '2D'), one part per .mgeom part of its 3D mesh, or of its 2D meshes (whatever their projection axis, together); its SVG meshes are left out.

    The geometry buffers are compressed with the meshoptimizer codecs, or raw: a geometry is decoded at its first use, into buffers the engine's MeshController then copies into its Containers. The positions are dequantized to float32. A geometry of lines only (no triangles, its edges the lines) is read as lines (primitive 'lines'). The file has no BVH: the controller builds one on the first raycast.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    extension: "mgeom" = 'mgeom'

    Extension of the files it reads.

    workerCount?: number

    Workers to read with, each one file at a time; default: the cores but one, at most the scene's settings.loading.maxWorkers.

    Accessors

    • get ready(): Promise<void>

      Resolves once meshoptimizer's decoder is compiled, which open needs.

      Returns Promise<void>

    Methods

    • Opens a .mgeom file: reads its header and materials, indexes its geometries. Throws when the decoder is not ready yet (see ready).

      Parameters

      • buffer: ArrayBuffer
      • name: string

      Returns LoadedFile

    • In a worker made by createWorker, makes a reader of this class (no constructor argument) and reads the files the engine sends it. Called at the bottom of the reader's module: does nothing on the main thread.

      Parameters

      • this: new () => FileReader
      • Optionalscope: LoadingScope

        Where the files come from; default: the worker's global scope, when in one.

      Returns void