Per-frame near/far update from the cached bounding sphere.
Zero allocations, and zero scene-graph traversal once the bounds
are cached — the ensure() below is O(1) after the first
successful hit. (A metadata-less scene has no negative caching, so
that ensure() re-walks the graph each frame — see
scene-bounds-cache.ts.) Only updates the camera when values
changed more than 0.1% (stability gate to avoid projection-matrix
thrash from sub-pixel camera moves).
No-op (returns early) when:
the bounds cache is empty (no metadata available);
the sphere is degenerate (near >= far — e.g. a zero-extent
single-point scene, whose radius-0 sphere yields no valid frustum);
Per-frame near/far update from the cached bounding sphere.
Zero allocations, and zero scene-graph traversal once the bounds are cached — the
ensure()below is O(1) after the first successful hit. (A metadata-less scene has no negative caching, so thatensure()re-walks the graph each frame — seescene-bounds-cache.ts.) Only updates the camera when values changed more than 0.1% (stability gate to avoid projection-matrix thrash from sub-pixel camera moves).No-op (returns early) when: