@pinkaphant/kolmo 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +29 -0
- package/CLAUDE.md +8 -0
- package/README.md +67 -8
- package/bin/kolmo.mjs +456 -16
- package/dist/engine/index.d.ts +2 -0
- package/dist/engine/index.js +7 -5
- package/dist/engine/kolmoActions.js +24 -9
- package/dist/engine/kolmoActions.js.map +1 -1
- package/dist/engine/kolmoActor.js +19 -31
- package/dist/engine/kolmoActor.js.map +1 -1
- package/dist/engine/kolmoActorHelpers.d.ts +24 -0
- package/dist/engine/kolmoActorHelpers.js +64 -0
- package/dist/engine/kolmoActorHelpers.js.map +1 -0
- package/dist/engine/kolmoGame.js +4 -1
- package/dist/engine/kolmoGame.js.map +1 -1
- package/dist/engine/kolmoHud.js +34 -15
- package/dist/engine/kolmoHud.js.map +1 -1
- package/dist/engine/kolmoInput.d.ts +2 -0
- package/dist/engine/kolmoInput.js +12 -12
- package/dist/engine/kolmoInput.js.map +1 -1
- package/dist/engine/kolmoLongDrive.d.ts +1 -1
- package/dist/engine/kolmoLongDrive.js +10 -8
- package/dist/engine/kolmoLongDrive.js.map +1 -1
- package/dist/engine/kolmoPilotMesh.js +189 -48
- package/dist/engine/kolmoPilotMesh.js.map +1 -1
- package/dist/engine/kolmoTouchOverlay.d.ts +21 -0
- package/dist/engine/kolmoTouchOverlay.js +326 -0
- package/dist/engine/kolmoTouchOverlay.js.map +1 -0
- package/dist/engine/kolmoTouchState.d.ts +50 -0
- package/dist/engine/kolmoTouchState.js +210 -0
- package/dist/engine/kolmoTouchState.js.map +1 -0
- package/dist/engine/kolmoVehicleConfig.d.ts +2 -0
- package/dist/engine/kolmoVehicleConfig.js +8 -4
- package/dist/engine/kolmoVehicleConfig.js.map +1 -1
- package/dist/engine/kolmoVehicleDriver.d.ts +1 -0
- package/dist/engine/kolmoVehicleDriver.js +26 -50
- package/dist/engine/kolmoVehicleDriver.js.map +1 -1
- package/dist/engine/kolmoVehicleInner.js +31 -19
- package/dist/engine/kolmoVehicleInner.js.map +1 -1
- package/dist/engine/kolmoWorld.js +6 -2
- package/dist/engine/kolmoWorld.js.map +1 -1
- package/dist/engine/longDriveKit.d.ts +6 -1
- package/dist/engine/longDriveKit.js +8 -5
- package/dist/engine/longDriveKit.js.map +1 -1
- package/dist/engine/macroCellBuilder.d.ts +10 -0
- package/dist/engine/macroCellBuilder.js +101 -18
- package/dist/engine/macroCellBuilder.js.map +1 -1
- package/dist/engine/mainlandMacroCell.js +18 -9
- package/dist/engine/mainlandMacroCell.js.map +1 -1
- package/dist/importer/DomainWorkshopPanel.d.ts +3 -3
- package/dist/importer/DomainWorkshopPanel.js +148 -44
- package/dist/importer/DomainWorkshopPanel.js.map +1 -1
- package/dist/importer/GateHudBar.d.ts +2 -0
- package/dist/importer/GateHudBar.js +113 -35
- package/dist/importer/GateHudBar.js.map +1 -1
- package/dist/importer/GlbImportGate.js +16 -3
- package/dist/importer/GlbImportGate.js.map +1 -1
- package/dist/importer/LiveDrivePads.js +5 -3
- package/dist/importer/LiveDrivePads.js.map +1 -1
- package/dist/importer/Step1CalibrationPlinth.js +2 -2
- package/dist/importer/WheelRingHandles3D.js +2 -1
- package/dist/importer/WheelRingHandles3D.js.map +1 -1
- package/dist/importer/chopShopActions.js +20 -16
- package/dist/importer/chopShopActions.js.map +1 -1
- package/dist/importer/chopShopHandlers.js +16 -9
- package/dist/importer/chopShopHandlers.js.map +1 -1
- package/dist/importer/chopShopIoActions.d.ts +2 -0
- package/dist/importer/chopShopIoActions.js +33 -2
- package/dist/importer/chopShopIoActions.js.map +1 -1
- package/dist/importer/cylinderBooleanSlice.js.map +1 -1
- package/dist/importer/fusedWheelDetect.d.ts +2 -2
- package/dist/importer/fusedWheelDetect.js +227 -106
- package/dist/importer/fusedWheelDetect.js.map +1 -1
- package/dist/importer/fusedWheelFit.d.ts +6 -0
- package/dist/importer/fusedWheelFit.js +82 -1
- package/dist/importer/fusedWheelFit.js.map +1 -1
- package/dist/importer/gateStore.d.ts +2 -2
- package/dist/importer/gateStore.js +4 -3
- package/dist/importer/gateStore.js.map +1 -1
- package/dist/importer/glbNormalizer.js +5 -0
- package/dist/importer/glbNormalizer.js.map +1 -1
- package/dist/importer/importerWebMcpTools.js +3 -2
- package/dist/importer/importerWebMcpTools.js.map +1 -1
- package/dist/importer/index.d.ts +4 -2
- package/dist/importer/index.js +7 -3
- package/dist/importer/khrCarGeometryMass.d.ts +20 -0
- package/dist/importer/khrCarGeometryMass.js +125 -0
- package/dist/importer/khrCarGeometryMass.js.map +1 -0
- package/dist/importer/khrCarPlanHelpers.js +12 -22
- package/dist/importer/khrCarPlanHelpers.js.map +1 -1
- package/dist/importer/khrCarPlanner.js +52 -85
- package/dist/importer/khrCarPlanner.js.map +1 -1
- package/dist/importer/proceduralC12AndCraft.d.ts +18 -0
- package/dist/importer/proceduralC12AndCraft.js +302 -0
- package/dist/importer/proceduralC12AndCraft.js.map +1 -0
- package/dist/importer/proceduralDomainBuilders.d.ts +10 -0
- package/dist/importer/proceduralDomainBuilders.js +346 -0
- package/dist/importer/proceduralDomainBuilders.js.map +1 -0
- package/dist/importer/proceduralPersonAndProp.d.ts +8 -0
- package/dist/importer/proceduralPersonAndProp.js +303 -0
- package/dist/importer/proceduralPersonAndProp.js.map +1 -0
- package/dist/importer/starterScene.d.ts +3 -1
- package/dist/importer/starterScene.js +69 -13
- package/dist/importer/starterScene.js.map +1 -1
- package/dist/importer/universalGateBake.js +43 -11
- package/dist/importer/universalGateBake.js.map +1 -1
- package/dist/importer/useChopShopController.d.ts +3 -1
- package/dist/importer/useChopShopController.js +33 -18
- package/dist/importer/useChopShopController.js.map +1 -1
- package/dist/importer/useChopShopState.d.ts +1 -1
- package/dist/importer/useChopShopState.js +35 -9
- package/dist/importer/useChopShopState.js.map +1 -1
- package/dist/importer/wheelCutterHelpers.d.ts +7 -4
- package/dist/importer/wheelCutterHelpers.js +58 -28
- package/dist/importer/wheelCutterHelpers.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +20 -7
- package/dist/junk/DestructibleTarget.js +9 -3
- package/dist/junk/DestructibleTarget.js.map +1 -1
- package/dist/junk/ShardPieces.js +10 -2
- package/dist/junk/ShardPieces.js.map +1 -1
- package/dist/junk/index.d.ts +1 -0
- package/dist/junk/index.js +2 -1
- package/dist/junk/junkProceduralScenes.d.ts +12 -0
- package/dist/junk/junkProceduralScenes.js +220 -0
- package/dist/junk/junkProceduralScenes.js.map +1 -0
- package/dist/sand3d/KolmoSand3D.d.ts +19 -0
- package/dist/sand3d/KolmoSand3D.js +92 -0
- package/dist/sand3d/KolmoSand3D.js.map +1 -0
- package/dist/sand3d/Sand3dWorkshopSection.d.ts +8 -0
- package/dist/sand3d/Sand3dWorkshopSection.js +117 -0
- package/dist/sand3d/Sand3dWorkshopSection.js.map +1 -0
- package/dist/sand3d/gateBakeHelpers.d.ts +21 -0
- package/dist/sand3d/gateBakeHelpers.js +225 -0
- package/dist/sand3d/gateBakeHelpers.js.map +1 -0
- package/dist/sand3d/gateDoorwayBake.d.ts +12 -0
- package/dist/sand3d/gateDoorwayBake.js +203 -0
- package/dist/sand3d/gateDoorwayBake.js.map +1 -0
- package/dist/sand3d/index.d.ts +3 -0
- package/dist/sand3d/index.js +4 -0
- package/dist/sand3d/index.js.map +1 -0
- package/dist/sand3d/sand3dAssetLoader.d.ts +28 -0
- package/dist/sand3d/sand3dAssetLoader.js +177 -0
- package/dist/sand3d/sand3dAssetLoader.js.map +1 -0
- package/dist/suika/KolmoSuikaOrb.d.ts +33 -0
- package/dist/suika/KolmoSuikaOrb.js +375 -0
- package/dist/suika/KolmoSuikaOrb.js.map +1 -0
- package/dist/suika/index.d.ts +4 -0
- package/dist/suika/index.js +5 -0
- package/dist/suika/index.js.map +1 -0
- package/dist/suika/suikaArbiter.d.ts +60 -0
- package/dist/suika/suikaArbiter.js +265 -0
- package/dist/suika/suikaArbiter.js.map +1 -0
- package/dist/suika/suikaGeometry.d.ts +10 -0
- package/dist/suika/suikaGeometry.js +251 -0
- package/dist/suika/suikaGeometry.js.map +1 -0
- package/dist/suika/suikaTypes.d.ts +74 -0
- package/dist/suika/suikaTypes.js +196 -0
- package/dist/suika/suikaTypes.js.map +1 -0
- package/dist/world/index.d.ts +1 -1
- package/dist/world/index.js +2 -2
- package/dist/world/worldTypes.d.ts +4 -0
- package/dist/world/worldTypes.js +21 -1
- package/dist/world/worldTypes.js.map +1 -1
- package/docs/api-reference.md +82 -125
- package/package.json +22 -11
- package/skills/kolmo-engine/SKILL.md +111 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { KOLMO_EXTENSION_NAME } from "../schema/kolmoTypes.js";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { DOOR_HINGE_SPEC } from "@khr3/c12";
|
|
4
|
+
// src/importer/proceduralC12AndCraft.ts
|
|
5
|
+
var C12_PROCEDURAL_RECIPES = Object.freeze([
|
|
6
|
+
{
|
|
7
|
+
id: "c12_doorway_wall",
|
|
8
|
+
label: "Doorway Wall",
|
|
9
|
+
domain: "c12",
|
|
10
|
+
targetMeters: 3,
|
|
11
|
+
massKg: 0,
|
|
12
|
+
color: "#94a3b8"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "c12_window_wall",
|
|
16
|
+
label: "Window Wall",
|
|
17
|
+
domain: "c12",
|
|
18
|
+
targetMeters: 3,
|
|
19
|
+
massKg: 0,
|
|
20
|
+
color: "#38bdf8"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "c12_floor_corbel",
|
|
24
|
+
label: "Floor Corbel",
|
|
25
|
+
domain: "c12",
|
|
26
|
+
targetMeters: 3,
|
|
27
|
+
massKg: 0,
|
|
28
|
+
color: "#64748b"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "c12_stair_flight",
|
|
32
|
+
label: "Stair Flight",
|
|
33
|
+
domain: "c12",
|
|
34
|
+
targetMeters: 3,
|
|
35
|
+
massKg: 0,
|
|
36
|
+
color: "#f59e0b"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "c12_gable_roof",
|
|
40
|
+
label: "Gable Roof",
|
|
41
|
+
domain: "c12",
|
|
42
|
+
targetMeters: 3,
|
|
43
|
+
massKg: 0,
|
|
44
|
+
color: "#b45309"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "c12_hex_wing",
|
|
48
|
+
label: "C12 Hex Wing",
|
|
49
|
+
domain: "c12",
|
|
50
|
+
targetMeters: 3,
|
|
51
|
+
massKg: 0,
|
|
52
|
+
color: "#10b981"
|
|
53
|
+
}
|
|
54
|
+
]);
|
|
55
|
+
function makeFlatMat(color, roughness = .55, metalness = .18, emissive) {
|
|
56
|
+
return new THREE.MeshStandardMaterial({
|
|
57
|
+
color,
|
|
58
|
+
roughness,
|
|
59
|
+
metalness,
|
|
60
|
+
flatShading: true,
|
|
61
|
+
...emissive ? {
|
|
62
|
+
emissive,
|
|
63
|
+
emissiveIntensity: .85
|
|
64
|
+
} : {}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function addPartBox(p, name, sx, sy, sz, x, y, z, mat) {
|
|
68
|
+
const m = new THREE.Mesh(new THREE.BoxGeometry(sx, sy, sz), mat);
|
|
69
|
+
m.name = name;
|
|
70
|
+
m.position.set(x, y, z);
|
|
71
|
+
p.add(m);
|
|
72
|
+
return m;
|
|
73
|
+
}
|
|
74
|
+
function addKolmoSocket(parent, name, pos, role, emitter, rotEuler) {
|
|
75
|
+
const node = new THREE.Object3D();
|
|
76
|
+
node.name = name;
|
|
77
|
+
node.position.set(pos[0], pos[1], pos[2]);
|
|
78
|
+
if (rotEuler) node.rotation.set(rotEuler[0], rotEuler[1], rotEuler[2]);
|
|
79
|
+
const ext = {
|
|
80
|
+
...emitter ?? {},
|
|
81
|
+
socket: role
|
|
82
|
+
};
|
|
83
|
+
node.userData = {
|
|
84
|
+
kolmoSocket: role,
|
|
85
|
+
socket: role,
|
|
86
|
+
[KOLMO_EXTENSION_NAME]: ext,
|
|
87
|
+
kolmoExtension: ext
|
|
88
|
+
};
|
|
89
|
+
parent.add(node);
|
|
90
|
+
return node;
|
|
91
|
+
}
|
|
92
|
+
function buildDoorLeafMesh(w, h, t, leafHex, handleHex) {
|
|
93
|
+
const pos = [], norm = [], col = [];
|
|
94
|
+
const c = new THREE.Color();
|
|
95
|
+
const pushBox = (sx, sy, sz, ox, oy, oz, hex) => {
|
|
96
|
+
const raw = new THREE.BoxGeometry(sx, sy, sz);
|
|
97
|
+
const g = raw.index ? raw.toNonIndexed() : raw;
|
|
98
|
+
if (raw.index) raw.dispose();
|
|
99
|
+
const pa = g.getAttribute("position"), na = g.getAttribute("normal");
|
|
100
|
+
c.setHex(hex);
|
|
101
|
+
for (let i = 0; i < pa.count; i++) {
|
|
102
|
+
pos.push(pa.getX(i) + ox, pa.getY(i) + oy, pa.getZ(i) + oz);
|
|
103
|
+
norm.push(na.getX(i), na.getY(i), na.getZ(i));
|
|
104
|
+
col.push(c.r, c.g, c.b);
|
|
105
|
+
}
|
|
106
|
+
g.dispose();
|
|
107
|
+
};
|
|
108
|
+
pushBox(w, h, t, w * .5 + .005, h * .5 + .01, 0, leafHex);
|
|
109
|
+
pushBox(w * .7, h * .34, t + .014, w * .5 + .005, h * .72, 0, leafHex - 789516);
|
|
110
|
+
pushBox(w * .7, h * .32, t + .014, w * .5 + .005, h * .27, 0, leafHex - 789516);
|
|
111
|
+
pushBox(.03, .14, t + .04, w - .09, h * .48, 0, handleHex);
|
|
112
|
+
pushBox(.11, .024, t + .08, w - .12, h * .48, 0, handleHex);
|
|
113
|
+
const geo = new THREE.BufferGeometry();
|
|
114
|
+
geo.setAttribute("position", new THREE.Float32BufferAttribute(pos, 3));
|
|
115
|
+
geo.setAttribute("normal", new THREE.Float32BufferAttribute(norm, 3));
|
|
116
|
+
geo.setAttribute("color", new THREE.Float32BufferAttribute(col, 3));
|
|
117
|
+
geo.computeBoundingBox();
|
|
118
|
+
geo.computeBoundingSphere();
|
|
119
|
+
const leaf = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({
|
|
120
|
+
vertexColors: true,
|
|
121
|
+
roughness: .48,
|
|
122
|
+
metalness: .22,
|
|
123
|
+
flatShading: true
|
|
124
|
+
}));
|
|
125
|
+
leaf.name = "DoorLeaf";
|
|
126
|
+
return leaf;
|
|
127
|
+
}
|
|
128
|
+
function addC12CornerFooters(group, mat) {
|
|
129
|
+
const h = 1 / 12, w = .25;
|
|
130
|
+
for (const [tag, sx] of [["L", -1], ["R", 1]]) for (const [zTag, sz] of [["F", 1], ["B", -1]]) addPartBox(group, `LatticeFooter_${tag}_${zTag}`, w, h, w, sx * (1.5 - w * .5), h * .5, sz * (1.5 - w * .5), mat);
|
|
131
|
+
}
|
|
132
|
+
function buildProceduralC12Scene(recipeOrId = "c12_doorway_wall") {
|
|
133
|
+
const id = typeof recipeOrId === "string" ? recipeOrId : recipeOrId.id;
|
|
134
|
+
const root = new THREE.Group();
|
|
135
|
+
root.name = id;
|
|
136
|
+
const wallMat = makeFlatMat("#94a3b8", .68, .12);
|
|
137
|
+
const trimMat = makeFlatMat("#334155", .52, .28);
|
|
138
|
+
const woodMat = makeFlatMat("#b45309", .62, .1);
|
|
139
|
+
const T = .25;
|
|
140
|
+
if (id === "c12_window_wall") {
|
|
141
|
+
addC12CornerFooters(root, trimMat);
|
|
142
|
+
addPartBox(root, "WallSill", 3, .9, T, 0, .45, 0, wallMat);
|
|
143
|
+
addPartBox(root, "WallHeader", 3, .75, T, 0, 2.625, 0, wallMat);
|
|
144
|
+
addPartBox(root, "WallPier_L", .6, 1.35, T, -1.2, 1.575, 0, wallMat);
|
|
145
|
+
addPartBox(root, "WallPier_R", .6, 1.35, T, 1.2, 1.575, 0, wallMat);
|
|
146
|
+
addPartBox(root, "WindowLedge", 1.88, .06, .33, 0, .91, 0, trimMat);
|
|
147
|
+
addPartBox(root, "MullionV", .06, 1.35, .08, 0, 1.575, 0, trimMat);
|
|
148
|
+
addPartBox(root, "MullionH", 1.8, .06, .08, 0, 1.575, 0, trimMat);
|
|
149
|
+
const glassMat = new THREE.MeshStandardMaterial({
|
|
150
|
+
color: "#7dd3fc",
|
|
151
|
+
transparent: true,
|
|
152
|
+
opacity: .36,
|
|
153
|
+
roughness: .1,
|
|
154
|
+
flatShading: true
|
|
155
|
+
});
|
|
156
|
+
for (const [gi, gx, gy] of [
|
|
157
|
+
[
|
|
158
|
+
0,
|
|
159
|
+
-.45,
|
|
160
|
+
1.24
|
|
161
|
+
],
|
|
162
|
+
[
|
|
163
|
+
1,
|
|
164
|
+
.45,
|
|
165
|
+
1.24
|
|
166
|
+
],
|
|
167
|
+
[
|
|
168
|
+
2,
|
|
169
|
+
-.45,
|
|
170
|
+
1.91
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
3,
|
|
174
|
+
.45,
|
|
175
|
+
1.91
|
|
176
|
+
]
|
|
177
|
+
]) addPartBox(root, `WindowPane_${gi}`, .84, .6, .025, gx, gy, 0, glassMat);
|
|
178
|
+
addKolmoSocket(root, "Aperture_Window", [
|
|
179
|
+
0,
|
|
180
|
+
1.575,
|
|
181
|
+
0
|
|
182
|
+
], "mount");
|
|
183
|
+
} else if (id === "c12_floor_corbel") {
|
|
184
|
+
addPartBox(root, "DeckSlab", 3, 1 / 12, 3, 0, .25 - 1 / 24, 0, wallMat);
|
|
185
|
+
for (const [pos, idx] of [
|
|
186
|
+
[-1.375, 0],
|
|
187
|
+
[-.45, 1],
|
|
188
|
+
[.45, 2],
|
|
189
|
+
[1.375, 3]
|
|
190
|
+
]) {
|
|
191
|
+
addPartBox(root, `CorbelRibX_${idx}`, .25, 2 / 12, 3, pos, 1 / 12, 0, trimMat);
|
|
192
|
+
addPartBox(root, `CorbelRibZ_${idx}`, 2.5, 2 / 12, .22, 0, 1 / 12, pos, trimMat);
|
|
193
|
+
}
|
|
194
|
+
} else if (id === "c12_stair_flight") {
|
|
195
|
+
const steps = 10, sw = 1.5, stepH = 3 / steps, stepD = 3 / steps;
|
|
196
|
+
for (let i = 0; i < steps; i++) {
|
|
197
|
+
const h = (i + 1) * stepH * .28 + .08, yTop = (i + 1) * stepH, z = -1.5 + (i + .5) * stepD;
|
|
198
|
+
addPartBox(root, `StairTread_${i}`, 1.3599999999999999, h, stepD, 0, yTop - h * .5, z, woodMat);
|
|
199
|
+
}
|
|
200
|
+
addPartBox(root, "LandingBase", sw, 1 / 12, .3, 0, 1 / 24, -1.35, trimMat);
|
|
201
|
+
for (const [tag, sx] of [["L", -1], ["R", 1]]) {
|
|
202
|
+
const str = addPartBox(root, `StairStringer_${tag}`, .06, .16, 3.6, sx * (sw * .5 - .03), 1.42, 0, trimMat);
|
|
203
|
+
str.rotation.x = -Math.PI * .25;
|
|
204
|
+
const rail = addPartBox(root, `StairHandrail_${tag}`, .05, .05, 2.8, sx * (sw * .5 - .03), 1.96, -.12, woodMat);
|
|
205
|
+
rail.rotation.x = -.62;
|
|
206
|
+
addPartBox(root, `NewelLow_${tag}`, .06, 1.05, .06, sx * (sw * .5 - .03), .525, -1.44, trimMat);
|
|
207
|
+
addPartBox(root, `NewelHigh_${tag}`, .06, .6, .06, sx * (sw * .5 - .03), 2.7, 1.44, trimMat);
|
|
208
|
+
}
|
|
209
|
+
} else if (id === "c12_gable_roof") {
|
|
210
|
+
addPartBox(root, "EaveBeam_L", .18, 1 / 6, 3, -1.41, 1 / 12, 0, trimMat);
|
|
211
|
+
addPartBox(root, "EaveBeam_R", .18, 1 / 6, 3, 1.41, 1 / 12, 0, trimMat);
|
|
212
|
+
addPartBox(root, "RidgeBeam", .18, .18, 3, 0, 1.41, 0, trimMat);
|
|
213
|
+
const slopeL = addPartBox(root, "RoofSlope_L", 1.92, .1, 3, -.74, .78, 0, woodMat);
|
|
214
|
+
slopeL.rotation.z = .72;
|
|
215
|
+
const slopeR = addPartBox(root, "RoofSlope_R", 1.92, .1, 3, .74, .78, 0, woodMat);
|
|
216
|
+
slopeR.rotation.z = -.72;
|
|
217
|
+
for (const [tag, z] of [["Front", 1.42], ["Back", -1.42]]) {
|
|
218
|
+
const tri = new THREE.Shape([
|
|
219
|
+
new THREE.Vector2(-1.38, .12),
|
|
220
|
+
new THREE.Vector2(1.38, .12),
|
|
221
|
+
new THREE.Vector2(0, 1.38)
|
|
222
|
+
]);
|
|
223
|
+
const raw = new THREE.ExtrudeGeometry(tri, {
|
|
224
|
+
depth: .12,
|
|
225
|
+
bevelEnabled: false
|
|
226
|
+
});
|
|
227
|
+
const g = raw.index ? raw.toNonIndexed() : raw;
|
|
228
|
+
if (raw.index) raw.dispose();
|
|
229
|
+
g.translate(0, 0, z - .06);
|
|
230
|
+
g.computeVertexNormals();
|
|
231
|
+
const m = new THREE.Mesh(g, wallMat);
|
|
232
|
+
m.name = `GablePediment_${tag}`;
|
|
233
|
+
root.add(m);
|
|
234
|
+
}
|
|
235
|
+
} else if (id === "c12_hex_wing") {
|
|
236
|
+
addC12CornerFooters(root, trimMat);
|
|
237
|
+
const wedge = new THREE.Shape([
|
|
238
|
+
new THREE.Vector2(-1.5, -1.25),
|
|
239
|
+
new THREE.Vector2(1.5, -1.25),
|
|
240
|
+
new THREE.Vector2(0, 1.35)
|
|
241
|
+
]);
|
|
242
|
+
const raw = new THREE.ExtrudeGeometry(wedge, {
|
|
243
|
+
depth: .16,
|
|
244
|
+
bevelEnabled: false
|
|
245
|
+
});
|
|
246
|
+
const deckGeo = raw.index ? raw.toNonIndexed() : raw;
|
|
247
|
+
if (raw.index) raw.dispose();
|
|
248
|
+
deckGeo.rotateX(Math.PI * .5);
|
|
249
|
+
deckGeo.translate(0, .16, 0);
|
|
250
|
+
deckGeo.computeVertexNormals();
|
|
251
|
+
const deck = new THREE.Mesh(deckGeo, trimMat);
|
|
252
|
+
deck.name = "HexFloorWedge";
|
|
253
|
+
const cap = new THREE.Mesh(deckGeo.clone(), trimMat);
|
|
254
|
+
cap.name = "HexCeilingWedge";
|
|
255
|
+
cap.position.y = 2.84;
|
|
256
|
+
root.add(deck, cap);
|
|
257
|
+
for (const [tag, sx, yaw] of [[
|
|
258
|
+
"L",
|
|
259
|
+
-.72,
|
|
260
|
+
.5236
|
|
261
|
+
], [
|
|
262
|
+
"R",
|
|
263
|
+
.72,
|
|
264
|
+
-.5236
|
|
265
|
+
]]) {
|
|
266
|
+
const w = addPartBox(root, `HexFacetWall_${tag}`, .14, 2.68, 2.4, sx, 1.5, .05, wallMat);
|
|
267
|
+
w.rotation.y = yaw;
|
|
268
|
+
}
|
|
269
|
+
addPartBox(root, "HexApexPillar", .28, 3, .28, 0, 1.5, 1.32, trimMat);
|
|
270
|
+
} else {
|
|
271
|
+
addC12CornerFooters(root, trimMat);
|
|
272
|
+
const ow = DOOR_HINGE_SPEC.openingWidthM, oh = DOOR_HINGE_SPEC.openingHeightM;
|
|
273
|
+
const jw = (3 - ow) * .5;
|
|
274
|
+
addPartBox(root, "WallJamb_L", jw, oh, T, -(ow * .5 + jw * .5), oh * .5, 0, wallMat);
|
|
275
|
+
addPartBox(root, "WallJamb_R", jw, oh, T, ow * .5 + jw * .5, oh * .5, 0, wallMat);
|
|
276
|
+
addPartBox(root, "WallLintel", 3, 3 - oh, T, 0, oh + (3 - oh) * .5, 0, wallMat);
|
|
277
|
+
addPartBox(root, "DoorFrame_L", .05, oh, .29, -ow * .5 + .025, oh * .5, 0, trimMat);
|
|
278
|
+
addPartBox(root, "DoorFrame_R", .05, oh, .29, ow * .5 - .025, oh * .5, 0, trimMat);
|
|
279
|
+
addPartBox(root, "DoorFrame_Top", ow, .05, .29, 0, oh - .025, 0, trimMat);
|
|
280
|
+
const leaf = buildDoorLeafMesh(ow - .012, oh - .02, .046, 11817737, 16498468);
|
|
281
|
+
leaf.position.set(...DOOR_HINGE_SPEC.hingeOffsetLocal);
|
|
282
|
+
leaf.userData = {
|
|
283
|
+
c12Role: "DoorLeaf",
|
|
284
|
+
hingeOffsetLocal: [...DOOR_HINGE_SPEC.hingeOffsetLocal]
|
|
285
|
+
};
|
|
286
|
+
root.add(leaf);
|
|
287
|
+
addKolmoSocket(root, "Socket_DoorHinge", [...DOOR_HINGE_SPEC.hingeOffsetLocal], "hinge");
|
|
288
|
+
addKolmoSocket(root, "Aperture_Doorway_900x2100", [
|
|
289
|
+
0,
|
|
290
|
+
oh * .5,
|
|
291
|
+
0
|
|
292
|
+
], "mount");
|
|
293
|
+
}
|
|
294
|
+
root.userData = {
|
|
295
|
+
proceduralDomain: "c12",
|
|
296
|
+
proceduralRecipeId: id
|
|
297
|
+
};
|
|
298
|
+
return root;
|
|
299
|
+
}
|
|
300
|
+
export { C12_PROCEDURAL_RECIPES, addKolmoSocket, addPartBox, buildDoorLeafMesh, buildProceduralC12Scene, makeFlatMat };
|
|
301
|
+
|
|
302
|
+
//# sourceMappingURL=proceduralC12AndCraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proceduralC12AndCraft.js","names":[],"sources":["../../src/importer/proceduralC12AndCraft.ts"],"sourcesContent":["import * as THREE from \"three\";\nimport { DOOR_HINGE_SPEC } from \"@khr3/c12\";\nimport { KOLMO_EXTENSION_NAME, type KolmoNodeExtension, type KolmoSocketRole } from \"../schema/kolmoSchema.js\";\n\nexport interface ProceduralRecipeSpec<TId extends string = string> {\n readonly id: TId;\n readonly label: string;\n readonly domain: \"c12\" | \"craft\" | \"person\" | \"prop\" | \"junk\";\n readonly targetMeters: number;\n readonly massKg: number;\n readonly powerOrThrust?: number;\n readonly color: string;\n}\n\nexport type C12ProceduralRecipeId =\n | \"c12_doorway_wall\"\n | \"c12_window_wall\"\n | \"c12_floor_corbel\"\n | \"c12_stair_flight\"\n | \"c12_gable_roof\"\n | \"c12_hex_wing\";\n\nexport const C12_PROCEDURAL_RECIPES: readonly ProceduralRecipeSpec<C12ProceduralRecipeId>[] = Object.freeze([\n { id: \"c12_doorway_wall\", label: \"Doorway Wall\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#94a3b8\" },\n { id: \"c12_window_wall\", label: \"Window Wall\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#38bdf8\" },\n { id: \"c12_floor_corbel\", label: \"Floor Corbel\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#64748b\" },\n { id: \"c12_stair_flight\", label: \"Stair Flight\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#f59e0b\" },\n { id: \"c12_gable_roof\", label: \"Gable Roof\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#b45309\" },\n { id: \"c12_hex_wing\", label: \"C12 Hex Wing\", domain: \"c12\", targetMeters: 3, massKg: 0, color: \"#10b981\" },\n]);\n\nexport function makeFlatMat(color: string, roughness = 0.55, metalness = 0.18, emissive?: string): THREE.MeshStandardMaterial {\n return new THREE.MeshStandardMaterial({\n color,\n roughness,\n metalness,\n flatShading: true,\n ...(emissive ? { emissive, emissiveIntensity: 0.85 } : {}),\n });\n}\n\nexport function addPartBox(p: THREE.Object3D, name: string, sx: number, sy: number, sz: number, x: number, y: number, z: number, mat: THREE.Material): THREE.Mesh {\n const m = new THREE.Mesh(new THREE.BoxGeometry(sx, sy, sz), mat);\n m.name = name;\n m.position.set(x, y, z);\n p.add(m);\n return m;\n}\n\nexport function addKolmoSocket(\n parent: THREE.Object3D,\n name: string,\n pos: [number, number, number],\n role: KolmoSocketRole,\n emitter?: Omit<KolmoNodeExtension, \"socket\">,\n rotEuler?: [number, number, number],\n): THREE.Object3D {\n const node = new THREE.Object3D();\n node.name = name;\n node.position.set(pos[0], pos[1], pos[2]);\n if (rotEuler) node.rotation.set(rotEuler[0], rotEuler[1], rotEuler[2]);\n const ext: KolmoNodeExtension = { ...(emitter ?? {}), socket: role };\n node.userData = { kolmoSocket: role, socket: role, [KOLMO_EXTENSION_NAME]: ext, kolmoExtension: ext };\n parent.add(node);\n return node;\n}\n\nexport function buildDoorLeafMesh(w: number, h: number, t: number, leafHex: number, handleHex: number): THREE.Mesh {\n const pos: number[] = [], norm: number[] = [], col: number[] = [];\n const c = new THREE.Color();\n const pushBox = (sx: number, sy: number, sz: number, ox: number, oy: number, oz: number, hex: number) => {\n const raw = new THREE.BoxGeometry(sx, sy, sz);\n const g = raw.index ? raw.toNonIndexed() : raw;\n if (raw.index) raw.dispose();\n const pa = g.getAttribute(\"position\"), na = g.getAttribute(\"normal\");\n c.setHex(hex);\n for (let i = 0; i < pa.count; i++) {\n pos.push(pa.getX(i) + ox, pa.getY(i) + oy, pa.getZ(i) + oz);\n norm.push(na.getX(i), na.getY(i), na.getZ(i));\n col.push(c.r, c.g, c.b);\n }\n g.dispose();\n };\n pushBox(w, h, t, w * 0.5 + 0.005, h * 0.5 + 0.01, 0, leafHex);\n pushBox(w * 0.7, h * 0.34, t + 0.014, w * 0.5 + 0.005, h * 0.72, 0, leafHex - 0x0c0c0c);\n pushBox(w * 0.7, h * 0.32, t + 0.014, w * 0.5 + 0.005, h * 0.27, 0, leafHex - 0x0c0c0c);\n pushBox(0.03, 0.14, t + 0.04, w - 0.09, h * 0.48, 0, handleHex);\n pushBox(0.11, 0.024, t + 0.08, w - 0.12, h * 0.48, 0, handleHex);\n const geo = new THREE.BufferGeometry();\n geo.setAttribute(\"position\", new THREE.Float32BufferAttribute(pos, 3));\n geo.setAttribute(\"normal\", new THREE.Float32BufferAttribute(norm, 3));\n geo.setAttribute(\"color\", new THREE.Float32BufferAttribute(col, 3));\n geo.computeBoundingBox();\n geo.computeBoundingSphere();\n const leaf = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({ vertexColors: true, roughness: 0.48, metalness: 0.22, flatShading: true }));\n leaf.name = \"DoorLeaf\";\n return leaf;\n}\n\nfunction addC12CornerFooters(group: THREE.Group, mat: THREE.Material): void {\n const h = 1 / 12, w = 0.25;\n for (const [tag, sx] of [[\"L\", -1], [\"R\", 1]] as const) {\n for (const [zTag, sz] of [[\"F\", 1], [\"B\", -1]] as const) {\n addPartBox(group, `LatticeFooter_${tag}_${zTag}`, w, h, w, sx * (1.5 - w * 0.5), h * 0.5, sz * (1.5 - w * 0.5), mat);\n }\n }\n}\n\nexport function buildProceduralC12Scene(recipeOrId: C12ProceduralRecipeId | ProceduralRecipeSpec | string = \"c12_doorway_wall\"): THREE.Group {\n const id = (typeof recipeOrId === \"string\" ? recipeOrId : recipeOrId.id) as C12ProceduralRecipeId;\n const root = new THREE.Group();\n root.name = id;\n const wallMat = makeFlatMat(\"#94a3b8\", 0.68, 0.12);\n const trimMat = makeFlatMat(\"#334155\", 0.52, 0.28);\n const woodMat = makeFlatMat(\"#b45309\", 0.62, 0.1);\n const T = 0.25;\n\n if (id === \"c12_window_wall\") {\n addC12CornerFooters(root, trimMat);\n addPartBox(root, \"WallSill\", 3, 0.9, T, 0, 0.45, 0, wallMat);\n addPartBox(root, \"WallHeader\", 3, 0.75, T, 0, 2.625, 0, wallMat);\n addPartBox(root, \"WallPier_L\", 0.6, 1.35, T, -1.2, 1.575, 0, wallMat);\n addPartBox(root, \"WallPier_R\", 0.6, 1.35, T, 1.2, 1.575, 0, wallMat);\n addPartBox(root, \"WindowLedge\", 1.88, 0.06, T + 0.08, 0, 0.91, 0, trimMat);\n addPartBox(root, \"MullionV\", 0.06, 1.35, 0.08, 0, 1.575, 0, trimMat);\n addPartBox(root, \"MullionH\", 1.8, 0.06, 0.08, 0, 1.575, 0, trimMat);\n const glassMat = new THREE.MeshStandardMaterial({ color: \"#7dd3fc\", transparent: true, opacity: 0.36, roughness: 0.1, flatShading: true });\n for (const [gi, gx, gy] of [[0, -0.45, 1.24], [1, 0.45, 1.24], [2, -0.45, 1.91], [3, 0.45, 1.91]] as const) {\n addPartBox(root, `WindowPane_${gi}`, 0.84, 0.6, 0.025, gx, gy, 0, glassMat);\n }\n addKolmoSocket(root, \"Aperture_Window\", [0, 1.575, 0], \"mount\");\n } else if (id === \"c12_floor_corbel\") {\n addPartBox(root, \"DeckSlab\", 3, 1 / 12, 3, 0, 0.25 - 1 / 24, 0, wallMat);\n for (const [pos, idx] of [[-1.375, 0], [-0.45, 1], [0.45, 2], [1.375, 3]] as const) {\n addPartBox(root, `CorbelRibX_${idx}`, 0.25, 2 / 12, 3, pos, 1 / 12, 0, trimMat);\n addPartBox(root, `CorbelRibZ_${idx}`, 2.5, 2 / 12, 0.22, 0, 1 / 12, pos, trimMat);\n }\n } else if (id === \"c12_stair_flight\") {\n const steps = 10, sw = 1.5, stepH = 3 / steps, stepD = 3 / steps;\n for (let i = 0; i < steps; i++) {\n const h = (i + 1) * stepH * 0.28 + 0.08, yTop = (i + 1) * stepH, z = -1.5 + (i + 0.5) * stepD;\n addPartBox(root, `StairTread_${i}`, sw - 0.14, h, stepD, 0, yTop - h * 0.5, z, woodMat);\n }\n addPartBox(root, \"LandingBase\", sw, 1 / 12, 0.3, 0, 1 / 24, -1.35, trimMat);\n for (const [tag, sx] of [[\"L\", -1], [\"R\", 1]] as const) {\n const str = addPartBox(root, `StairStringer_${tag}`, 0.06, 0.16, 3.6, sx * (sw * 0.5 - 0.03), 1.42, 0, trimMat);\n str.rotation.x = -Math.PI * 0.25;\n const rail = addPartBox(root, `StairHandrail_${tag}`, 0.05, 0.05, 2.8, sx * (sw * 0.5 - 0.03), 1.96, -0.12, woodMat);\n rail.rotation.x = -0.62;\n addPartBox(root, `NewelLow_${tag}`, 0.06, 1.05, 0.06, sx * (sw * 0.5 - 0.03), 0.525, -1.44, trimMat);\n addPartBox(root, `NewelHigh_${tag}`, 0.06, 0.6, 0.06, sx * (sw * 0.5 - 0.03), 2.7, 1.44, trimMat);\n }\n } else if (id === \"c12_gable_roof\") {\n addPartBox(root, \"EaveBeam_L\", 0.18, 1 / 6, 3, -1.41, 1 / 12, 0, trimMat);\n addPartBox(root, \"EaveBeam_R\", 0.18, 1 / 6, 3, 1.41, 1 / 12, 0, trimMat);\n addPartBox(root, \"RidgeBeam\", 0.18, 0.18, 3, 0, 1.41, 0, trimMat);\n const slopeL = addPartBox(root, \"RoofSlope_L\", 1.92, 0.1, 3, -0.74, 0.78, 0, woodMat);\n slopeL.rotation.z = 0.72;\n const slopeR = addPartBox(root, \"RoofSlope_R\", 1.92, 0.1, 3, 0.74, 0.78, 0, woodMat);\n slopeR.rotation.z = -0.72;\n for (const [tag, z] of [[\"Front\", 1.42], [\"Back\", -1.42]] as const) {\n const tri = new THREE.Shape([new THREE.Vector2(-1.38, 0.12), new THREE.Vector2(1.38, 0.12), new THREE.Vector2(0, 1.38)]);\n const raw = new THREE.ExtrudeGeometry(tri, { depth: 0.12, bevelEnabled: false });\n const g = raw.index ? raw.toNonIndexed() : raw;\n if (raw.index) raw.dispose();\n g.translate(0, 0, z - 0.06);\n g.computeVertexNormals();\n const m = new THREE.Mesh(g, wallMat);\n m.name = `GablePediment_${tag}`;\n root.add(m);\n }\n } else if (id === \"c12_hex_wing\") {\n addC12CornerFooters(root, trimMat);\n const wedge = new THREE.Shape([new THREE.Vector2(-1.5, -1.25), new THREE.Vector2(1.5, -1.25), new THREE.Vector2(0, 1.35)]);\n const raw = new THREE.ExtrudeGeometry(wedge, { depth: 0.16, bevelEnabled: false });\n const deckGeo = raw.index ? raw.toNonIndexed() : raw;\n if (raw.index) raw.dispose();\n deckGeo.rotateX(Math.PI * 0.5);\n deckGeo.translate(0, 0.16, 0);\n deckGeo.computeVertexNormals();\n const deck = new THREE.Mesh(deckGeo, trimMat);\n deck.name = \"HexFloorWedge\";\n const cap = new THREE.Mesh(deckGeo.clone(), trimMat);\n cap.name = \"HexCeilingWedge\";\n cap.position.y = 2.84;\n root.add(deck, cap);\n for (const [tag, sx, yaw] of [[\"L\", -0.72, 0.5236], [\"R\", 0.72, -0.5236]] as const) {\n const w = addPartBox(root, `HexFacetWall_${tag}`, 0.14, 2.68, 2.4, sx, 1.5, 0.05, wallMat);\n w.rotation.y = yaw;\n }\n addPartBox(root, \"HexApexPillar\", 0.28, 3, 0.28, 0, 1.5, 1.32, trimMat);\n } else {\n addC12CornerFooters(root, trimMat);\n const ow = DOOR_HINGE_SPEC.openingWidthM, oh = DOOR_HINGE_SPEC.openingHeightM;\n const jw = (3 - ow) * 0.5;\n addPartBox(root, \"WallJamb_L\", jw, oh, T, -(ow * 0.5 + jw * 0.5), oh * 0.5, 0, wallMat);\n addPartBox(root, \"WallJamb_R\", jw, oh, T, ow * 0.5 + jw * 0.5, oh * 0.5, 0, wallMat);\n addPartBox(root, \"WallLintel\", 3, 3 - oh, T, 0, oh + (3 - oh) * 0.5, 0, wallMat);\n addPartBox(root, \"DoorFrame_L\", 0.05, oh, T + 0.04, -ow * 0.5 + 0.025, oh * 0.5, 0, trimMat);\n addPartBox(root, \"DoorFrame_R\", 0.05, oh, T + 0.04, ow * 0.5 - 0.025, oh * 0.5, 0, trimMat);\n addPartBox(root, \"DoorFrame_Top\", ow, 0.05, T + 0.04, 0, oh - 0.025, 0, trimMat);\n const leaf = buildDoorLeafMesh(ow - 0.012, oh - 0.02, 0.046, 0xb45309, 0xfbbf24);\n leaf.position.set(...DOOR_HINGE_SPEC.hingeOffsetLocal);\n leaf.userData = { c12Role: \"DoorLeaf\", hingeOffsetLocal: [...DOOR_HINGE_SPEC.hingeOffsetLocal] };\n root.add(leaf);\n addKolmoSocket(root, \"Socket_DoorHinge\", [...DOOR_HINGE_SPEC.hingeOffsetLocal], \"hinge\");\n addKolmoSocket(root, \"Aperture_Doorway_900x2100\", [0, oh * 0.5, 0], \"mount\");\n }\n\n root.userData = { proceduralDomain: \"c12\", proceduralRecipeId: id };\n return root;\n}\n"],"mappings":";;;;AAsBA,IAAa,yBAAiF,OAAO,OAAO;CACxG;EAAE,IAAI;EAAoB,OAAO;EAAgB,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CAC7G;EAAE,IAAI;EAAmB,OAAO;EAAe,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CAC3G;EAAE,IAAI;EAAoB,OAAO;EAAgB,QAAQ;EAAO,cAAc;EAAG,QAAQ;EAAG,OAAO;CAAU;CAC7G;EAAE,IAAI;EAAoB,OAAO;EAAgB,QAA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AAS;GAAY,kBAAkB,CAAC,GAAG,gBAAgB,gBAAgB;EAAE;EAC/F,KAAK,IAAI,IAAI;EACb,eAAe,MAAM,oBAAoB,CAAC,GAAG,gBAAgB,gBAAgB,GAAG,OAAO;EACvF,eAAe,MAAM,6BAA6B;GAAC;GAAG,KAAK;GAAK;EAAC,GAAG,OAAO;CAC/E;CAEA,KAAK,WAAW;EAAE,kBAAkB;EAAO,oBAAoB;CAAG;CAClE,OAAO;AACX"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { JUNK_PROCEDURAL_RECIPES, buildProceduralJunkScene, type JunkProceduralRecipe, type JunkProceduralRecipeId } from "../junk/junkProceduralScenes.js";
|
|
3
|
+
import { C12_PROCEDURAL_RECIPES, buildProceduralC12Scene, type C12ProceduralRecipeId, type ProceduralRecipeSpec } from "./proceduralC12AndCraft.js";
|
|
4
|
+
import { PERSON_PROCEDURAL_RECIPES, PROP_PROCEDURAL_RECIPES, buildProceduralPersonScene, buildProceduralPropScene, type PersonProceduralRecipeId, type PropProceduralRecipeId } from "./proceduralPersonAndProp.js";
|
|
5
|
+
export type CraftProceduralRecipeId = "starfighter_delta" | "vtol_dropship" | "hover_skiff" | "orbital_lander";
|
|
6
|
+
export declare const CRAFT_PROCEDURAL_RECIPES: readonly ProceduralRecipeSpec<CraftProceduralRecipeId>[];
|
|
7
|
+
export declare function buildProceduralCraftScene(recipeOrId?: CraftProceduralRecipeId | ProceduralRecipeSpec | string): THREE.Group;
|
|
8
|
+
export type ProceduralBuilderDomain = "c12" | "craft" | "person" | "prop" | "junk";
|
|
9
|
+
export declare function buildProceduralDomainScene(domain: ProceduralBuilderDomain, recipeId?: string): THREE.Group;
|
|
10
|
+
export { C12_PROCEDURAL_RECIPES, JUNK_PROCEDURAL_RECIPES, PERSON_PROCEDURAL_RECIPES, PROP_PROCEDURAL_RECIPES, buildProceduralC12Scene, buildProceduralJunkScene, buildProceduralPersonScene, buildProceduralPropScene, type C12ProceduralRecipeId, type JunkProceduralRecipe, type JunkProceduralRecipeId, type PersonProceduralRecipeId, type PropProceduralRecipeId, type ProceduralRecipeSpec, };
|