MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / slabSystem

Function slabSystem

examples/scene-graph/room.ts:135–159  ·  view source on GitHub ↗
(dt: number)

Source from the content-addressed store, hash-verified

133
134// SlabSystem (priority 1) — generates slab geometry for dirty slabs
135function slabSystem(dt: number): void {
136 for (const id of dirtyNodes) {
137 const node = nodes.get(id);
138 if (!node || node.type !== 'slab') continue;
139
140 const handle = ensureSceneNode(id);
141 const slab = node as SlabNode;
142
143 // Flatten polygon for extrusion
144 const flat: number[] = [];
145 for (const [x, z] of slab.polygon) {
146 flat.push(x);
147 flat.push(z);
148 }
149
150 // Extrude polygon to create slab
151 extrudePolygon(handle, flat, slab.elevation);
152
153 // Gray floor material
154 setSceneNodeColor(handle, 0.75, 0.75, 0.70, 1.0);
155 setSceneNodePbr(handle, 0.6, 0.0);
156
157 clearDirty(id);
158 }
159}
160
161// WallSystem (priority 4) — generates wall geometry with door cutouts
162function wallSystem(dt: number): void {

Callers

nothing calls this directly

Calls 7

extrudePolygonFunction · 0.90
setSceneNodeColorFunction · 0.90
setSceneNodePbrFunction · 0.90
ensureSceneNodeFunction · 0.85
clearDirtyFunction · 0.85
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected