Repository navigation
Conversation
|
Independent check — pass (Node 22 test runner, no game files). Environment: Windows 11, Node.js.
AI-assisted (Devin). |
|
T3 Preview check of |
Studio camera integration checkConfirmed the test integration reported in #5083 (comment) using an isolated local tree combining:
Retain #5017's - const camera = { position: new Vector3(0, 2, 5), zoom: 1 };
+ const camera = { position: new Vector3(0, 2, 5), zoom: 1, updateProjectionMatrix() {} };On Windows 11 with Node 24.18.0, the stock combined command This is a test-stub integration change. Both published branches were left unchanged; no competing PR was created. The relevant source is |
|
Tested
|
viewer: reset Studio camera to the selected model fit (BUILD-1516)
Item: BUILD-1516. Claim: coordination issue #4933.
Problem
The Studio's Reset Camera button calls
OrbitControls.reset(). After a model loads, the page positions the camera to fit that model, but Reset Camera still restores the startup pose(0, 2, 5). This can put the camera inside or immediately against a larger model instead of showing the complete object.On upstream
3faac557, the synthetic Studio regression loads a model with maximum dimension 30, which fits at(45, 36, 54). After panning/moving the camera and activating Reset Camera, the actual position is(0, 2, 5).Root cause and fix
The Studio loads Three.js r128 OrbitControls, whose constructor captures the initial camera position, target and zoom for
reset(). The API'ssaveState()method updates that snapshot. See OrbitControls r128 source.Save the new fitted state immediately after the successful model-load callback updates the controls. Reset then uses the fit for the active model, including after selecting another model of a different size. Before any successful load, the initial empty-scene reset behaviour is unchanged.
Verification
Synthetic regression tests execute
viewer/studio.html's actual load and reset handlers via Node's VM, with lightweight GLTFLoader, Box3 and OrbitControls stubs. The OrbitControls stub implements the snapshot semantics in r128. No browser, network, external assets or game files are used.3faac557, adding the new test before the fix yields one failure ((0, 2, 5)instead of(45, 36, 54)) and one passing control case (reset with no loaded model).node --test tests/test_viewer_studio_camera.cjs tests/test_viewer_streaming.cjs: 53/53 passed (Node v26.10.0, Apple M5, macOS 27.2.1).python3 -I tests/test_ci_registration.py: 11/11 passed. The new root-level JS test is already included by the existingnode --test tests/test_*.cjsCI command.python3 -I scripts/check_no_game_data.py viewer/studio.html tests/test_viewer_studio_camera.cjs: passed.git diff --check: clean.Independent review confirmed the r128 OrbitControls snapshot/restore contract and reran both new tests and all 11 CI registration checks successfully.
No visual or real WebGL driver behaviour is claimed; the tested defect is the camera-reset snapshot, not the transient effects of OrbitControls damping or active auto-rotation. This is distinct from #3923 (stale model requests and disposal). Its current patch overlaps the fitted-camera callback and its test stub does not yet implement
saveState(), so integration will need a small reconciliation (including the stub); there is no functional dependency between the repairs. The final audit reproduced the one baseline failure and one passing control, reran all 53 Node and 11 CI-registration tests, and rechecked the clean diff.AI-assisted (Codex). No game data, keys, decryption or protected files were used.