SDK JS
    Preparing search index...

    Class WorkerBvcGltfSplatDecoder

    Fans BVC-in-glTF .glb splat decodes out to a WorkerPool of module workers so the rANS/entropy decode never blocks the render thread. Drop-in for BvcGltfSplatDecoder (same decode(glb) contract).

    concurrency reports the pool size so the consumer can size the engine's decode queue to keep every worker busy. Decode-only (BVC encode is a licensed native capability, never shipped to the browser).

    import { WorkerBvcGltfSplatDecoder } from '@bitruvius/bvc';

    const splatDecoder = new WorkerBvcGltfSplatDecoder();
    const cloud = await splatDecoder.decode(glbBytes);
    splatDecoder.dispose(); // tear down the pool when the layer is removed

    Implements

    • GltfSplatDecoder
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    concurrency: number

    Worker pool size — size the engine's decode concurrency to match.

    Methods

    • Decode one BVC-in-glTF .glb tile on a worker.

      Parameters

      • glb: ArrayBuffer

        The complete .glb tile bytes. Transferred (not copied) to the worker.

      Returns Promise<GltfSplatCloud>

      The GltfSplatCloud (see BvcGltfSplatDecoder.decode for the field shapes/units): positions in metres, de-interleaved splat attribute arrays.

      Rejects on worker spawn failure or wasm init failure, or if the bytes are not a valid BVC-in-glTF tile.

    • Optional fast path: decode AND rebase/pack into the shared ENU layout IN THE WORKER, so the O(splat-count) packEnu stays off the main thread. Output is identical to decoding then packing on the main thread.

      Parameters

      • glb: ArrayBuffer

        The complete .glb tile bytes. Transferred (not copied) to the worker.

      • enuFromEcef: Mat4

        4×4 column-major matrix mapping ECEF → the scene's local ENU (east-north-up) frame. Cloned to the worker (shared across tiles).

      • tileTransform: Mat4

        4×4 column-major tile-to-ECEF transform from the tileset.

      • lod: number

        The tile's level-of-detail index, carried through onto the output.

      Returns Promise<PackedSplatTile>

      A PackedSplatTile (the tiles3d decode→renderer seam) packed in the shared ENU layout, ready for the splat renderer.

      Rejects on worker spawn failure or wasm init failure, or on invalid bytes.

    • Tear down the worker pool and release its workers. Safe to call repeatedly.

      Returns void