Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Interface MeshDataLoader

    Data loader interface for Mesh nodes.

    Mirrors DataLoader / LinesDataLoader / GSplatsDataLoader so the scene-loader machinery treats all four kinds uniformly — and so a spatial-index implementation can be swapped in behind this interface later with no caller change (spec §7).

    The viewState parameters are honoured but do not change what is fetched: a mesh is whole-node resident, so both methods return the same complete LoadedMeshData and the view state matters only downstream, where the cull decides which faces are indexed.

    interface MeshDataLoader {
        loadMesh(
            viewState: ViewState,
            session?: UpdateSession,
        ): Promise<LoadedMeshData>;
        updateView(
            viewState: ViewState,
            session?: UpdateSession,
            signal?: AbortSignal,
            residencyAllowanceBytes?: number,
        ): Promise<LoadedMeshData>;
        dispose(): void;
        addEventListener?(listener: MonitorEventListener): void;
        removeEventListener?(listener: MonitorEventListener): void;
        getMetrics?(): LoaderMetrics;
        getActiveQueries?(): QueryInfo[];
        recordVisibleElements?(triangles: number): void;
    }

    Implemented by

    Index
    • LoaderMonitor surface (optional, for the data-loading-monitor UI). Mirrors the surface the sibling loaders expose — implementations that don't track metrics may omit these. Both shipped implementations (MeshWholeNodeLoader, MeshProgressiveLoader) provide all four: connectLoaderToMonitor duck-types the complete set, so a partial implementation is silently skipped rather than partially reported.

      Parameters

      Returns void

    • Report how many triangles the just-committed slice indexes, for LoaderMetrics.visibleElements.

      Pushed IN (by commit-mesh-geometry.ts) rather than read out, because the count is produced downstream of the loader: a mesh is resident in full and projection decides which faces reach the index buffer. The three sibling geometries set visibleElements inside their loaders instead, where the range query that produced the visible set lives.

      Optional for the same reason as the four above — a metrics-free implementation may omit it.

      Parameters

      • triangles: number

      Returns void