viewer/studio.html has an RU/EU switch and an I18N table, but several
of its entries were never applied, so the EU page kept Russian text: the
five stats labels (Модель, Категория, Полигонов, Вершин, Размер файла),
the reset-camera button, the texture gallery heading, the "Все" category
chip, the texture count, and the empty-list messages for models and
textures. The "show all" button and the texture load error had no
entries at all.
Apply them: applyTranslations sets the labels (each is the text node in
front of its value, so the markup stays as it is), the button, the
heading, the chip and the count; the lists, which re-render on a switch,
read their messages from I18N. Two entries are added for the "show all"
button and the load error. The category names and the model download
alert are left for later.
Tested: new test in tests/test_viewer_studio.cjs (fails before the
change, passes after); the existing studio tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The map viewer loads only what is near the camera, and nothing in it shows
where the rest of a world is: a placed world is kilometres across, and a
chunk that fails to load is only a number in the HUD.
M opens a map of the whole world from above, drawn from world.json alone:
one rectangle per chunk (its cell when it names a tier, otherwise the X/Z
extent of its bounds), coloured by its streaming state (not loaded,
loading, loaded, failed). It shows the camera and its view direction, the
spawn point and, without LOD sets, the loading radius. The line under it
names the point under the cursor, in a placed world also as RAGE X and Y,
and the chunk there with its state. A click moves the camera there, 10 m
above the full-detail geometry at that point unless it is already higher;
the wheel over the map zooms it about the cursor.
Nothing touches the page until the map is first opened, and an open map is
redrawn at most every 100 ms. tests/test_viewer_map.cjs runs the map's
code from the page together with the streaming code, in a new file so the
open pull requests on tests/test_viewer_streaming.cjs are not touched.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The studio's stats panel gave a model's triangles, vertices and file
size. Checking an export needs the next layer too: how big the model is,
how many meshes and materials it has, and which textures each material
uses at what size. Add that to the panel, read from the loaded glTF
alone:
- the bounding-box size in metres (glTF units), three significant
digits, so a ring and a building both read sensibly;
- meshes / materials / textures (GLTFLoader makes one mesh per glTF
primitive; a texture used in two slots counts once);
- a collapsible list of the materials, each with the meshes using it
and its texture slots with their sizes. A material with neither a
texture nor vertex colours is marked "no texture", the flat-colour
look of a texture the export lost.
In clay and normals mode the list keeps the model's own materials.
Names are escaped, the new labels follow the RU/EU switch, and a failed
or stale download leaves the shown model's details in place.
Tested: three new node tests in tests/test_viewer_studio.cjs (fail
before the change, pass after); in a browser with tools/gallery.py and
a synthetic .glb (two meshes sharing a textured material, an untextured
one, a vertex-coloured one).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
After a failed download the list kept the failed model selected, while the
viewport and the statistics still showed the previous one. Remember the model
that is shown and select its row again, without rebuilding the list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
index.html hashes the three.js module graph in its import map and modulepreload links; studio.html hashes its three classic scripts and its CDN fallback, which document.write now actually loads (setting src on a failed script never refetched). tests/test_viewer_cdn_integrity.py checks every remote URL in viewer/*.html.
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).
HTTPServer sets SO_REUSEADDR. On Windows that lets a second socket bind a
port that is already being listened on, so a second `serve.py --port N`
printed its URL and then received no requests while the first viewer kept
answering. ViewerServer leaves the option off on Windows, where a restart
needs none, and keeps it elsewhere; the second viewer now stops with the
existing "can't listen on port" line.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
serve.py put its device-name, alternate-data-stream and trailing-dot
guards in front of /world/ only; every other path went straight to
SimpleHTTPRequestHandler. On Windows GET /NUL opened the device (200,
empty) and /index.html::$DATA, /index.html. and /index.html%20 were
served. The viewer folder holds one page, so outside /world/ the server
now answers "/" and "/index.html" and nothing else (404), matched
before any decoding. Without --world, /world/ is 404 as well instead of
falling through to a world folder that happens to sit beside the page.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>