@pinkaphant/kolmo 0.2.2 → 0.3.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 (61) hide show
  1. package/bin/kolmo.mjs +1 -1
  2. package/dist/engine/kolmoActor.js +125 -83
  3. package/dist/engine/kolmoLongDrive.js +136 -91
  4. package/dist/engine/kolmoStore.d.ts +6 -5
  5. package/dist/engine/kolmoStore.js +115 -79
  6. package/dist/engine/kolmoVehicle.d.ts +1 -1
  7. package/dist/engine/kolmoVehicle.js +160 -147
  8. package/dist/engine/kolmoVehicleDriver.d.ts +12 -4
  9. package/dist/engine/kolmoVehicleDriver.js +40 -20
  10. package/dist/engine/kolmoWorld.js +55 -35
  11. package/dist/importer/CabinPreviewRig.d.ts +13 -0
  12. package/dist/importer/CabinPreviewRig.js +138 -0
  13. package/dist/importer/CabinStepSection.d.ts +17 -0
  14. package/dist/importer/CabinStepSection.js +222 -0
  15. package/dist/importer/ChopShopPanel.d.ts +31 -1
  16. package/dist/importer/ChopShopPanel.js +474 -380
  17. package/dist/importer/GateHudBar.d.ts +3 -0
  18. package/dist/importer/GateHudBar.js +8 -2
  19. package/dist/importer/GlbImportGate.js +183 -147
  20. package/dist/importer/ImporterPlinthUikitTags.d.ts +2 -1
  21. package/dist/importer/ImporterPlinthUikitTags.js +23 -16
  22. package/dist/importer/Step1CalibrationPlinth.d.ts +10 -0
  23. package/dist/importer/Step1CalibrationPlinth.js +203 -141
  24. package/dist/importer/Step2UniversalPad.d.ts +8 -1
  25. package/dist/importer/Step2UniversalPad.js +112 -90
  26. package/dist/importer/cabinMeshBuilders.d.ts +13 -0
  27. package/dist/importer/cabinMeshBuilders.js +104 -0
  28. package/dist/importer/cabinMixamoRig.d.ts +53 -0
  29. package/dist/importer/cabinMixamoRig.js +150 -0
  30. package/dist/importer/chopShopActions.d.ts +6 -0
  31. package/dist/importer/chopShopActions.js +86 -61
  32. package/dist/importer/chopShopUiComponents.d.ts +22 -0
  33. package/dist/importer/chopShopUiComponents.js +91 -0
  34. package/dist/importer/gateStore.d.ts +5 -2
  35. package/dist/importer/gateStore.js +13 -10
  36. package/dist/importer/glbNormalizer.d.ts +10 -1
  37. package/dist/importer/glbNormalizer.js +114 -49
  38. package/dist/importer/importerWebMcp.js +4 -1
  39. package/dist/importer/index.d.ts +4 -2
  40. package/dist/importer/index.js +24 -21
  41. package/dist/importer/khrCompiler.d.ts +20 -1
  42. package/dist/importer/khrCompiler.js +539 -290
  43. package/dist/importer/launcherBake.js +12 -8
  44. package/dist/importer/meshIslands.d.ts +4 -0
  45. package/dist/importer/meshIslands.js +104 -99
  46. package/dist/importer/surfaceCutter.d.ts +12 -3
  47. package/dist/importer/surfaceCutter.js +220 -127
  48. package/dist/importer/surfaceTopology.d.ts +13 -2
  49. package/dist/importer/surfaceTopology.js +57 -29
  50. package/dist/importer/universalGateBake.d.ts +7 -1
  51. package/dist/importer/universalGateBake.js +63 -60
  52. package/dist/importer/usdToGlb.js +19 -7
  53. package/dist/importer/useChopShopController.d.ts +27 -1
  54. package/dist/importer/useChopShopController.js +369 -255
  55. package/dist/importer/wheelAxlePairing.d.ts +3 -1
  56. package/dist/importer/wheelAxlePairing.js +82 -33
  57. package/dist/index.js +31 -28
  58. package/dist/junk/ShardPieces.js +3 -3
  59. package/dist/physics/index.d.ts +7 -0
  60. package/dist/physics/index.js +66 -40
  61. package/package.json +1 -1
@@ -1,465 +1,559 @@
1
- import { CHOP_ROLES as e } from "./surfaceTopology.js";
2
- import "react";
3
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
1
+ import { CabinStepSection as e } from "./CabinStepSection.js";
2
+ import { PillBtn as t, S_PANEL as n, S_SEC as r, S_SEL as i, SliderRow as a } from "./chopShopUiComponents.js";
3
+ import { STEER_CURVE_IDS as o, TIRE_PRESET_IDS as s, TORQUE_CURVE_IDS as c } from "./khrCompiler.js";
4
+ import { CHOP_ROLES as l } from "./surfaceTopology.js";
5
+ import { useState as u } from "react";
6
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
4
7
  // src/importer/ChopShopPanel.tsx
5
- var r = [
8
+ var m = [
9
+ {
10
+ id: "fit",
11
+ label: "1·Fit"
12
+ },
13
+ {
14
+ id: "shell",
15
+ label: "2·Shell"
16
+ },
17
+ {
18
+ id: "cabin",
19
+ label: "3·Cabin"
20
+ },
21
+ {
22
+ id: "drive",
23
+ label: "4·Drive"
24
+ }
25
+ ], h = [
26
+ "wheel",
27
+ "door",
28
+ "hood",
29
+ "trunk",
30
+ "glass"
31
+ ], g = [
32
+ "fender",
33
+ "bumper",
34
+ "propeller"
35
+ ], _ = [
6
36
  {
7
37
  mode: "island",
8
- label: "1 · Bucket",
9
- hint: "1-click any separate mesh piece (auto-mirrors X=0)."
38
+ label: "Click Piece",
39
+ hint: "1-click a whole wheel, door, or window mesh."
10
40
  },
11
41
  {
12
42
  mode: "crease",
13
- label: "2 · Crease Flood",
14
- hint: "Click a fused panel/tire face to flood up to shutlines."
43
+ label: "Smart Panel",
44
+ hint: "Click once to grab up to panel shutlines, then Peel."
15
45
  },
16
46
  {
17
47
  mode: "loop",
18
- label: "3 · Tape Lasso",
19
- hint: "Click 3+ seam dots around a fused door/hood/wheel, Close Loop, then Peel."
48
+ label: "Trace Seam",
49
+ hint: "Click 3+ dots around a door/window, Close Loop, then Peel."
20
50
  },
21
51
  {
22
52
  mode: "triangle",
23
- label: "4 · Brush",
24
- hint: "Click or drag to paint faces. Alt / Right-click erases."
53
+ label: "Paint Brush",
54
+ hint: "Drag to paint faces across meshes. Right-click/Alt erases."
25
55
  }
26
- ], i = {
27
- position: "absolute",
28
- top: 52,
29
- right: 10,
30
- bottom: 48,
31
- width: 306,
32
- display: "flex",
33
- flexDirection: "column",
34
- gap: 8,
35
- padding: "10px 11px",
36
- background: "rgba(10, 13, 18, 0.93)",
37
- border: "1px solid #1C2632",
38
- borderRadius: 6,
39
- fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
40
- color: "#E6EDF3",
41
- overflowY: "auto",
42
- zIndex: 18,
43
- backdropFilter: "blur(6px)"
44
- }, a = {
45
- border: "1px solid #1E293B",
46
- borderRadius: 4,
47
- padding: "7px 8px",
48
- display: "grid",
49
- gap: 6
50
- };
51
- function o({ label: e, active: n = !1, disabled: r = !1, color: i = "#FFB000", onClick: a }) {
52
- return /* @__PURE__ */ t("button", {
53
- type: "button",
54
- disabled: r,
55
- onClick: a,
56
- style: {
57
- padding: "5px 7px",
58
- borderRadius: 3,
59
- fontSize: 10.5,
60
- fontWeight: n ? 700 : 600,
61
- fontFamily: "inherit",
62
- cursor: r ? "not-allowed" : "pointer",
63
- border: `1px solid ${r ? "#1E293B" : n ? i : "#2B3A4E"}`,
64
- background: n ? i : "#0F151E",
65
- color: r ? "#475569" : n ? "#080B10" : "#E2E8F0",
66
- textAlign: "left"
67
- },
68
- children: e
69
- });
70
- }
71
- function s(s) {
72
- let c = e.find((e) => e.role === s.activeRole) ?? e[0], l = (e) => e === "wheel" ? s.wheelCount : Object.values(s.partPicks).filter((t) => t === e).length, u = Object.keys(s.partPicks).length;
73
- return /* @__PURE__ */ n("aside", {
74
- style: i,
75
- "aria-label": "Car Chop-Shop",
56
+ ];
57
+ function v(v) {
58
+ let [y, b] = u(!1), x = l.find((e) => e.role === v.activeRole) ?? l[0], S = v.vehicleArchetype === "starcraft", C = (e) => e === "wheel" ? v.wheelCount : e === "propeller" ? v.propellerCount : Object.values(v.partPicks).filter((t) => t === e).length, w = Object.keys(v.partPicks).length;
59
+ return /* @__PURE__ */ p("aside", {
60
+ style: n,
61
+ "aria-label": "Vehicle Chop-Shop",
76
62
  children: [
77
- /* @__PURE__ */ n("div", {
63
+ /* @__PURE__ */ p("div", {
78
64
  style: {
79
65
  display: "flex",
80
66
  justifyContent: "space-between",
81
67
  alignItems: "center"
82
68
  },
83
- children: [/* @__PURE__ */ t("span", {
69
+ children: [/* @__PURE__ */ f("span", {
84
70
  style: {
85
71
  fontSize: 11.5,
86
72
  fontWeight: 800,
87
73
  color: "#FFB000",
88
74
  letterSpacing: "0.05em"
89
75
  },
90
- children: "CHOP-SHOP · CUT & HINGE"
91
- }), /* @__PURE__ */ t("span", {
76
+ children: "CAR CHOP-SHOP"
77
+ }), /* @__PURE__ */ f("span", {
92
78
  style: {
93
79
  fontSize: 10,
94
80
  color: "#38BDF8"
95
81
  },
96
- children: `${s.wheelCount}W · ${u}P`
82
+ children: `${v.wheelCount}W · ${w}P · ${v.cabin.enabled ? "SEAT ✓" : "NO SEAT"}`
97
83
  })]
98
84
  }),
99
- /* @__PURE__ */ n("div", {
100
- style: a,
101
- children: [/* @__PURE__ */ n("div", {
102
- style: {
103
- display: "flex",
104
- justifyContent: "space-between",
105
- fontSize: 10.5,
106
- color: "#94A3B8"
107
- },
108
- children: [/* @__PURE__ */ t("span", { children: "LENGTH (+Z SI)" }), /* @__PURE__ */ t("span", {
109
- style: {
110
- color: "#00E5FF",
111
- fontWeight: 700
112
- },
113
- children: `${s.targetMeters.toFixed(2)} m`
114
- })]
115
- }), /* @__PURE__ */ t("input", {
116
- type: "range",
117
- min: 1.6,
118
- max: 7.5,
119
- step: .05,
120
- value: s.targetMeters,
121
- onChange: (e) => s.onChangeTargetMeters(Number(e.target.value)),
122
- style: {
123
- width: "100%",
124
- accentColor: "#00E5FF"
125
- }
126
- })]
127
- }),
128
- /* @__PURE__ */ n("div", {
129
- style: a,
130
- children: [/* @__PURE__ */ t("span", {
131
- style: {
132
- fontSize: 10,
133
- color: "#94A3B8",
134
- letterSpacing: "0.06em"
135
- },
136
- children: "1. PICK PART ROLE TO TAG OR CUT"
137
- }), /* @__PURE__ */ t("div", {
138
- style: {
139
- display: "grid",
140
- gridTemplateColumns: "1fr 1fr",
141
- gap: 5
142
- },
143
- children: e.map((e) => {
144
- let n = l(e.role);
145
- return /* @__PURE__ */ t(o, {
146
- active: s.activeRole === e.role,
147
- color: e.color,
148
- label: `${e.label}${n > 0 ? ` (${n})` : ""}`,
149
- onClick: () => s.onSelectRole(e.role)
150
- }, e.role);
151
- })
152
- })]
85
+ /* @__PURE__ */ f("div", {
86
+ style: {
87
+ display: "grid",
88
+ gridTemplateColumns: "repeat(4, 1fr)",
89
+ gap: 4
90
+ },
91
+ children: m.map((e) => /* @__PURE__ */ f(t, {
92
+ label: e.label,
93
+ active: v.wizardTab === e.id,
94
+ color: "#00E5FF",
95
+ center: !0,
96
+ onClick: () => v.onChangeWizardTab(e.id)
97
+ }, e.id))
153
98
  }),
154
- /* @__PURE__ */ n("div", {
155
- style: a,
99
+ v.wizardTab === "fit" && /* @__PURE__ */ p("div", {
100
+ style: r,
156
101
  children: [
157
- /* @__PURE__ */ t("span", {
158
- style: {
159
- fontSize: 10,
160
- color: "#94A3B8",
161
- letterSpacing: "0.06em"
162
- },
163
- children: "2. SURFACE CUTTER (FUSED MESHES)"
164
- }),
165
- /* @__PURE__ */ t("div", {
166
- style: {
167
- display: "grid",
168
- gridTemplateColumns: "1fr 1fr",
169
- gap: 5
170
- },
171
- children: r.map((e) => /* @__PURE__ */ t(o, {
172
- label: e.label,
173
- active: s.surfaceMode === e.mode,
174
- color: "#00E5FF",
175
- onClick: () => s.onChangeSurfaceMode(e.mode)
176
- }, e.mode))
177
- }),
178
- /* @__PURE__ */ t("div", {
102
+ /* @__PURE__ */ f("div", {
179
103
  style: {
180
104
  fontSize: 10,
181
105
  color: "#94A3B8",
182
106
  lineHeight: 1.35
183
107
  },
184
- children: r.find((e) => e.mode === s.surfaceMode)?.hint
108
+ children: "Point nose toward the cyan +Z arrow and set real-world length."
185
109
  }),
186
- s.surfaceMode === "crease" && /* @__PURE__ */ n("label", {
110
+ /* @__PURE__ */ p("div", {
187
111
  style: {
188
112
  display: "grid",
189
- gridTemplateColumns: "72px 1fr 36px",
190
- alignItems: "center",
191
- gap: 6,
192
- fontSize: 10.5
113
+ gridTemplateColumns: "repeat(3, 1fr)",
114
+ gap: 4
193
115
  },
194
116
  children: [
195
- /* @__PURE__ */ t("span", { children: "Crease" }),
196
- /* @__PURE__ */ t("input", {
197
- type: "range",
198
- min: 12,
199
- max: 62,
200
- step: 1,
201
- value: s.creaseDeg,
202
- onChange: (e) => s.onChangeCreaseDeg(Number(e.target.value)),
203
- style: { accentColor: "#FFB000" }
117
+ /* @__PURE__ */ f(t, {
118
+ label: "Turn X 90°",
119
+ center: !0,
120
+ onClick: () => v.onBumpTurn(0)
121
+ }),
122
+ /* @__PURE__ */ f(t, {
123
+ label: "Turn Y 90°",
124
+ center: !0,
125
+ onClick: () => v.onBumpTurn(1)
204
126
  }),
205
- /* @__PURE__ */ t("span", {
206
- style: {
207
- textAlign: "right",
208
- color: "#FFB000"
209
- },
210
- children: `${s.creaseDeg}°`
127
+ /* @__PURE__ */ f(t, {
128
+ label: "Turn Z 90°",
129
+ center: !0,
130
+ onClick: () => v.onBumpTurn(2)
211
131
  })
212
132
  ]
213
133
  }),
214
- /* @__PURE__ */ n("label", {
134
+ /* @__PURE__ */ f("div", {
215
135
  style: {
216
- display: "flex",
217
- alignItems: "center",
218
- gap: 6,
219
- fontSize: 10.5,
220
- cursor: "pointer"
136
+ display: "grid",
137
+ gridTemplateColumns: "repeat(4, 1fr)",
138
+ gap: 4
221
139
  },
222
- children: [/* @__PURE__ */ t("input", {
223
- type: "checkbox",
224
- checked: s.mirrorX,
225
- onChange: (e) => s.onToggleMirrorX(e.target.checked),
226
- style: { accentColor: "#00E5FF" }
227
- }), /* @__PURE__ */ t("span", { children: "Mirror cut/tag across X = 0 (L + R)" })]
140
+ children: [
141
+ ["Kei", 3.4],
142
+ ["Coupe", 4.2],
143
+ ["Truck", 4.7],
144
+ ["Van", 5.2]
145
+ ].map(([e, n]) => /* @__PURE__ */ f(t, {
146
+ label: `${e} ${n}m`,
147
+ active: Math.abs(v.targetMeters - n) < .08,
148
+ color: "#38BDF8",
149
+ center: !0,
150
+ onClick: () => v.onChangeTargetMeters(n)
151
+ }, e))
228
152
  }),
229
- s.surfaceMode === "loop" && /* @__PURE__ */ n("label", {
230
- style: {
231
- display: "flex",
232
- alignItems: "center",
233
- gap: 6,
234
- fontSize: 10.5,
235
- cursor: "pointer"
236
- },
237
- children: [/* @__PURE__ */ t("input", {
238
- type: "checkbox",
239
- checked: s.splitCoarse,
240
- onChange: (e) => s.onToggleSplitCoarse(e.target.checked),
241
- style: { accentColor: "#FFB000" }
242
- }), /* @__PURE__ */ t("span", { children: "Split coarse triangles under cut line" })]
153
+ /* @__PURE__ */ f(a, {
154
+ label: "Length",
155
+ value: v.targetMeters,
156
+ min: .6,
157
+ max: 18,
158
+ step: .05,
159
+ display: `${v.targetMeters.toFixed(2)}m`,
160
+ onChange: v.onChangeTargetMeters
243
161
  }),
244
- s.surfaceMode !== "island" && /* @__PURE__ */ n("div", {
245
- style: {
246
- display: "flex",
247
- flexWrap: "wrap",
248
- gap: 5
249
- },
250
- children: [
251
- s.surfaceMode === "loop" && /* @__PURE__ */ t(o, {
252
- label: `[ CLOSE LOOP (${s.loopDotCount}) ]`,
253
- disabled: s.loopDotCount < 3,
254
- color: "#00E5FF",
255
- onClick: s.onCloseLoop
256
- }),
257
- /* @__PURE__ */ t(o, {
258
- label: `[ PEEL ${s.selectedFaces}${s.mirroredFaces > 0 ? `+${s.mirroredFaces}` : ""} FACES → ${s.activeRole.toUpperCase()} ]`,
259
- active: s.selectedFaces > 0,
260
- disabled: s.selectedFaces === 0,
261
- color: c.color,
262
- onClick: s.onPeel
263
- }),
264
- (s.selectedFaces > 0 || s.loopDotCount > 0) && /* @__PURE__ */ t(o, {
265
- label: "[ CLEAR ]",
266
- onClick: s.onClearSelection
267
- })
268
- ]
162
+ /* @__PURE__ */ f(t, {
163
+ label: "Ground Tires to Y = 0",
164
+ color: "#10B981",
165
+ center: !0,
166
+ onClick: v.onSnapYZero
269
167
  }),
270
- (s.undoCount > 0 || u > 0) && /* @__PURE__ */ n("div", {
271
- style: {
272
- display: "flex",
273
- gap: 5
274
- },
275
- children: [s.undoCount > 0 && /* @__PURE__ */ t(o, {
276
- label: `[ UNDO CUT (${s.undoCount}) ]`,
277
- color: "#F43F5E",
278
- onClick: s.onUndoCut
279
- }), u > 0 && /* @__PURE__ */ t(o, {
280
- label: "[ CLEAR TAGS ]",
281
- onClick: s.onClearTags
282
- })]
168
+ /* @__PURE__ */ f(t, {
169
+ label: "Next: 2 · Segment Shell ->",
170
+ active: !0,
171
+ color: "#FFB000",
172
+ center: !0,
173
+ onClick: () => v.onChangeWizardTab("shell")
283
174
  })
284
175
  ]
285
176
  }),
286
- /* @__PURE__ */ n("div", {
287
- style: a,
288
- children: [
289
- /* @__PURE__ */ t("span", {
290
- style: {
291
- fontSize: 10,
292
- color: "#94A3B8",
293
- letterSpacing: "0.06em"
294
- },
295
- children: "3. HINGE & EXPLODE PREVIEW"
296
- }),
297
- /* @__PURE__ */ n("label", {
298
- style: {
299
- display: "grid",
300
- gridTemplateColumns: "62px 1fr 42px",
301
- alignItems: "center",
302
- gap: 6,
303
- fontSize: 10.5
304
- },
305
- children: [
306
- /* @__PURE__ */ t("span", { children: "Hinges" }),
307
- /* @__PURE__ */ t("input", {
308
- type: "range",
309
- min: 0,
310
- max: 1,
311
- step: .02,
312
- value: s.hingeScrub,
313
- onChange: (e) => s.onChangeHingeScrub(Number(e.target.value)),
314
- style: { accentColor: "#10B981" }
315
- }),
316
- /* @__PURE__ */ t("span", {
317
- style: {
318
- textAlign: "right",
319
- color: "#10B981"
320
- },
321
- children: `${Math.round(s.hingeScrub * 100)}%`
177
+ v.wizardTab === "shell" && /* @__PURE__ */ p(d, { children: [
178
+ /* @__PURE__ */ p("div", {
179
+ style: r,
180
+ children: [
181
+ !S && /* @__PURE__ */ p("div", {
182
+ style: {
183
+ display: "grid",
184
+ gridTemplateColumns: "1fr auto",
185
+ gap: 4
186
+ },
187
+ children: [/* @__PURE__ */ f(t, {
188
+ label: `Auto-Detect Wheels (${v.wheelCount}W)`,
189
+ active: v.wheelCount >= 4,
190
+ color: "#10B981",
191
+ onClick: v.onAutoPopWheels
192
+ }), /* @__PURE__ */ f(t, {
193
+ label: v.wheelSource === "imported" ? "Mesh" : "12-Gon",
194
+ color: "#00E5FF",
195
+ onClick: () => v.onChangeWheelSource(v.wheelSource === "imported" ? "fleet12" : "imported")
196
+ })]
197
+ }),
198
+ /* @__PURE__ */ f("span", {
199
+ style: {
200
+ fontSize: 10,
201
+ color: "#94A3B8"
202
+ },
203
+ children: "PICK PART TO TAG OR CUT"
204
+ }),
205
+ /* @__PURE__ */ p("div", {
206
+ style: {
207
+ display: "grid",
208
+ gridTemplateColumns: "1fr 1fr",
209
+ gap: 4
210
+ },
211
+ children: [(S ? [
212
+ "propeller",
213
+ "door",
214
+ "glass",
215
+ "hood"
216
+ ] : h).map((e) => {
217
+ let n = l.find((t) => t.role === e), r = C(e);
218
+ return /* @__PURE__ */ f(t, {
219
+ active: v.activeRole === e,
220
+ color: n.color,
221
+ label: `${n.label}${r > 0 ? ` (${r})` : ""}`,
222
+ onClick: () => v.onSelectRole(e)
223
+ }, e);
224
+ }), /* @__PURE__ */ f(t, {
225
+ label: y ? "Less parts ▴" : "More parts ▾",
226
+ onClick: () => b((e) => !e)
227
+ })]
228
+ }),
229
+ y && /* @__PURE__ */ f("div", {
230
+ style: {
231
+ display: "grid",
232
+ gridTemplateColumns: "repeat(3, 1fr)",
233
+ gap: 4
234
+ },
235
+ children: g.map((e) => {
236
+ let n = l.find((t) => t.role === e), r = C(e);
237
+ return /* @__PURE__ */ f(t, {
238
+ active: v.activeRole === e,
239
+ color: n.color,
240
+ label: `${e}${r > 0 ? ` (${r})` : ""}`,
241
+ onClick: () => v.onSelectRole(e)
242
+ }, e);
322
243
  })
323
- ]
324
- }),
325
- /* @__PURE__ */ n("label", {
326
- style: {
327
- display: "grid",
328
- gridTemplateColumns: "62px 1fr 42px",
329
- alignItems: "center",
330
- gap: 6,
331
- fontSize: 10.5
332
- },
333
- children: [
334
- /* @__PURE__ */ t("span", { children: "Explode" }),
335
- /* @__PURE__ */ t("input", {
336
- type: "range",
337
- min: 0,
338
- max: 1.2,
339
- step: .02,
340
- value: s.explodeAmount,
341
- onChange: (e) => s.onChangeExplodeAmount(Number(e.target.value)),
244
+ })
245
+ ]
246
+ }),
247
+ /* @__PURE__ */ p("div", {
248
+ style: r,
249
+ children: [
250
+ /* @__PURE__ */ f("span", {
251
+ style: {
252
+ fontSize: 10,
253
+ color: "#94A3B8"
254
+ },
255
+ children: "GRAB TOOL"
256
+ }),
257
+ /* @__PURE__ */ f("div", {
258
+ style: {
259
+ display: "grid",
260
+ gridTemplateColumns: "1fr 1fr",
261
+ gap: 4
262
+ },
263
+ children: _.map((e) => /* @__PURE__ */ f(t, {
264
+ label: e.label,
265
+ active: v.surfaceMode === e.mode,
266
+ color: "#00E5FF",
267
+ onClick: () => v.onChangeSurfaceMode(e.mode)
268
+ }, e.mode))
269
+ }),
270
+ /* @__PURE__ */ f("div", {
271
+ style: {
272
+ fontSize: 10,
273
+ color: "#94A3B8",
274
+ lineHeight: 1.3
275
+ },
276
+ children: _.find((e) => e.mode === v.surfaceMode)?.hint
277
+ }),
278
+ v.surfaceMode === "crease" && /* @__PURE__ */ f(a, {
279
+ label: "Shutline",
280
+ value: v.creaseDeg,
281
+ min: 10,
282
+ max: 70,
283
+ step: 1,
284
+ display: `${v.creaseDeg}°`,
285
+ accent: "#FFB000",
286
+ onChange: v.onChangeCreaseDeg
287
+ }),
288
+ /* @__PURE__ */ p("label", {
289
+ style: {
290
+ display: "flex",
291
+ alignItems: "center",
292
+ gap: 6,
293
+ fontSize: 10.5,
294
+ cursor: "pointer"
295
+ },
296
+ children: [/* @__PURE__ */ f("input", {
297
+ type: "checkbox",
298
+ checked: v.mirrorX,
299
+ onChange: (e) => v.onToggleMirrorX(e.target.checked),
300
+ style: { accentColor: "#00E5FF" }
301
+ }), /* @__PURE__ */ f("span", { children: "Mirror Left ↔ Right automatically" })]
302
+ }),
303
+ v.surfaceMode === "loop" && /* @__PURE__ */ p("label", {
304
+ style: {
305
+ display: "flex",
306
+ alignItems: "center",
307
+ gap: 6,
308
+ fontSize: 10.5,
309
+ cursor: "pointer"
310
+ },
311
+ children: [/* @__PURE__ */ f("input", {
312
+ type: "checkbox",
313
+ checked: v.splitCoarse,
314
+ onChange: (e) => v.onToggleSplitCoarse(e.target.checked),
342
315
  style: { accentColor: "#FFB000" }
343
- }),
344
- /* @__PURE__ */ t("span", {
345
- style: {
346
- textAlign: "right",
347
- color: "#FFB000"
348
- },
349
- children: `${s.explodeAmount.toFixed(2)}m`
350
- })
351
- ]
352
- })
353
- ]
316
+ }), /* @__PURE__ */ f("span", { children: "Split coarse triangles under cut line" })]
317
+ }),
318
+ (v.surfaceMode !== "island" || v.selectedFaces > 0) && /* @__PURE__ */ p("div", {
319
+ style: {
320
+ display: "flex",
321
+ flexWrap: "wrap",
322
+ gap: 4
323
+ },
324
+ children: [
325
+ v.surfaceMode === "loop" && /* @__PURE__ */ f(t, {
326
+ label: `Close Loop (${v.loopDotCount})`,
327
+ disabled: v.loopDotCount < 3,
328
+ color: "#00E5FF",
329
+ onClick: v.onCloseLoop
330
+ }),
331
+ /* @__PURE__ */ f(t, {
332
+ label: `PEEL ${v.selectedFaces}${v.mirroredFaces > 0 ? `+${v.mirroredFaces}` : ""} → ${v.activeRole.toUpperCase()}`,
333
+ active: v.selectedFaces > 0,
334
+ disabled: v.selectedFaces === 0,
335
+ color: x.color,
336
+ onClick: v.onPeel
337
+ }),
338
+ (v.selectedFaces > 0 || v.loopDotCount > 0) && /* @__PURE__ */ f(t, {
339
+ label: "Clear",
340
+ onClick: v.onClearSelection
341
+ })
342
+ ]
343
+ }),
344
+ (v.undoCount > 0 || w > 0 || v.propellerCount > 0) && /* @__PURE__ */ p("div", {
345
+ style: {
346
+ display: "flex",
347
+ gap: 4
348
+ },
349
+ children: [v.undoCount > 0 && /* @__PURE__ */ f(t, {
350
+ label: `Undo Cut (${v.undoCount})`,
351
+ color: "#F43F5E",
352
+ onClick: v.onUndoCut
353
+ }), (w > 0 || v.propellerCount > 0) && /* @__PURE__ */ f(t, {
354
+ label: "Reset Tags",
355
+ onClick: v.onClearTags
356
+ })]
357
+ })
358
+ ]
359
+ }),
360
+ /* @__PURE__ */ p("div", {
361
+ style: r,
362
+ children: [
363
+ /* @__PURE__ */ f(a, {
364
+ label: "Open Parts",
365
+ value: v.hingeScrub,
366
+ min: 0,
367
+ max: 1,
368
+ step: .02,
369
+ display: `${Math.round(v.hingeScrub * 100)}%`,
370
+ accent: "#10B981",
371
+ onChange: v.onChangeHingeScrub
372
+ }),
373
+ /* @__PURE__ */ f(a, {
374
+ label: "Explode",
375
+ value: v.explodeAmount,
376
+ min: 0,
377
+ max: 1.2,
378
+ step: .02,
379
+ display: `${v.explodeAmount.toFixed(2)}m`,
380
+ accent: "#FFB000",
381
+ onChange: v.onChangeExplodeAmount
382
+ }),
383
+ /* @__PURE__ */ f(t, {
384
+ label: "Next: 3 · Fit Mixamo Cabin ->",
385
+ active: !0,
386
+ color: "#00E5FF",
387
+ center: !0,
388
+ onClick: () => v.onChangeWizardTab("cabin")
389
+ })
390
+ ]
391
+ })
392
+ ] }),
393
+ v.wizardTab === "cabin" && /* @__PURE__ */ f(e, {
394
+ shellViewMode: v.shellViewMode,
395
+ onChangeShellViewMode: v.onChangeShellViewMode,
396
+ cabin: v.cabin,
397
+ cabinFit: v.cabinFit,
398
+ carBounds: v.carBounds,
399
+ onUpdateCabin: v.onUpdateCabin,
400
+ onSetCabinLayout: v.onSetCabinLayout,
401
+ onAutoFitCabin: v.onAutoFitCabin,
402
+ onNextDrive: () => v.onChangeWizardTab("drive")
354
403
  }),
355
- /* @__PURE__ */ n("div", {
356
- style: a,
404
+ v.wizardTab === "drive" && /* @__PURE__ */ p("div", {
405
+ style: r,
357
406
  children: [
358
- /* @__PURE__ */ t("span", {
407
+ /* @__PURE__ */ f("span", {
359
408
  style: {
360
409
  fontSize: 10,
361
- color: "#94A3B8",
362
- letterSpacing: "0.06em"
410
+ color: "#94A3B8"
363
411
  },
364
- children: "4. WHEELS & POWERTRAIN"
412
+ children: "DRIVING TUNE (OPTIONAL)"
365
413
  }),
366
- /* @__PURE__ */ n("div", {
367
- style: {
368
- display: "grid",
369
- gridTemplateColumns: "1fr 1fr",
370
- gap: 5
371
- },
372
- children: [/* @__PURE__ */ t(o, {
373
- label: "Imported Tires",
374
- active: s.wheelSource === "imported",
375
- color: "#00E5FF",
376
- onClick: () => s.onChangeWheelSource("imported")
377
- }), /* @__PURE__ */ t(o, {
378
- label: "12-Gon Fleet",
379
- active: s.wheelSource === "fleet12",
380
- color: "#10B981",
381
- onClick: () => s.onChangeWheelSource("fleet12")
382
- })]
414
+ /* @__PURE__ */ f(a, {
415
+ label: "Mass",
416
+ value: v.massKg,
417
+ min: 80,
418
+ max: 12e3,
419
+ step: 20,
420
+ display: `${v.massKg}kg`,
421
+ accent: "#38BDF8",
422
+ onChange: v.onChangeMassKg
383
423
  }),
384
- /* @__PURE__ */ t("div", {
385
- style: {
386
- display: "grid",
387
- gridTemplateColumns: "repeat(3, 1fr)",
388
- gap: 5
389
- },
390
- children: [
391
- "AWD",
392
- "RWD",
393
- "FWD"
394
- ].map((e) => /* @__PURE__ */ t(o, {
395
- label: e,
396
- active: s.driveType === e,
397
- color: "#FFB000",
398
- onClick: () => s.onChangeDriveType(e)
399
- }, e))
424
+ /* @__PURE__ */ f(a, {
425
+ label: S ? "Thrust" : "Power",
426
+ value: v.horsepower,
427
+ min: S ? 500 : 40,
428
+ max: S ? 25e3 : 1600,
429
+ step: S ? 100 : 10,
430
+ display: S ? `${v.horsepower}N` : `${v.horsepower}HP`,
431
+ accent: "#FFB000",
432
+ onChange: v.onChangeHorsepower
400
433
  }),
401
- /* @__PURE__ */ n("label", {
402
- style: {
403
- display: "grid",
404
- gridTemplateColumns: "62px 1fr 46px",
405
- alignItems: "center",
406
- gap: 6,
407
- fontSize: 10.5
408
- },
409
- children: [
410
- /* @__PURE__ */ t("span", { children: "Power" }),
411
- /* @__PURE__ */ t("input", {
412
- type: "range",
413
- min: 90,
414
- max: 720,
415
- step: 10,
416
- value: s.horsepower,
417
- onChange: (e) => s.onChangeHorsepower(Number(e.target.value)),
418
- style: { accentColor: "#FFB000" }
419
- }),
420
- /* @__PURE__ */ t("span", {
421
- style: {
422
- textAlign: "right",
423
- color: "#FFB000"
424
- },
425
- children: `${s.horsepower}HP`
426
- })
427
- ]
428
- })
434
+ !S && /* @__PURE__ */ p(d, { children: [
435
+ /* @__PURE__ */ f("div", {
436
+ style: {
437
+ display: "grid",
438
+ gridTemplateColumns: "repeat(3, 1fr)",
439
+ gap: 4
440
+ },
441
+ children: [
442
+ "AWD",
443
+ "RWD",
444
+ "FWD"
445
+ ].map((e) => /* @__PURE__ */ f(t, {
446
+ label: e,
447
+ active: v.driveType === e,
448
+ color: "#FFB000",
449
+ center: !0,
450
+ onClick: () => v.onChangeDriveType(e)
451
+ }, e))
452
+ }),
453
+ /* @__PURE__ */ p("label", {
454
+ style: {
455
+ display: "grid",
456
+ gridTemplateColumns: "56px 1fr",
457
+ alignItems: "center",
458
+ gap: 5,
459
+ fontSize: 10
460
+ },
461
+ children: [/* @__PURE__ */ f("span", { children: "Tires" }), /* @__PURE__ */ f("select", {
462
+ style: i,
463
+ value: v.tirePreset,
464
+ onChange: (e) => v.onChangeTirePreset(e.target.value),
465
+ children: s.map((e) => /* @__PURE__ */ f("option", {
466
+ value: e,
467
+ children: e
468
+ }, e))
469
+ })]
470
+ }),
471
+ /* @__PURE__ */ p("label", {
472
+ style: {
473
+ display: "grid",
474
+ gridTemplateColumns: "56px 1fr",
475
+ alignItems: "center",
476
+ gap: 5,
477
+ fontSize: 10
478
+ },
479
+ children: [/* @__PURE__ */ f("span", { children: "Torque" }), /* @__PURE__ */ f("select", {
480
+ style: i,
481
+ value: v.torqueCurve,
482
+ onChange: (e) => v.onChangeTorqueCurve(e.target.value),
483
+ children: c.map((e) => /* @__PURE__ */ f("option", {
484
+ value: e,
485
+ children: e
486
+ }, e))
487
+ })]
488
+ }),
489
+ /* @__PURE__ */ p("label", {
490
+ style: {
491
+ display: "grid",
492
+ gridTemplateColumns: "56px 1fr",
493
+ alignItems: "center",
494
+ gap: 5,
495
+ fontSize: 10
496
+ },
497
+ children: [/* @__PURE__ */ f("span", { children: "Steer" }), /* @__PURE__ */ f("select", {
498
+ style: i,
499
+ value: v.steerCurve,
500
+ onChange: (e) => v.onChangeSteerCurve(e.target.value),
501
+ children: o.map((e) => /* @__PURE__ */ f("option", {
502
+ value: e,
503
+ children: e
504
+ }, e))
505
+ })]
506
+ })
507
+ ] })
429
508
  ]
430
509
  }),
431
- s.statusNote && /* @__PURE__ */ t("div", {
510
+ v.statusNote && /* @__PURE__ */ f("div", {
432
511
  style: {
433
- fontSize: 10.5,
512
+ fontSize: 10,
434
513
  color: "#34D399",
435
514
  padding: "4px 6px",
436
515
  background: "rgba(16,185,129,0.1)",
437
516
  border: "1px solid rgba(16,185,129,0.35)",
438
517
  borderRadius: 4
439
518
  },
440
- children: s.statusNote
519
+ children: v.statusNote
441
520
  }),
442
- /* @__PURE__ */ n("div", {
521
+ /* @__PURE__ */ p("div", {
443
522
  style: {
444
523
  display: "grid",
445
- gap: 6,
524
+ gap: 5,
446
525
  marginTop: "auto"
447
526
  },
448
- children: [/* @__PURE__ */ t(o, {
449
- label: "[ -> STEP 2: COMPILE & TEST TRACK (WASD) ]",
450
- active: s.unlocked,
451
- disabled: !s.unlocked || s.busy,
527
+ children: [/* @__PURE__ */ f(t, {
528
+ label: "[ -> STEP 2: TEST DRIVE (WASD) ]",
529
+ active: v.unlocked,
530
+ disabled: !v.unlocked || v.busy,
452
531
  color: "#FFB000",
453
- onClick: s.onGoTestDrive
454
- }), s.onSpawnWorld && /* @__PURE__ */ t(o, {
455
- label: s.busy ? "[ COMPILING KHR3… ]" : "[ -> SPAWN & DRIVE ON LONG DRIVE ]",
456
- active: s.unlocked,
457
- disabled: !s.unlocked || s.busy,
458
- color: "#10B981",
459
- onClick: s.onSpawnWorld
532
+ center: !0,
533
+ onClick: v.onGoTestDrive
534
+ }), /* @__PURE__ */ p("div", {
535
+ style: {
536
+ display: "grid",
537
+ gridTemplateColumns: v.onSpawnWorld ? "1fr 1fr" : "1fr",
538
+ gap: 4
539
+ },
540
+ children: [/* @__PURE__ */ f(t, {
541
+ label: v.busy ? "Exporting…" : "Download .GLB",
542
+ disabled: !v.unlocked || v.busy,
543
+ color: "#00E5FF",
544
+ center: !0,
545
+ onClick: v.onDownloadGlb
546
+ }), v.onSpawnWorld && /* @__PURE__ */ f(t, {
547
+ label: v.busy ? "Sealing…" : "Spawn in World",
548
+ active: v.unlocked,
549
+ disabled: !v.unlocked || v.busy,
550
+ color: "#10B981",
551
+ center: !0,
552
+ onClick: v.onSpawnWorld
553
+ })]
460
554
  })]
461
555
  })
462
556
  ]
463
557
  });
464
558
  }
465
- export { s as ChopShopPanel };
559
+ export { v as ChopShopPanel };