Shelf: move geometry build into a system, slim renderer
Follows the renderer/system split documented in wiki/architecture/ renderers.md and systems.md: the renderer must not run geometry generation. Mirrors the door-renderer/door-system pattern. - New ShelfSystem reads dirtyNodes in useFrame, retrieves the shelf's registered Group from sceneRegistry, swaps its children with the output of buildShelfGeometry(node), then clears the dirty flag. Geometry rebuild is fully imperative — no React work involved. - ShelfRenderer is now a thin empty <group> that registers with sceneRegistry, marks the node dirty on mount, and carries the pointer-event handlers + live transform overrides at the root. - Wired system into shelfDefinition so RegisteredSystems mounts it alongside the renderer. Net effect: dragging shelf parametric sliders no longer re-renders the renderer per tick — the system rebuilds meshes at frame cadence based on dirtyNodes, the inspector's per-field subscription only re-renders the dragged field, and the rest of the React tree stays quiet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
f874cecf8f
commit
7f24593041
@@ -46,6 +46,10 @@ export const shelfDefinition: NodeDefinition<typeof ShelfNode> = {
|
||||
kind: 'parametric',
|
||||
module: () => import('./renderer'),
|
||||
},
|
||||
system: {
|
||||
module: () => import('./system'),
|
||||
priority: 5,
|
||||
},
|
||||
preview: () => import('./preview'),
|
||||
tool: () => import('./tool'),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user