You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds 15 new tests on top of the 5 that landed with the initial
frustum-culling commit. Targets the parts of the visibility surface
that were uncovered:
Vertical FOV / pitch:
- sprite far above the camera (outside vertical FOV) → culled
- sprite far below the camera → culled
- pitching up brings an above-frustum sprite into view
- pitching down brings a below-frustum sprite into view
Sphere edge cases:
- sphere center behind near plane but radius pokes through → visible
- sprite at exactly the far plane → visible (edge of frustum)
- 1×1 px sprite deep in the frustum → still correctly classified
Off-axis camera positions:
- camera shifted right by 1000 units: sprite at the camera's new
forward axis is visible, sprite at world origin is now outside FOV
Narrow FOV:
- wide-FOV cam sees a sprite that narrow-FOV cam culls (same world
pose) — proves fov actually affects culling, not just rendering
User-reported regression (PR #1464):
- reproduces the exact scenario the user reported: Camera3d example
with 3 monsters at z=200/400/600, camera at (0, 0, -300) orbiting
z=400 at distance=700, one left-arrow click (yaw -= 0.15). All 3
monsters MUST remain visible after the click. Pre-fix, inheriting
Camera2d's worldView rect silently culled all three. Stress
variant: 8 clicks (yaw ≈ -69°) — orbit-target monster still in
frame.
Multi-update consistency:
- moving camera far without calling update keeps the old planes
(verifies no auto-rebuild)
- update rebuilds the planes, isVisible reflects the new pose
- moving back + update again gets the original behavior — proves
planes are state-correct across multiple updates
3631 tests pass (was 3620 + 11 new isVisible tests + cleanup of
the debug logging in camera3d.ts I added while diagnosing the user
report).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments