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

    Module scene/lod-selector-math

    Selector math for the per-frame LOD-group selector.

    The camera-geometry half of lod-group-registry.ts, extracted so the registry file holds the policy/state machine and this module holds the (individually unit-testable) math:

    • computeEntryWorldBox — fold a group's per-child nD raw or robust bounds into one world-space box via displayDims + matrixWorld.
    • projectBoxDiagonalPx — project that box through the camera to a screen-space pixel diagonal (with near-plane saturation). The legacy selector: 'coverage' metric.
    • projectBoxAreaFraction — project that box to the fraction of the viewport AREA its screen-space rect covers (same near-plane saturation). The selector: 'screen-area' metric.
    • pickChildWithHysteresis — pick the level for whichever metric the group's selector names, with asymmetric downgrade hysteresis.

    The registry re-exports projectBoxAreaFraction / projectBoxDiagonalPx / pickChildWithHysteresis so existing importers (the selector unit tests) are unchanged.

    WorldBoxSource
    WorldBoxOptions
    DEGENERATE_RECT_HALF_EXTENT
    MAX_MEDIAN_FOOTPRINT_PX
    projectBoxDiagonalPx
    projectBoxAreaFraction
    pickChildWithHysteresis
    pickChildByFootprintWithHysteresis
    projectWorldRadiusPx
    computeEntryWorldBox