fast-mesh-wasm
    Preparing search index...

    Interface WorkerSceneOptions

    Options of createWorkerScene.

    interface WorkerSceneOptions {
        backgroundAddTriangles?: number;
        createWorker?: () => WorkerLike;
        debug?: boolean;
        threads?: number;
        workerUrl?: string | URL;
    }
    Index
    backgroundAddTriangles?: number

    Meshes of at least this many triangles are added in the background: the Worker builds them in steps while the requests sent after them that do not need them run (toggles, edits, drags, queries of other meshes), so those do not wait for a large add. A request that names the new mesh (or a field measured to it), adds or removes a mesh, or queries every mesh waits for it, so the engine's state is the same as in arrival order; but a reply to an unrelated request sent after the add can arrive before the mesh, whose status reads "computing" (and whose views are empty) until it lands. Defaults to 65,536; Infinity turns background adds off, so every add comes back with its own batch's result. A number, 0 or more.

    createWorker?: () => WorkerLike

    Creates the Worker instead (overrides workerUrl).

    debug?: boolean

    Development checks, off by default: render views are then Proxy objects that warn once when read after a mirror they view was replaced (a mesh's slot count changed, a buffer turned on or off, the mesh was removed). See MeshViews. Also logs, once per scene, why the engine runs single-threaded when more threads were asked for (as in development builds, where import.meta.env.DEV is set).

    threads?: number

    The threads the engine computes with: its WebAssembly runs on a pool of this many Workers sharing its memory. Defaults to the logical cores (navigator.hardwareConcurrency), at most 8; 1 runs the single-threaded engine. Threads need a cross-origin isolated page (COOP/COEP headers); elsewhere, or when the threaded engine fails to start, the scene runs single-threaded. WorkerScene.threads tells which. An integer, clamped to 1 to MAX_THREADS.

    workerUrl?: string | URL

    The Worker script, loaded as a module Worker. Defaults to the package's worker-entry.js next to this module, which bundlers pick up from the new Worker(new URL(...), { type: "module" }) pattern.