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

    Module scene/lod-freshness

    Pure, dependency-free LOD freshness + settle helpers used by the LODGroupRegistry selector. Kept out of lod-group-registry.ts (which is already large and THREE/camera-bound) so this logic is unit-testable in isolation — every function here is pure over plain inputs (a child stub + numbers), no THREE, no camera, no mocking.

    Freshness distinguishes a level whose committed geometry reflects the CURRENT view (slice / displayDims) version from one that is merely "ready" (geometry committed) but stale — a re-slice overwrites geometry in place without flipping readiness, so the registry needs the per-mesh loadedViewVersion stamp (written at commit by stamp-view-version.ts) to know which level to actually display. Freshness is tracked for the LOD-capable leaf geometry types; nested groups carry no per-slice staleness and are always "fresh".

    Settle is the debounce that drives deferred reloads: while the view version changes every frame (active scrub) we want to show only the cheap coarse level; once it has been stable for a few frames we reload the fine level. SettleTracker answers "has the version been stable for N ticks?".

    The never-downgrade display gate built on these primitives lives in the sibling module lod-display-gate.ts (shouldHoldPreviousDisplay, subtreeDisplayProgress).

    SettleTracker
    FreshnessChild
    isReady
    isTrackedLeaf
    isFresh
    coarsestFreshIndex
    visibleElementCount
    countFromUserData