mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Batch consecutive disjoint installation outlines to avoid three stencil draws per feature. Preserve overlapping volumes, material order and local precision. Delete the public effect handle correctly during teardown. Keep imagery below ground classifications and glyphs in every activation order, including minimal mode without tone mapping. Exclude fully offscreen ground volumes from the screen candidate grid. Full unit/allocation, boundaries, formatting and keyless builds pass. Browser checks cover contour coverage, bounded colour differences, a missing-contour negative control, real pass order, sprite alpha and FIRMS glows. Whole-wave performance acceptance remains separate from this implementation checkpoint.
30 lines
799 B
JavaScript
30 lines
799 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { PerspectiveCamera } from 'three';
|
|
import { groundClipBounds } from './navaraGroundGeometry.js';
|
|
|
|
test('ground volumes wholly outside a screen edge do not enter the candidate grid', () => {
|
|
const camera = new PerspectiveCamera(60, 1.6, 1, 1000);
|
|
const frame = { radius: 1, floor: -1, ceiling: 1 };
|
|
for (const [x, y] of [
|
|
[100, 0],
|
|
[-100, 0],
|
|
[0, 100],
|
|
[0, -100],
|
|
]) {
|
|
const view = new Float64Array([x, y, -10, 1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
|
assert.deepEqual(
|
|
[
|
|
...groundClipBounds(
|
|
frame,
|
|
view,
|
|
camera.projectionMatrix,
|
|
new Float64Array(4),
|
|
),
|
|
],
|
|
[2, 2, 2, 2],
|
|
`offscreen volume at ${x}, ${y}`,
|
|
);
|
|
}
|
|
});
|