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

    Function computeMeshBounds

    • Set a mesh geometry's bounding box and sphere from the projection's precomputed bounds.

      The Mesh counterpart of computeLineBounds / the gsplat bounds pass, and the same shape: the projection already touched every vertex, so the commit sets the box from its result rather than paying a second O(N) computeBoundingBox() scan. No extent expansion, because a mesh has no per-element footprint to expand by — lines add maxWidth and gsplats maxRowNorm precisely because their elements are sprites larger than their centers.

      These bounds cover only the vertices the current index references, which is TIGHTER than computeBoundingBox() over the whole position buffer — and correct for both consumers: frustum culling and the raycast broad phase are exact over what is actually drawn, and camera framing stops covering culled geometry (#1252).

      null means nothing is drawn, which yields an empty box — and three's own Box3.getBoundingSphere() guards that case, calling Sphere.makeEmpty() for a radius of -1 that the frustum test correctly rejects. So there is ONE code path here, as in computeLineBounds. (The NaN hazard documented on createEmptyMeshNode is a different function: BufferGeometry.computeBoundingSphere() over a ZERO-vertex position buffer, which is why that placeholder carries one vertex.)

      Parameters

      Returns void