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

    Progressive GSplats loader for multi-LOD datasets.

    Wraps N GSplatsSpatialIndexLoader instances and loads LODs progressively, using cache hits to determine how many LODs fit within the frame budget.

    Implements

    Index
    loadedLODs: LoadedGSplatsData[] = []
    _loadedLODCount: number = 0
    lastViewState: ViewState | null = null
    nLods: number
    _initialLoadDone: boolean = false
    _lastAllResident: boolean = true
    _disposed: boolean = false
    _resetGeneration: number = 0
    _concatCache:
        | { generation: number; lodCount: number; result: LoadedGSplatsData }
        | null = null
    _levelsAtPassStart: number = 0
    _payloadsAtPassStart: number = 0
    _restoredFullLadderAtPassStart: boolean = false
    _retryFoldedPass: boolean = false
    energyTable: readonly number[] | null
    path: string
    sliceCache: SliceCache | null
    _metadataWarmStarted: boolean = false
    _prefetchController: AbortController | null = null
    _prefetchPlanning: boolean = false
    _prefetchingLevels: Set<number> = ...
    _lastLoggedPrefetchDepth: number | null = null
    _frameBudgetMs: number | null = null
    _ladderDepth: number | null = null

    Pinned rung count for the current pass (ViewState.ladderDepth, the playback "detail" setting), resolved through resolveLadderDepth; null when the pass is not pinned. A pinned pass loads exactly this many rungs, cold or not, and reports hasMoreLODs === false like a budgeted one — the pinned prefix IS the target.

    • get committedEnergyFraction(): number | null

      Cumulative energy fraction e(k) ∈ [0, 1] of the currently loaded LOD prefix — how much of this ladder's total self-energy the committed chunks carry (the additive orderer's own ranking criterion, stamped at build time as lod_stats.energy_fraction_cum). null when the dataset carries no energy stamps; 0 before any LOD loads. Read at commit time by stampLadderComplete (→ the committedEnergyFraction mesh stamp) for the display gate's energy-threshold upgrade release.

      Returns number | null

    • get lastAllResident(): boolean

      Whether the most recently streamed LOD level was fully cache-resident (no chunk fetched from the network). Drives the monitor's cached-vs-streaming residency indicator. Defaults to true before any load.

      Returns boolean

    • Measured footprint of the loaded ladder, for the shared sweep residency budget (scene-loader/progressive/residency-budget). Sums real byteLengths rather than modelling a per-element cost. Rung count comes from _loadedLODCount (LOGICAL levels), not loadedLODs.length, which is 1 once the ladder has folded.

      Returns LadderResidency

    • Discard the levels the current pass appended, restoring the ladder to the prefix the pass started from. Called by the main-update and refinement catches; see ../loaders/progressive/pass-rollback for why a failed commit must not leave the cursor advanced.

      Returns number

      Levels discarded (0 when the pass appended none).

    • Concatenate loaded LODs, memoized on (resetGeneration, LOD count). An unchanged view state with no new LODs returns the SAME object reference — safe because the result is never mutated downstream (worker projection inputs are structured-cloned, not transferred) — letting the commit pipeline skip no-op re-commits by identity.

      Each fresh result is also stamped with a PREFIX-LINEAGE parent (the previous same-generation memo) via setPrefixParent, so the commit layer can recognise a genuine prefix-extension and take the append fast path (depth-sorting Phase 4 Stage 2). The parent is null for the first level of a generation (a view change bumps the reset generation and empties loadedLODs), which is correct — the first commit extends nothing.

      Parameters

      Returns LoadedGSplatsData

    • Prefetch unloaded LOD chunks into cache, bounded by L0 headroom.

      This is fire-and-forget: the prefetched chunks land in the L0/L1 cache and become fast cache hits on the next updateView() call.

      Uses prefetchChunks() which performs the spatial index query and zarr get() calls (populating the cache) WITHOUT allocating full-size output buffers or running the accumulator — avoiding wasted memory.

      Parameters

      Returns void

    • Parameters

      • request: {
            firstLevel: number;
            maxLevels: number;
            headroom: number;
            viewState: ViewState;
            firstPlan: Promise<GSplatsPrefetchPlan>;
        }
      • controller: AbortController

      Returns Promise<void>