@pinkaphant/kolmo 0.1.2 → 0.2.0

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.
Files changed (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -14
  3. package/bin/kolmo.mjs +22 -54
  4. package/dist/body/HeldItem.js +171 -0
  5. package/dist/body/KhrBody.js +171 -0
  6. package/dist/body/bodySi.d.ts +0 -11
  7. package/dist/body/bodySi.js +52 -0
  8. package/dist/body/index.d.ts +1 -1
  9. package/dist/body/index.js +4 -1
  10. package/dist/engine/index.d.ts +4 -4
  11. package/dist/engine/index.js +12 -3
  12. package/dist/engine/kolmoActor.d.ts +11 -4
  13. package/dist/engine/kolmoActor.js +197 -0
  14. package/dist/engine/kolmoInput.d.ts +17 -0
  15. package/dist/engine/kolmoInput.js +78 -0
  16. package/dist/engine/kolmoIsland.d.ts +3 -1
  17. package/dist/engine/kolmoIsland.js +311 -0
  18. package/dist/engine/kolmoLongDrive.js +223 -0
  19. package/dist/engine/kolmoRigs.js +59 -0
  20. package/dist/engine/kolmoStore.d.ts +53 -27
  21. package/dist/engine/kolmoStore.js +211 -0
  22. package/dist/engine/kolmoSurface.d.ts +1 -1
  23. package/dist/engine/kolmoSurface.js +182 -0
  24. package/dist/engine/kolmoVehicle.d.ts +3 -1
  25. package/dist/engine/kolmoVehicle.js +250 -0
  26. package/dist/engine/kolmoVehicleDriver.d.ts +30 -0
  27. package/dist/engine/kolmoVehicleDriver.js +29 -0
  28. package/dist/engine/kolmoWorld.d.ts +7 -15
  29. package/dist/engine/kolmoWorld.js +139 -0
  30. package/dist/engine/longDriveKit.d.ts +4 -2
  31. package/dist/engine/longDriveKit.js +254 -0
  32. package/dist/engine/mainlandMacroCell.d.ts +3 -7
  33. package/dist/engine/mainlandMacroCell.js +247 -0
  34. package/dist/engine/shiftedFixedBody.d.ts +13 -0
  35. package/dist/engine/shiftedFixedBody.js +64 -0
  36. package/dist/importer/ChopShopPanel.js +465 -0
  37. package/dist/importer/DomainWorkshopPanel.d.ts +9 -4
  38. package/dist/importer/DomainWorkshopPanel.js +385 -0
  39. package/dist/importer/GateHudBar.js +312 -0
  40. package/dist/importer/GlbImportGate.js +250 -0
  41. package/dist/importer/ImperativeVehicleRig.js +336 -0
  42. package/dist/importer/ImporterPlinthUikitTags.js +112 -0
  43. package/dist/importer/Step1CalibrationPlinth.js +275 -0
  44. package/dist/importer/Step2UniversalPad.js +244 -0
  45. package/dist/importer/VfxEmitterPool.js +91 -0
  46. package/dist/importer/chopShopActions.d.ts +22 -2
  47. package/dist/importer/chopShopActions.js +232 -0
  48. package/dist/importer/gateStore.d.ts +1 -1
  49. package/dist/importer/gateStore.js +92 -0
  50. package/dist/importer/glbNormalizer.js +133 -0
  51. package/dist/importer/importerWebMcp.d.ts +17 -6
  52. package/dist/importer/importerWebMcp.js +343 -0
  53. package/dist/importer/index.js +22 -3
  54. package/dist/importer/khrCompiler.d.ts +1 -1
  55. package/dist/importer/khrCompiler.js +434 -0
  56. package/dist/importer/launcherBake.js +51 -0
  57. package/dist/importer/meshIslands.d.ts +1 -1
  58. package/dist/importer/meshIslands.js +301 -0
  59. package/dist/importer/surfaceCutter.js +254 -0
  60. package/dist/importer/surfaceTopology.js +183 -0
  61. package/dist/importer/universalGateBake.js +162 -0
  62. package/dist/importer/usdToGlb.js +294 -0
  63. package/dist/importer/useChopShopController.d.ts +11 -2
  64. package/dist/importer/useChopShopController.js +364 -0
  65. package/dist/importer/vehiclePanelAnim.js +214 -0
  66. package/dist/importer/wheelAxlePairing.d.ts +1 -2
  67. package/dist/importer/wheelAxlePairing.js +102 -0
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +69 -13
  70. package/dist/junk/DestructibleTarget.js +154 -0
  71. package/dist/junk/KolmoJunk.js +65 -0
  72. package/dist/junk/ShardPieces.d.ts +6 -4
  73. package/dist/junk/ShardPieces.js +74 -0
  74. package/dist/junk/TargetDecals.js +51 -0
  75. package/dist/junk/bvhShatter.js +55 -0
  76. package/dist/junk/bvhTriCollector.js +78 -0
  77. package/dist/junk/index.js +11 -1
  78. package/dist/junk/junkGeometry.js +69 -0
  79. package/dist/junk/junkImportSanitize.js +54 -0
  80. package/dist/junk/junkImporter.js +95 -0
  81. package/dist/junk/junkLabelCanvas.js +67 -0
  82. package/dist/junk/junkLabels.js +35 -0
  83. package/dist/junk/targetHelpers.js +103 -0
  84. package/dist/junk/targetHitLogic.js +128 -0
  85. package/dist/junk/useTargetAssets.js +102 -0
  86. package/dist/physics/index.d.ts +26 -0
  87. package/dist/physics/index.js +84 -0
  88. package/dist/schema/kolmoSchema.d.ts +2 -1
  89. package/dist/schema/kolmoSchema.js +184 -0
  90. package/dist/shaders/celestialBackdrop.d.ts +1 -1
  91. package/dist/shaders/celestialBackdrop.js +344 -0
  92. package/dist/shaders/index.d.ts +0 -1
  93. package/dist/shaders/index.js +9 -1
  94. package/dist/shaders/plumeAndSparkle.js +271 -0
  95. package/dist/shaders/ps2GlslShared.d.ts +1 -1
  96. package/dist/shaders/ps2GlslShared.js +3 -0
  97. package/dist/shaders/ps2MaterialsTSL.js +65 -0
  98. package/dist/shaders/ps2MaterialsWebGL.js +40 -0
  99. package/dist/shaders/ps2RoadWebGL.js +101 -0
  100. package/dist/shaders/ps2TerrainWebGL.js +54 -0
  101. package/dist/shaders/ps2Textures.js +224 -0
  102. package/dist/shaders/retroPalettes.js +188 -0
  103. package/dist/shaders/retroShader.d.ts +31 -3
  104. package/dist/shaders/retroShader.js +249 -0
  105. package/dist/shaders/tsl.d.ts +1 -0
  106. package/dist/shaders/tsl.js +1 -0
  107. package/dist/vite/index.d.ts +15 -0
  108. package/dist/vite/index.js +90 -0
  109. package/dist/world/frontage.js +32 -0
  110. package/dist/world/index.d.ts +1 -1
  111. package/dist/world/index.js +11 -3
  112. package/dist/world/infiniteWorld2D.js +244 -0
  113. package/dist/world/island.js +201 -0
  114. package/dist/world/macroCellSchema.js +27 -0
  115. package/dist/world/macroKnightAStar.js +171 -0
  116. package/dist/world/random.js +33 -0
  117. package/dist/world/road.js +136 -0
  118. package/dist/world/roadRibbon.d.ts +6 -6
  119. package/dist/world/roadRibbon.js +161 -0
  120. package/dist/world/terrain.js +87 -0
  121. package/dist/world/worldTypes.js +111 -0
  122. package/package.json +32 -18
  123. package/dist/body-B7FTf67o.js +0 -362
  124. package/dist/engine-BeKvBM8d.js +0 -1745
  125. package/dist/importer-B2-S-N_e.js +0 -5113
  126. package/dist/junk-B4bC1zAl.js +0 -1049
  127. package/dist/kolmoSurface-DTnrFXH0.js +0 -558
  128. package/dist/shaders-GS71Ek1A.js +0 -1383
  129. package/dist/world-PRWPYrlx.js +0 -947
  130. package/dist/worldTypes-Z0KfdCd0.js +0 -226
@@ -0,0 +1,385 @@
1
+ import { BODY_SI as e } from "../body/bodySi.js";
2
+ import { LAUNCHER_RECIPES as t, buildLauncherSceneFromPlan as n } from "./launcherBake.js";
3
+ import { useState as r } from "react";
4
+ import * as i from "three";
5
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { DOOR_HINGE_SPEC as c } from "@khr3/c12";
7
+ import { VAULT_CATALOG as l } from "@khr3/assets";
8
+ import { planLauncher as u } from "@khr3/launchers";
9
+ // src/importer/DomainWorkshopPanel.tsx
10
+ var d = {
11
+ position: "absolute",
12
+ top: 52,
13
+ left: 12,
14
+ width: 292,
15
+ maxHeight: "calc(100% - 110px)",
16
+ overflowY: "auto",
17
+ padding: 12,
18
+ background: "rgba(10,12,14,0.94)",
19
+ border: "1px solid #1C2229",
20
+ borderRadius: 4,
21
+ color: "#E6EDF3",
22
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
23
+ fontSize: 11,
24
+ zIndex: 22,
25
+ display: "flex",
26
+ flexDirection: "column",
27
+ gap: 8
28
+ }, f = {
29
+ padding: "5px 8px",
30
+ background: "#11161C",
31
+ border: "1px solid #00E5FF",
32
+ color: "#E6EDF3",
33
+ borderRadius: 2,
34
+ fontSize: 10.5,
35
+ fontFamily: "inherit",
36
+ cursor: "pointer",
37
+ textAlign: "left"
38
+ };
39
+ function p(e) {
40
+ if (!e) return 0;
41
+ let t = 0;
42
+ return e.traverse((e) => {
43
+ let n = e;
44
+ if (n.isMesh && n.material) for (let e of Array.isArray(n.material) ? n.material : [n.material]) {
45
+ let n = e;
46
+ n.flatShading = !0, n.normalMap = null, n.bumpMap = null, n.map && (n.map.magFilter = i.NearestFilter, n.map.anisotropy = 1, n.map.needsUpdate = !0), n.needsUpdate = !0, t++;
47
+ }
48
+ }), t;
49
+ }
50
+ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMeters: h, onSnapC12: g, onLoadVaultUrl: _, onForgeLauncherRecipe: v, onAddSocketPatch: y, onEnforceCrispyPerson: b, onUploadToVault: x }) {
51
+ let [S, C] = r(!1), [w, T] = r("cars"), [E, D] = r(""), [O, k] = r(null), A = Object.entries(l[w]);
52
+ return /* @__PURE__ */ s("aside", {
53
+ style: d,
54
+ "aria-label": `${i.toUpperCase()} Workshop`,
55
+ children: [
56
+ /* @__PURE__ */ s("div", {
57
+ style: {
58
+ display: "flex",
59
+ justifyContent: "space-between",
60
+ alignItems: "center",
61
+ color: "#FFB000",
62
+ fontWeight: 700
63
+ },
64
+ children: [/* @__PURE__ */ o("span", { children: `WORKSHOP :: ${i.toUpperCase()}` }), /* @__PURE__ */ o("button", {
65
+ type: "button",
66
+ style: {
67
+ ...f,
68
+ padding: "2px 6px",
69
+ borderColor: "#10B981"
70
+ },
71
+ onClick: () => C((e) => !e),
72
+ children: S ? "HIDE VAULT" : "R2 VAULT"
73
+ })]
74
+ }),
75
+ i === "c12" && /* @__PURE__ */ s(a, { children: [
76
+ /* @__PURE__ */ o("div", {
77
+ style: { color: "#94A3B8" },
78
+ children: "Exact 3.0m / 0.25m C12 Cyclotomic Lattice & Openings"
79
+ }),
80
+ /* @__PURE__ */ o("button", {
81
+ type: "button",
82
+ style: f,
83
+ onClick: () => {
84
+ h(3), g(), k("Snapped to 3.00 m C12 module (12 steps).");
85
+ },
86
+ children: "[ SNAP TO 3.00M C12 MODULE ]"
87
+ }),
88
+ /* @__PURE__ */ o("button", {
89
+ type: "button",
90
+ style: f,
91
+ onClick: () => {
92
+ y("Aperture_Doorway_900x2100", [
93
+ 0,
94
+ c.openingHeightM * .5,
95
+ 0
96
+ ], "mount"), y("Socket_DoorHinge", [...c.hingeOffsetLocal], "hinge"), k("Stamped 900x2100 doorway + KHR revolute hinge socket.");
97
+ },
98
+ children: "[ STAMP 0.9x2.1M HINGED DOORWAY ]"
99
+ }),
100
+ /* @__PURE__ */ o("button", {
101
+ type: "button",
102
+ style: f,
103
+ onClick: () => {
104
+ y("Aperture_Window", [
105
+ 0,
106
+ 1.45,
107
+ 0
108
+ ], "mount"), k("Stamped window opening anchor.");
109
+ },
110
+ children: "[ STAMP WINDOW APERTURE ]"
111
+ }),
112
+ !p && /* @__PURE__ */ o("button", {
113
+ type: "button",
114
+ style: f,
115
+ onClick: () => void _(l.city.door_hinged_single, "door_hinged_900x2100"),
116
+ children: "[ LOAD VAULT: HINGED DOOR .GLB ]"
117
+ })
118
+ ] }),
119
+ i === "launcher" && /* @__PURE__ */ s(a, { children: [
120
+ /* @__PURE__ */ o("div", {
121
+ style: { color: "#94A3B8" },
122
+ children: "Articulated `@khr3/launchers` Calibration & Unified Sockets"
123
+ }),
124
+ !p && /* @__PURE__ */ o("div", {
125
+ style: {
126
+ display: "flex",
127
+ flexWrap: "wrap",
128
+ gap: 4
129
+ },
130
+ children: t.map((e) => /* @__PURE__ */ o("button", {
131
+ type: "button",
132
+ style: {
133
+ ...f,
134
+ borderColor: "#FFB000",
135
+ fontSize: 10
136
+ },
137
+ onClick: () => {
138
+ let t = u(e), r = Number((e.dims.receiverLength + e.dims.barrelLength + (e.dims.hasStock ? .22 : 0)).toFixed(2));
139
+ v?.(e.id, n(t), r), k(`Forged ${e.label} (${t.parts.length} parts, ${e.spec.magazineCapacity} rd, ${e.spec.fireRateHz} Hz)`);
140
+ },
141
+ children: `FORGE ${e.id.replace("kolmogorov_", "").toUpperCase()}`
142
+ }, e.id))
143
+ }),
144
+ /* @__PURE__ */ s("label", {
145
+ style: {
146
+ display: "flex",
147
+ justifyContent: "space-between",
148
+ alignItems: "center"
149
+ },
150
+ children: [/* @__PURE__ */ o("span", { children: "Length (m):" }), /* @__PURE__ */ o("input", {
151
+ type: "number",
152
+ step: .05,
153
+ min: .12,
154
+ max: 2.2,
155
+ value: m,
156
+ onChange: (e) => h(Number(e.target.value) || .72),
157
+ style: {
158
+ width: 72,
159
+ background: "#0A0C0E",
160
+ color: "#00E5FF",
161
+ border: "1px solid #1C2229",
162
+ padding: "2px 4px"
163
+ }
164
+ })]
165
+ }),
166
+ [
167
+ [
168
+ "IK_Palm_Primary",
169
+ [
170
+ 0,
171
+ -.06,
172
+ -.08
173
+ ],
174
+ "grip_primary"
175
+ ],
176
+ [
177
+ "IK_Index_Trigger",
178
+ [
179
+ 0,
180
+ -.02,
181
+ -.02
182
+ ],
183
+ "grip_secondary"
184
+ ],
185
+ [
186
+ "IK_Palm_Forend",
187
+ [
188
+ 0,
189
+ -.03,
190
+ .22
191
+ ],
192
+ "grip_secondary"
193
+ ],
194
+ [
195
+ "Socket_Muzzle",
196
+ [
197
+ 0,
198
+ .04,
199
+ m * .5
200
+ ],
201
+ "muzzle"
202
+ ],
203
+ [
204
+ "Socket_Eject",
205
+ [
206
+ .03,
207
+ .04,
208
+ .02
209
+ ],
210
+ "eject"
211
+ ],
212
+ [
213
+ "screen_rect",
214
+ [
215
+ 0,
216
+ .07,
217
+ -.12
218
+ ],
219
+ "optic"
220
+ ]
221
+ ].map(([e, t, n]) => /* @__PURE__ */ o("button", {
222
+ type: "button",
223
+ style: f,
224
+ onClick: () => {
225
+ y(e, [
226
+ t[0],
227
+ t[1],
228
+ t[2]
229
+ ], n), k(`Stamped ${e} (${n})`);
230
+ },
231
+ children: `+ STAMP ${e}`
232
+ }, e))
233
+ ] }),
234
+ i === "person" && /* @__PURE__ */ s(a, { children: [
235
+ /* @__PURE__ */ o("div", {
236
+ style: { color: "#94A3B8" },
237
+ children: "SI 1.75m Capsule (`BODY_SI`) & Contact / IK Sockets"
238
+ }),
239
+ /* @__PURE__ */ o("button", {
240
+ type: "button",
241
+ style: f,
242
+ onClick: () => {
243
+ h(e.capsuleHalfHeight * 2 + e.capsuleRadius * 2 + e.floatHeight), k("Scaled character to exact 1.75 m SI standing height.");
244
+ },
245
+ children: "[ LOCK 1.75M SI STANDING HEIGHT ]"
246
+ }),
247
+ /* @__PURE__ */ o("button", {
248
+ type: "button",
249
+ style: f,
250
+ onClick: () => {
251
+ b(), k("Stripped normalMap/bumpMap + forced flatShading & NearestFilter.");
252
+ },
253
+ children: "[ ENFORCE FACETED RETRO SHADING ]"
254
+ }),
255
+ /* @__PURE__ */ o("button", {
256
+ type: "button",
257
+ style: f,
258
+ onClick: () => {
259
+ y("Socket_Hand_R", [
260
+ .22,
261
+ 1.12,
262
+ .28
263
+ ], "mount"), y("Socket_Hand_L", [
264
+ -.22,
265
+ 1.12,
266
+ .28
267
+ ], "mount"), y("Socket_Back", [
268
+ 0,
269
+ 1.25,
270
+ -.18
271
+ ], "mount"), y("butt", [
272
+ 0,
273
+ .88,
274
+ -.04
275
+ ], "seat"), y("foot_l", [
276
+ .11,
277
+ .02,
278
+ .04
279
+ ], "contact"), y("foot_r", [
280
+ -.11,
281
+ .02,
282
+ .04
283
+ ], "contact"), k("Stamped Hand, Back, Butt & Foot contact sockets.");
284
+ },
285
+ children: "[ STAMP HAND, BUTT & FOOT SOCKETS ]"
286
+ })
287
+ ] }),
288
+ (i === "prop" || i === "junk") && !p && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("div", {
289
+ style: { color: "#94A3B8" },
290
+ children: i === "junk" ? "BVH Shatter & Local Decal Target" : "KHR Convex/Box Prop"
291
+ }), /* @__PURE__ */ o("button", {
292
+ type: "button",
293
+ style: f,
294
+ onClick: () => void _(l.city.prop_arcade_cabinet, "prop_arcade_cabinet"),
295
+ children: "[ LOAD VAULT: ARCADE CABINET ]"
296
+ })] }),
297
+ S && /* @__PURE__ */ s("div", {
298
+ style: {
299
+ borderTop: "1px solid #1C2229",
300
+ paddingTop: 8,
301
+ display: "flex",
302
+ flexDirection: "column",
303
+ gap: 6
304
+ },
305
+ children: [
306
+ /* @__PURE__ */ o("div", {
307
+ style: {
308
+ display: "flex",
309
+ gap: 4
310
+ },
311
+ children: [
312
+ "cars",
313
+ "weapons",
314
+ "city"
315
+ ].map((e) => /* @__PURE__ */ o("button", {
316
+ type: "button",
317
+ style: {
318
+ ...f,
319
+ borderColor: w === e ? "#FFB000" : "#1C2229"
320
+ },
321
+ onClick: () => T(e),
322
+ children: e.toUpperCase()
323
+ }, e))
324
+ }),
325
+ !p && /* @__PURE__ */ o("div", {
326
+ style: {
327
+ maxHeight: 110,
328
+ overflowY: "auto",
329
+ display: "flex",
330
+ flexDirection: "column",
331
+ gap: 3
332
+ },
333
+ children: A.map(([e, t]) => /* @__PURE__ */ o("button", {
334
+ type: "button",
335
+ style: {
336
+ ...f,
337
+ fontSize: 10
338
+ },
339
+ onClick: () => void _(t, e),
340
+ children: `-> ${e}`
341
+ }, e))
342
+ }),
343
+ x && /* @__PURE__ */ s("div", {
344
+ style: {
345
+ display: "flex",
346
+ gap: 4
347
+ },
348
+ children: [/* @__PURE__ */ o("input", {
349
+ type: "password",
350
+ placeholder: "VAULT_WRITE_TOKEN (or CF Access)",
351
+ value: E,
352
+ onChange: (e) => D(e.target.value),
353
+ style: {
354
+ flex: 1,
355
+ background: "#0A0C0E",
356
+ color: "#E6EDF3",
357
+ border: "1px solid #1C2229",
358
+ padding: "3px 5px",
359
+ fontSize: 10
360
+ }
361
+ }), /* @__PURE__ */ o("button", {
362
+ type: "button",
363
+ style: {
364
+ ...f,
365
+ borderColor: "#10B981"
366
+ },
367
+ onClick: () => {
368
+ k(`Uploading to R2 (${w})…`), Promise.resolve(x(w, E)).then((e) => k(e ? `Uploaded -> ${e.key}` : "Uploaded to R2")).catch((e) => k(e instanceof Error ? e.message : "R2 upload failed"));
369
+ },
370
+ children: "PUT R2"
371
+ })]
372
+ })
373
+ ]
374
+ }),
375
+ O && /* @__PURE__ */ o("div", {
376
+ style: {
377
+ color: "#10B981",
378
+ fontSize: 10
379
+ },
380
+ children: O
381
+ })
382
+ ]
383
+ });
384
+ }
385
+ export { m as DomainWorkshopPanel, p as enforceRetroPersonMaterials };
@@ -0,0 +1,312 @@
1
+ import { gateTelemetry as e, isGateStep1Unlocked as t, useGateStore as n } from "./gateStore.js";
2
+ import { useEffect as r, useRef as i } from "react";
3
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
4
+ // src/importer/GateHudBar.tsx
5
+ var c = "#0A0C0E", l = "#1C2229", u = "#FFB000", d = "#00E5FF", f = "#FF3B30", p = "#10B981", m = "#E6EDF3";
6
+ function h({ label: e, active: t = !1, disabled: n = !1, accent: r = u, onClick: i }) {
7
+ return /* @__PURE__ */ o("button", {
8
+ type: "button",
9
+ disabled: n,
10
+ onClick: i,
11
+ style: {
12
+ padding: "4px 8px",
13
+ borderRadius: 2,
14
+ border: `1px solid ${n ? l : t ? r : d}`,
15
+ background: t ? r : c,
16
+ color: n ? "#55606E" : t ? c : m,
17
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
18
+ fontSize: 10.5,
19
+ fontWeight: t ? 700 : 500,
20
+ cursor: n ? "not-allowed" : "pointer",
21
+ whiteSpace: "nowrap"
22
+ },
23
+ children: e
24
+ });
25
+ }
26
+ var g = {
27
+ display: "flex",
28
+ flexWrap: "wrap",
29
+ justifyContent: "space-between",
30
+ alignItems: "center",
31
+ gap: 8,
32
+ padding: "8px 12px",
33
+ background: c,
34
+ borderBottom: `1px solid ${l}`,
35
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
36
+ zIndex: 20
37
+ };
38
+ function _(c) {
39
+ let m = n(), _ = t(m.calibration, m.domain, m.vehicleArchetype, m.usePaperShellProxy), v = i(null);
40
+ r(() => {
41
+ let t = 0, n = "", r = () => {
42
+ let i = e.massKg.toFixed(0), a = e.com.map((e) => e.toFixed(2)).join(","), o = e.speedKmh.toFixed(0), s = e.rpm.toFixed(0), l = m.domain === "vehicle" ? `MASS=${i}KG COM=[${a}] HINGED=${c.choppedCount} ${s} RPM ${o} KM/H` : `MASS=${i}KG COM=[${a}] PATCHES=${c.patchCount} ${o} KM/H`;
43
+ l !== n && v.current && (v.current.textContent = l, n = l), t = requestAnimationFrame(r);
44
+ };
45
+ return t = requestAnimationFrame(r), () => cancelAnimationFrame(t);
46
+ }, [
47
+ m.domain,
48
+ c.patchCount,
49
+ c.choppedCount
50
+ ]);
51
+ let y = m.calibration, b = m.domain === "c12" ? `C12=[${y.c12Ticks.join("x")}]TICKS (${y.c12Aligned ? "ALIGNED" : "OFF-GRID"}) MIN_Y=${y.minY.toFixed(4)}M AABB=[${y.aabbSize.join("x")}]M` : m.domain === "launcher" ? `ANCHORS=${y.detectedAnchors.length || 1} MIN_Y=${y.minY.toFixed(4)}M AABB=[${y.aabbSize.join("x")}]M` : `WB=${y.wheelbase.toFixed(2)}M MIN_Y=${y.minY.toFixed(4)}M AABB=[${y.aabbSize.join("x")}]M`;
52
+ return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s("div", {
53
+ style: g,
54
+ children: [/* @__PURE__ */ s("div", {
55
+ style: {
56
+ display: "flex",
57
+ flexWrap: "wrap",
58
+ gap: 6,
59
+ alignItems: "center"
60
+ },
61
+ children: [
62
+ /* @__PURE__ */ o("span", {
63
+ style: {
64
+ fontSize: 11,
65
+ color: u,
66
+ fontWeight: 700
67
+ },
68
+ children: `KOLMO :: CAR CHOP-SHOP & GLB GATE · ${c.assetName.toUpperCase()}`
69
+ }),
70
+ [
71
+ "vehicle",
72
+ "c12",
73
+ "launcher",
74
+ "person",
75
+ "prop",
76
+ "junk"
77
+ ].map((e) => /* @__PURE__ */ o(h, {
78
+ label: `[ ${e.toUpperCase()} ]`,
79
+ active: m.domain === e,
80
+ onClick: () => c.onSelectDomain(e)
81
+ }, e)),
82
+ /* @__PURE__ */ o(h, {
83
+ label: c.hasCustomFile ? "[ REPLACE .GLB · .USD… ]" : "[ DROP / OPEN .GLB · .USD ]",
84
+ accent: d,
85
+ onClick: c.onChooseFile
86
+ }),
87
+ !c.hasCustomFile && m.domain === "vehicle" && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(h, {
88
+ label: "BLANK: SOLID PICKUP",
89
+ active: c.assetName === "pickup_truck",
90
+ accent: p,
91
+ onClick: () => c.onLoadStarterCar("/models/pickup-truck.glb", "pickup_truck")
92
+ }), /* @__PURE__ */ o(h, {
93
+ label: "BLANK: HATCHBACK",
94
+ active: c.assetName === "hatchback_86",
95
+ accent: p,
96
+ onClick: () => c.onLoadStarterCar("/models/Hatchback-segmented.glb", "hatchback_86")
97
+ })] }),
98
+ c.usdInfo && /* @__PURE__ */ o("span", {
99
+ style: {
100
+ fontSize: 10,
101
+ color: p
102
+ },
103
+ children: c.usdInfo
104
+ })
105
+ ]
106
+ }), /* @__PURE__ */ s("div", {
107
+ style: {
108
+ display: "flex",
109
+ flexWrap: "wrap",
110
+ gap: 6,
111
+ alignItems: "center"
112
+ },
113
+ children: [
114
+ /* @__PURE__ */ o(h, {
115
+ label: m.eraMode === "dreamcast-60" ? "[ ERA: DREAMCAST 60FPS ]" : "[ ERA: PSX 1/3 ]",
116
+ active: m.eraMode === "psx-1-3",
117
+ accent: d,
118
+ onClick: () => m.setField("eraMode", m.eraMode === "dreamcast-60" ? "psx-1-3" : "dreamcast-60")
119
+ }),
120
+ /* @__PURE__ */ o(h, {
121
+ label: "[ STEP 1: CHOP & CALIBRATE ]",
122
+ active: m.step === 1,
123
+ onClick: () => m.setField("step", 1)
124
+ }),
125
+ /* @__PURE__ */ o(h, {
126
+ label: "[ -> STEP 2: LIVE DRIVE TRACK (WASD) ]",
127
+ active: m.step === 2,
128
+ disabled: !_,
129
+ accent: _ ? u : f,
130
+ onClick: () => m.setField("step", 2)
131
+ })
132
+ ]
133
+ })]
134
+ }), /* @__PURE__ */ s("div", {
135
+ style: {
136
+ ...g,
137
+ position: "absolute",
138
+ left: 0,
139
+ right: 0,
140
+ bottom: 0,
141
+ borderBottom: "none",
142
+ borderTop: `1px solid ${l}`
143
+ },
144
+ children: [m.step === 1 ? /* @__PURE__ */ s("div", {
145
+ style: {
146
+ display: "flex",
147
+ flexWrap: "wrap",
148
+ gap: 6,
149
+ alignItems: "center"
150
+ },
151
+ children: [
152
+ /* @__PURE__ */ o(h, {
153
+ label: "[ ROT X +90° ]",
154
+ onClick: () => c.onBumpTurn(0)
155
+ }),
156
+ /* @__PURE__ */ o(h, {
157
+ label: "[ ROT Y +90° ]",
158
+ onClick: () => c.onBumpTurn(1)
159
+ }),
160
+ /* @__PURE__ */ o(h, {
161
+ label: "[ ROT Z +90° ]",
162
+ onClick: () => c.onBumpTurn(2)
163
+ }),
164
+ /* @__PURE__ */ o(h, {
165
+ label: "[ AUTO-SCALE SI ]",
166
+ onClick: c.onAutoScaleSi
167
+ }),
168
+ /* @__PURE__ */ o(h, {
169
+ label: "[ SNAP TIRES Y=0 ]",
170
+ onClick: c.onSnapYZero
171
+ }),
172
+ m.domain === "c12" && /* @__PURE__ */ o(h, {
173
+ label: "[ SNAP 1/12M C12 ]",
174
+ accent: p,
175
+ onClick: c.onSnapC12
176
+ }),
177
+ m.domain === "vehicle" && /* @__PURE__ */ s(a, { children: [
178
+ ["car", "starcraft"].map((e) => /* @__PURE__ */ o(h, {
179
+ label: e.toUpperCase(),
180
+ active: !m.usePaperShellProxy && m.vehicleArchetype === e,
181
+ onClick: () => c.onSelectVehicleSub(e)
182
+ }, e)),
183
+ !m.usePaperShellProxy && m.vehicleArchetype !== "starcraft" && /* @__PURE__ */ o(h, {
184
+ label: `[ AUTO-POP TIRES (${c.wheelCount}W) ]`,
185
+ onClick: c.onAutoPopWheels
186
+ }),
187
+ /* @__PURE__ */ o(h, {
188
+ label: "[ C0 CRASH PROXY ]",
189
+ active: m.usePaperShellProxy,
190
+ onClick: c.onWrapProxy
191
+ })
192
+ ] }),
193
+ m.domain === "prop" && /* @__PURE__ */ o(h, {
194
+ label: m.staticProp ? "[ STATIC HULL ]" : "[ DYNAMIC HULL ]",
195
+ active: m.staticProp,
196
+ onClick: () => m.setField("staticProp", !m.staticProp)
197
+ }),
198
+ /* @__PURE__ */ o("span", {
199
+ style: {
200
+ fontSize: 10.5,
201
+ color: _ ? d : f
202
+ },
203
+ children: b
204
+ })
205
+ ]
206
+ }) : /* @__PURE__ */ s("div", {
207
+ style: {
208
+ display: "flex",
209
+ flexWrap: "wrap",
210
+ gap: 6,
211
+ alignItems: "center"
212
+ },
213
+ children: [
214
+ /* @__PURE__ */ o(h, {
215
+ label: "[ RESET / DROP ]",
216
+ accent: u,
217
+ onClick: () => m.triggerDrop()
218
+ }),
219
+ m.domain === "vehicle" && /* @__PURE__ */ o(h, {
220
+ label: m.chaseCam ? "[ CAM: CHASE (WASD) ]" : "[ CAM: ORBIT ]",
221
+ active: m.chaseCam,
222
+ accent: p,
223
+ onClick: () => m.setField("chaseCam", !m.chaseCam)
224
+ }),
225
+ m.domain === "vehicle" && m.usePaperShellProxy ? /* @__PURE__ */ s(a, { children: [
226
+ /* @__PURE__ */ o(h, {
227
+ label: m.wrenchMode === "UNLATCH_200" ? "[ WRENCH: 200 N·S UNLATCH ]" : "[ WRENCH: 1800 N·S RIP OFF ]",
228
+ active: m.wrenchMode === "RIP_1800",
229
+ accent: f,
230
+ onClick: () => m.setField("wrenchMode", m.wrenchMode === "UNLATCH_200" ? "RIP_1800" : "UNLATCH_200")
231
+ }),
232
+ [
233
+ "TRUCK",
234
+ "STREET",
235
+ "SPORT"
236
+ ].map((e) => /* @__PURE__ */ o(h, {
237
+ label: e,
238
+ active: m.freqBucket === e,
239
+ onClick: () => m.setField("freqBucket", e)
240
+ }, e)),
241
+ [
242
+ "PLUSH",
243
+ "BALANCED",
244
+ "STIFF"
245
+ ].map((e) => /* @__PURE__ */ o(h, {
246
+ label: e,
247
+ active: m.dampBucket === e,
248
+ accent: d,
249
+ onClick: () => m.setField("dampBucket", e)
250
+ }, e)),
251
+ /* @__PURE__ */ o(h, {
252
+ label: "[ RESET PANELS ]",
253
+ onClick: () => m.resetAllPanels()
254
+ })
255
+ ] }) : /* @__PURE__ */ s(a, { children: [
256
+ m.domain === "vehicle" && c.choppedCount > 0 && /* @__PURE__ */ s(a, { children: [
257
+ /* @__PURE__ */ o(h, {
258
+ label: "[ SWING DOORS ]",
259
+ accent: u,
260
+ onClick: () => c.onSwingPanelRole("door")
261
+ }),
262
+ /* @__PURE__ */ o(h, {
263
+ label: "[ POP HOOD ]",
264
+ accent: p,
265
+ onClick: () => c.onSwingPanelRole("hood")
266
+ }),
267
+ /* @__PURE__ */ o(h, {
268
+ label: "[ POP TRUNK ]",
269
+ accent: d,
270
+ onClick: () => c.onSwingPanelRole("trunk")
271
+ })
272
+ ] }),
273
+ [
274
+ "none",
275
+ "plume",
276
+ "sparkle",
277
+ "brake_flare",
278
+ "headlight",
279
+ "seat"
280
+ ].map((e) => /* @__PURE__ */ o(h, {
281
+ label: `STAMP:${e.toUpperCase()}`,
282
+ active: c.stampTool === e,
283
+ onClick: () => c.onSelectStampTool(e)
284
+ }, e)),
285
+ c.patchCount > 0 && /* @__PURE__ */ o(h, {
286
+ label: `[ UNDO (${c.patchCount}) ]`,
287
+ onClick: c.onUndoPatch
288
+ })
289
+ ] }),
290
+ /* @__PURE__ */ o(h, {
291
+ label: "[ DOWNLOAD KHR3 .GLB ]",
292
+ disabled: c.busy,
293
+ accent: d,
294
+ onClick: c.onDownloadGlb
295
+ }),
296
+ c.onSpawnWorld && /* @__PURE__ */ o(h, {
297
+ label: c.busy ? "[ SEALING… ]" : "[ DRIVE ON LONG DRIVE -> ]",
298
+ disabled: c.busy,
299
+ accent: p,
300
+ onClick: c.onSpawnWorld
301
+ })
302
+ ]
303
+ }), /* @__PURE__ */ o("span", {
304
+ ref: v,
305
+ style: {
306
+ fontSize: 10.5,
307
+ color: d
308
+ }
309
+ })]
310
+ })] });
311
+ }
312
+ export { _ as GateHudBar };