Commit Graph

45 Commits

Author SHA1 Message Date
13e0f40b61 Merge pull request #2329 from syfyra/feat/viewer-follow-cam-link
viewer: follow a camera link opened in the open page (VIEWER-FOLLOW-CAM-LINK)
2026-12-01 16:18:54 +01:00
5addc0128b Merge pull request #2243 from syfyra/fix/viewer-slow-key
viewer: slow flight on C instead of Ctrl (VIEWER-SLOW-KEY-CTRL-W)
2026-12-01 16:18:16 +01:00
b58f74a956 Merge pull request #651 from kirigayakazima/fix/viewer-chunk-idle-timeout
viewer: reset chunk download deadline while body bytes stream (VIEWER-CHUNK-IDLE-TIMEOUT)
2026-11-29 03:16:02 +01:00
0370dc2a17 viewer: follow a camera link opened in the open page (VIEWER-FOLLOW-CAM-LINK)
The camera hash (#cam=x,y,z,yaw,pitch) was read once at startup. A link
pasted into the address bar of a tab that already shows the viewer, or
Back/Forward between two links, changes only the hash: the page does not
reload and the camera stayed where it was. The viewer now applies the
hash again on hashchange; a hash that is not a camera link is ignored,
as at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:50:04 +01:00
393dab2e73 viewer: slow flight on C instead of Ctrl (VIEWER-SLOW-KEY-CTRL-W)
The help line offered Ctrl as the slow modifier for W A S D and Q/E, but
with a movement key held Ctrl makes a browser shortcut: Ctrl+W closes
the tab (a page cannot cancel it in Chromium or Firefox), Ctrl+S and
Ctrl+D open the save-page and bookmark dialogs and Ctrl+E moves the
focus to the address bar. The keydown handler leaves modified keys to
the browser, so slow flight forward lost the whole viewer, and every
other slow direction left the page.

Slow is now the C key, which no browser binds. Ctrl leaves the speed
alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 11:08:00 +01:00
23b70597de viewer: report body read failures separately from invalid JSON (WORLD-JSON-READ-MISREPORTED)
loadWorld() read the body and parsed it in one try, so a 200 response whose
body read failed was reported as "could not be read as valid JSON".
The read and the parse now have separate stages, and the message names the
stage that failed. Tests cover a failed read, invalid JSON text and a valid body.
2026-11-24 16:10:56 +01:00
5e19f48910 viewer: reset chunk download deadline while body bytes stream (VIEWER-CHUNK-IDLE-TIMEOUT) 2026-11-24 18:59:02 +08:00
c1f343a1ae viewer: a trackpad's sideways scroll leaves the camera speed alone (old #6256)
The free camera's wheel handler took every wheel event, so a trackpad's two-finger sideways scroll
(deltaX only, deltaY 0) hit the "deltaY >= 0" branch and divided the speed by 1.15 per event.

The handler now ignores an event whose horizontal component is larger than its vertical one, so a
pan does not slow the camera. test_viewer_streaming.cjs drives the captured wheel handler and
checks climb per frame: a sideways event keeps 4 m, a dominant horizontal diagonal keeps 4 m, and
one notch up gives 4.6 m (40 m/s * 1.15 * 0.1 s).
2026-11-24 10:50:36 +08:00
1ffabec455 tests: give the camera vm context the globals the viewer uses at load
viewer/index.html calls loadWorld() at module scope, which creates an
AbortController and arms a setTimeout. This test's vm context provides
neither, so the Shift/Ctrl camera test died with 'AbortController is
not defined' (setTimeout next once it is added), and the viewer-tests
job fails on every PR: Node 24's vm context has only what the sandbox
gives it, as Node 20's does here. The globals are now in the sandbox,
with timers that never fire since the manifest has no chunks.
2026-11-24 03:39:17 +02:00
e5a05eccf0 Merge pull request #4284 from Atomic258
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:13:06 -05:00
04975128eb Merge pull request #3907 from Oleg Makarov
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:28 -05:00
9def8c5c3c Merge pull request #3199 from Tayar
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:59 -05:00
044ed20fed TEST-931: Cover shared skeleton disposal on eviction 2026-11-22 19:31:47 -05:00
2baf85b035 Viewer: time out stalled startup manifests (TEST-858) 2026-11-23 01:23:21 +03:00
e823aa1ffc Keep browser shortcuts from triggering viewer actions 2026-11-22 19:16:10 -03:00
1c4c6474e5 Merge pull request #3795 from Oleg Makarov 2026-11-22 17:03:51 -05:00
918acc3271 Merge pull request #3365 from shdann 2026-11-22 17:01:42 -05:00
40ccbab001 Viewer: time out stalled chunk downloads (BUILD-1074) 2026-11-23 00:36:18 +03:00
698d270ef2 viewer: the right Ctrl key slows the camera too
The help line says "Shift fast · Ctrl slow", and the speed factor tests
both Shift keys but only ControlLeft, so holding the right Ctrl key moved
at full speed.

The test runs the viewer's own main loop for one synthetic frame per key
and compares how far E climbs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 23:15:10 +03:00
670d84b904 Merge pull request #3140 from Max Hurst 2026-11-22 15:15:04 -05:00
39c984fe4a Merge pull request #3118 from airp1ane 2026-11-22 15:14:56 -05:00
5f5efae004 Merge pull request #2457 from Vonsek 2026-11-22 15:10:48 -05:00
6f06dfd46a Enable viewer drag-to-look on pointer lock error events 2026-11-22 19:29:57 +00:00
6ac2d12a42 Viewer: reject malformed LOD tier names 2026-11-22 14:26:50 -05:00
57400b83fa Merge pull request #2704 from Vonsek 2026-11-22 13:17:12 -05:00
722c4fd97c merge: preserve upstream changes alongside the asset fix 2026-11-22 19:08:58 +01:00
dd3a843435 fix(viewer): match normals across generated terrain borders
Neighboring tiles share heights, but their normals came from disjoint triangle neighborhoods and produced a lighting seam.
2026-11-22 18:56:36 +01:00
eef47a90d4 fix(viewer): keep orphan HD outside LOD handoffs
Standalone high-detail chunks have their own band and can share a cell with the normal detail chain.
2026-11-22 18:12:49 +01:00
ec670d350b fix(viewer): keep a cached LOD visible during tier loading
Crossing a draw-band boundary hid the existing tier while its replacement was still downloading or parsing, leaving an empty cell.
2026-11-22 18:06:20 +01:00
d18f8f65d8 Merge pull request #2156 from TripleA 2026-11-22 11:42:20 -05:00
3d3f7ce339 test(viewer): cover drag-to-look release and focus changes 2026-11-22 17:08:17 +01:00
eee69f2bc4 Viewer: share the camera position through the URL hash (P key) 2026-11-22 16:57:00 +01:00
44ca61d067 Test the viewer overlay when WebGL initialization fails 2026-11-22 15:27:45 +01:00
02ba5f28b2 Viewer: hide cached LOD chunks outside their draw band 2026-11-22 12:18:39 +01:00
99a40c54b1 world_build: instanced placements with bounded memory, and LOD chunk sets
--placements used to copy a model's geometry into every placement and keep
all copies until chunking (#1183 review: 22 GB for a 700 m box). Now each
model's OBJ is parsed once into a packed cache file, each chunk stores every
model it uses once, and the placements are instance transforms:
EXT_mesh_gpu_instancing by default (three.js GLTFLoader reads it), one plain
glTF node per placement with --instancing nodes, or the old baked copies
with --instancing bake. Chunks are written as soon as they are built; with
--jobs N, packing and chunk writing run in N processes, at most 4N jobs in
flight. Memory is about 100 bytes per placement plus the models of the
chunks being written.

Every instance TRS has a positive determinant. A negative XY scale is folded
into the rotation; a negative Z scale draws a mirrored copy of the mesh
(glTF Y negated, winding reversed). Zero-scale placements are counted as
degenerate_scale. iter_placements streams the rows load_placements selects,
with the same checks (load_placements is unchanged).

--lod-sets builds one chunk set per lodLevel tier (c_<tier>_<x>_<z>, with
the tier and grid cell in each chunk record) and writes lod_bands to
world.json: a camera-distance band per tier from the entities' median
childLodDist/lodDist. The viewer loads a tiered chunk while the horizontal
distance to its cell is in the band (32 m slack before unloading), so each
cell shows one tier; worlds without lod_bands stream as before, and the
manifest check rejects unknown tiers, unordered bands and missing cells.

glb_writer: pack_primitive and _MaterialTable are factored out of build_glb
(output unchanged), plus build_instanced_glb / write_instanced_glb and
instance_bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:02:54 +00:00
4ace9e0793 Test deferred viewer bounds through the G shortcut 2026-11-22 05:12:58 +01:00
d54b9c3628 Merge pull request #824 from FreddyxS 2026-11-21 22:37:50 -05:00
4ad731e718 Test that viewer shading preserves GLB material metadata 2026-11-22 04:32:29 +01:00
da43e0c134 Test manifest chunks with test metadata 2026-11-22 04:20:58 +01:00
66da9d20bd Tests: cover redirected GLB resource URLs 2026-11-22 02:24:37 +01:00
21ec948cf2 Release decoded bitmaps when a viewer chunk is discarded 2026-11-21 21:45:05 -03:00
e87d82d7c0 Test viewer chunk scheduling work and order 2026-11-22 00:36:00 +01:00
024dc0ecdd Cover malformed and missing viewer manifests 2026-11-21 23:49:26 +01:00
c8081eb0ba Cancel distant viewer chunk downloads after camera moves 2026-11-21 23:12:33 +01:00
0c17741bf4 Viewer: retry failed chunk loads with bounded backoff 2026-11-21 17:29:15 -04:00