feat(playcanvas): share dockable scene tools and persistent model editing

This commit is contained in:
DCCONSTRUCTIONS
2026-11-04 00:42:59 +03:00
parent 038337783f
commit 2f0a066dde
40 changed files with 3238 additions and 126 deletions
@@ -44,8 +44,15 @@ test('editing excludes drive bindings and key controls without changing arm auth
const editor=fs.readFileSync(new URL('../src/components/rover/editor/RoverScene.tsx',import.meta.url),'utf8');assert.doesNotMatch(editor,/\.arm\(|setDemand|\/api\/v1\/fleet/);
});
test('export manifest retains complete geometry and all editable material groups',()=>{
const manifest=JSON.parse(fs.readFileSync(new URL('../public/rover-scene/dcd006-v020.json',import.meta.url),'utf8'));
assert.equal(manifest.source_object_count,1426);assert.equal(manifest.render_mesh_count,9);assert.equal(manifest.source_saved,false);assert.match(manifest.uv,/cube/);
const manifest=JSON.parse(fs.readFileSync(new URL('../public/rover-scene/dcd006-v022.json',import.meta.url),'utf8'));
assert.equal(manifest.source_object_count,1281);assert.equal(manifest.render_mesh_count,Object.keys(defaultScene().materials).length);assert.equal(manifest.source_saved,false);assert.match(manifest.uv,/cube/);
assert.equal(manifest.source_sha256,'4fae2c9928b3254475d01929f042d1604af3fbc196bb93ad39543384f15d8a86');
assert.equal(Object.keys(manifest.mount_frames.source_world_matrices).length,16);
const cam=manifest.mount_frames.source_world_matrices.FRAME_CAM_FIXED;
assert.ok(Math.abs(cam[0][3]-.173)<1e-6);assert.ok(Math.abs(cam[1][3]-.0065)<1e-6);assert.ok(Math.abs(cam[2][3]-.603940785)<1e-6);
const names=Object.values(manifest.materials).flatMap(m=>m.sourceObjects);
for(const part of ['CAM MOLLE R09 • D22 • фиксированная','K1 V2 C22 · Держатель · карман 58.8×53','K1 V2 · Съёмная крышка','K1 V2 C21 · Нижнее основание'])assert.ok(names.includes(part),part);
assert.ok(!names.some(n=>/VAN004|LANTSUN|COMMS \|/.test(n)));
assert.deepEqual(Object.keys(manifest.materials).sort(),Object.keys(defaultScene().materials).map(k=>k.replace('rover/','')).sort());
});