Walk scene and aggregate the world-space bounding box of every
renderable primitive. Points, Lines, and GSplats all render as
THREE.Mesh + InstancedBufferGeometry, so one shape covers those three;
Mesh renders a plain indexed BufferGeometry and needs its own:
THREE.Mesh with InstancedBufferGeometry and
userData.nodeType in {'points', 'lines', 'gsplats'} —
bounding box from the geometry, instanceCount for the
primitive count.
THREE.Mesh with userData.nodeType === 'mesh' — bounding box from the
geometry (which a mesh commit sets from the projection's INDEXED-vertex
bounds, so it already excludes culled geometry — see computeMeshBounds),
and the DRAWN TRIANGLE count (drawRange.count / 3, see
drawnTriangleCount) for the primitive count.
THREE.InstancedMesh — bounding box from the geometry, plus
the count from mesh.count for the primitive count.
Other Object3D types contribute nothing to bounds. Empty
geometries / zero-count primitives are skipped so a returned
box of box.isEmpty() === true actually means "no visible
geometry."
The instanced arm's nodeType list is NOT the geometry vocabulary, and widening
it alone would be a false fix: that arm also requires an
InstancedBufferGeometry, so a type rendered from a plain BufferGeometry
would still contribute nothing and frame the camera wrongly, silently. This
warning was left by the groundwork phase and it described a real bug — a
mesh-only scene returned empty bounds and zero primitives until the mesh arm
below was added. Any future non-instanced type needs its own arm too.
Pure with respect to the scene — does NOT mutate object world
matrices; the caller should call scene.updateMatrixWorld(true)
before calling if needed.
Walk
sceneand aggregate the world-space bounding box of every renderable primitive. Points, Lines, and GSplats all render asTHREE.Mesh + InstancedBufferGeometry, so one shape covers those three; Mesh renders a plain indexedBufferGeometryand needs its own:THREE.MeshwithInstancedBufferGeometryanduserData.nodeTypein {'points', 'lines', 'gsplats'} — bounding box from the geometry,instanceCountfor the primitive count.THREE.MeshwithuserData.nodeType === 'mesh'— bounding box from the geometry (which a mesh commit sets from the projection's INDEXED-vertex bounds, so it already excludes culled geometry — seecomputeMeshBounds), and the DRAWN TRIANGLE count (drawRange.count / 3, see drawnTriangleCount) for the primitive count.THREE.InstancedMesh— bounding box from the geometry, plus the count frommesh.countfor the primitive count.Other Object3D types contribute nothing to bounds. Empty geometries / zero-count primitives are skipped so a returned box of
box.isEmpty() === trueactually means "no visible geometry."The instanced arm's
nodeTypelist is NOT the geometry vocabulary, and widening it alone would be a false fix: that arm also requires anInstancedBufferGeometry, so a type rendered from a plainBufferGeometrywould still contribute nothing and frame the camera wrongly, silently. This warning was left by the groundwork phase and it described a real bug — a mesh-only scene returned empty bounds and zero primitives until the mesh arm below was added. Any future non-instanced type needs its own arm too.Pure with respect to the scene — does NOT mutate object world matrices; the caller should call
scene.updateMatrixWorld(true)before calling if needed.