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

    Customizes the objects a MeshLoader reads: subclass it and give it to MeshLoader.load with the files it handles (one per load call: files handled differently are loaded with different ones). On the main thread, the loader calls for each object received updateObject, then shouldKeepObject, then for a kept one onObjectRead, before queuing it; its own checks (geometry) come after, on the updated object, and call onObjectSkipped for a kept object they leave out. Once the object is in the scene, it calls onMeshAdded with its proxy. The loader adds every object kept as a new object: the duplicates (e.g. an object already loaded) are the import controller's to leave out, in shouldKeepObject. An object without parts (e.g. an empty glTF node) is not queued: told read, never added. A method that throws fails the object's file.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Called once the object is added to the scene, in the order of the additions, e.g. to link it to an application object (mesh.owner); in the same task as the addition, so a state set here (visibility, x-ray) is drawn from its first frame. Do not keep input: its parts hold the geometry buffers. Default: nothing.

      Parameters

      • input: InputMesh
      • mesh: MeshProxy

        Its proxy in the scene's MeshController: what reads and changes it.

      Returns void

    • Called for each kept object as it is read, in the file's order, before the loader's checks: with or without parts, e.g. to make the application object of a node of its hierarchy. An object without parts is never added; one with parts may still be left out (see LoadProgress.skipped). Do not keep input: its parts hold the geometry buffers. Default: nothing.

      Parameters

      Returns void

    • Called when the loader's checks leave out a kept object (invalid, missingGeometry, see SkipReason), e.g. to forget it was kept. Not called for the objects shouldKeepObject rejects, nor for those of a file that fails (see LoadProgress.errors). Do not keep input: its parts hold the geometry buffers. Default: nothing.

      Parameters

      Returns void

    • Whether the object is added to the scene; false leaves it out, listed in LoadProgress.skipped with the reason rejected. Default: true.

      Parameters

      Returns boolean

    • Changes the object before it is checked, e.g. its uuid, its name or its parts' materials. Default: nothing.

      Parameters

      Returns void