Repository navigation
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at c457ea308 on Windows 11 (Node 24.22.3): node --test tests/test_viewer_studio_clipping.cjs -> 4 tests, 4 pass, 0 fail; git diff --check clean.
The Studio viewer's camera near/far planes now scale with the loaded model's bounds instead of using fixed values, so a tiny and a very large model both stay inside the clip range; the new Node test covers both sizes and the no-model case. No blocking issue.
|
T3 Preview integration at One integration test needs updating. The combined stock Node run passed 66/67. The camera stub in #5017's reset test lacks |
|
Tested
|
What and why
ASSET-412, claimed in the coordination thread.
Studio moves the camera according to each loaded model's bounds, but keeps fixed clipping planes at near=0.1 and far=1000. The auto-fit therefore hides otherwise valid small and large models: the actual load callback places every corner of a synthetic 0.01-unit cube before the near plane and every corner of a 1000-unit cube beyond the far plane.
Scale both clipping planes with the same model extent used to position the camera, preserving the existing far/near ratio, and refresh the projection matrix. Four production lines change. Add synthetic Node tests that execute the actual loadModel callback and project all eight model corners into the resulting clip volume, including repeated selections of different sizes and centers.
Depends on: #5017
This is an integration dependency for the adjacent camera-fit block. Its controls.saveState insertion should be retained; the test stub supports that method. No semantic dependency on the Reset Camera fix.
Validation
Windows 11, Node 24.18, upstream
3faac557b1584d39004357918e60325b4d4ff0fe:node --test tests/test_viewer_studio_clipping.cjs tests/test_viewer_streaming.cjs: 55/55 pass (4 new, 51 existing).git diff --checkpasses.CPU geometry/callback tests only; no browser, WebGL, GPU, or driver validation claimed. All bounds and models in the tests are synthetic. No game files accessed or included. AI-assisted: yes.
Verified integration with #5017
Combining #5017 at
86047cb0afd49c505eace070b63d4baf54ceabe1with this head needs one test-mock addition intests/test_viewer_studio_camera.cjs:Retain
controls.saveState()aftercontrols.update()alongside the clip-plane/projection changes. The stock combined camera/clipping run gives 5 passes and 1 TypeError. With only this mock change, all 6 tests pass on Node 24.18.0. The clipping test stays byte-identical to this PR. This is a local CPU callback integration check; the separate published heads were left unchanged.