@pinkaphant/kolmo 0.2.3 → 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
@@ -6,17 +6,34 @@ import { RetroViewportSync as d, RoomEnvRig as f, ShadowSnapRig as p } from "./k
6
6
  import { WorldSessionTrait as m, ensureWorldSession as h, kolmoActions as g, kolmoWorld as _, useWorldTrait as v } from "./kolmoStore.js";
7
7
  import { useEffect as y, useLayoutEffect as b } from "react";
8
8
  import * as x from "three";
9
- import { Canvas as S } from "@react-three/fiber";
10
- import { KeyboardControls as C } from "@react-three/drei";
11
- import { WorldProvider as w } from "koota/react";
12
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
9
+ import { Canvas as S, useThree as C } from "@react-three/fiber";
10
+ import { KeyboardControls as w } from "@react-three/drei";
11
+ import { WorldProvider as T } from "koota/react";
12
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
13
13
  // src/engine/kolmoWorld.tsx
14
- function O({ children: e, className: t, style: n, fov: r = 56, near: i = .15, far: a = 6500, cameraPosition: o = [
14
+ function k({ onCanvasReady: e, onContextLost: t }) {
15
+ let n = C((e) => e.gl);
16
+ return y(() => {
17
+ let r = n.domElement;
18
+ if (e?.(r), !t) return;
19
+ let i = (e) => {
20
+ e.preventDefault(), t(!0);
21
+ }, a = () => t(!1);
22
+ return r.addEventListener("webglcontextlost", i), r.addEventListener("webglcontextrestored", a), () => {
23
+ r.removeEventListener("webglcontextlost", i), r.removeEventListener("webglcontextrestored", a);
24
+ };
25
+ }, [
26
+ n,
27
+ e,
28
+ t
29
+ ]), null;
30
+ }
31
+ function A({ children: e, className: t, style: n, fov: r = 56, near: i = .15, far: a = 6500, cameraPosition: o = [
15
32
  0,
16
33
  3.2,
17
34
  -8.5
18
35
  ], dpr: s = [1, 1.5], frameloop: c = "always", shadows: l = "basic", toneMapping: u, onCanvasReady: d, onContextLost: p, roomEnv: m = !1 }) {
19
- return /* @__PURE__ */ D(S, {
36
+ return /* @__PURE__ */ O(S, {
20
37
  className: t,
21
38
  style: n ?? {
22
39
  width: "100%",
@@ -39,15 +56,18 @@ function O({ children: e, className: t, style: n, fov: r = 56, near: i = .15, fa
39
56
  },
40
57
  onCreated: ({ gl: e }) => {
41
58
  e.outputColorSpace = x.SRGBColorSpace;
42
- let t = e.domElement;
43
- d?.(t), p && (t.addEventListener("webglcontextlost", (e) => {
44
- e.preventDefault(), p(!0);
45
- }), t.addEventListener("webglcontextrestored", () => p(!1)));
46
59
  },
47
- children: [m !== !1 && /* @__PURE__ */ E(f, { intensity: typeof m == "number" ? m : .65 }), e]
60
+ children: [
61
+ /* @__PURE__ */ D(k, {
62
+ onCanvasReady: d,
63
+ onContextLost: p
64
+ }),
65
+ m !== !1 && /* @__PURE__ */ D(f, { intensity: typeof m == "number" ? m : .65 }),
66
+ e
67
+ ]
48
68
  });
49
69
  }
50
- function k({ world: e, retroPreset: t }) {
70
+ function j({ world: e, retroPreset: t }) {
51
71
  b(() => {
52
72
  e && h(e);
53
73
  }, [e]);
@@ -60,22 +80,22 @@ function k({ world: e, retroPreset: t }) {
60
80
  n?.activeRetroPreset
61
81
  ]), null;
62
82
  }
63
- function A({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta: o, physicsDebug: u = !1, retroPreset: d, skybox: f = "nebula", lighting: m = "default", fogExp2: g, sunLightRef: v, shadowSnap: y = !1, world: x = _, keyboardMap: S = s, children: O }) {
64
- let A = r(), j = x === null ? A : x;
83
+ function M({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta: o, physicsDebug: u = !1, retroPreset: d, skybox: f = "nebula", lighting: m = "default", fogExp2: g, sunLightRef: v, shadowSnap: y = !1, world: x = _, keyboardMap: S = s, children: C }) {
84
+ let k = r(), A = x === null ? k : x;
65
85
  b(() => {
66
- j && h(j);
67
- }, [j]);
68
- let M = /* @__PURE__ */ D(T, { children: [
69
- /* @__PURE__ */ E(k, {
70
- world: j,
86
+ A && h(A);
87
+ }, [A]);
88
+ let M = /* @__PURE__ */ O(E, { children: [
89
+ /* @__PURE__ */ D(j, {
90
+ world: A,
71
91
  retroPreset: d
72
92
  }),
73
- y && v && /* @__PURE__ */ E(p, { sunLightRef: v }),
74
- f === "nebula" && /* @__PURE__ */ E(i, {}),
75
- f === "day" && /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("color", {
93
+ y && v && /* @__PURE__ */ D(p, { sunLightRef: v }),
94
+ f === "nebula" && /* @__PURE__ */ D(i, {}),
95
+ f === "day" && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("color", {
76
96
  attach: "background",
77
97
  args: ["#6ba6d6"]
78
- }), !g && /* @__PURE__ */ E("fog", {
98
+ }), !g && /* @__PURE__ */ D("fog", {
79
99
  attach: "fog",
80
100
  args: [
81
101
  "#9dc4e2",
@@ -83,17 +103,17 @@ function A({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta:
83
103
  520
84
104
  ]
85
105
  })] }),
86
- g && /* @__PURE__ */ E("fogExp2", {
106
+ g && /* @__PURE__ */ D("fogExp2", {
87
107
  attach: "fog",
88
108
  args: g
89
109
  }),
90
- m === "default" && /* @__PURE__ */ D(T, { children: [
91
- /* @__PURE__ */ E("hemisphereLight", { args: [
110
+ m === "default" && /* @__PURE__ */ O(E, { children: [
111
+ /* @__PURE__ */ D("hemisphereLight", { args: [
92
112
  "#b8dcff",
93
113
  "#241d30",
94
114
  .8
95
115
  ] }),
96
- /* @__PURE__ */ E("directionalLight", {
116
+ /* @__PURE__ */ D("directionalLight", {
97
117
  ref: v,
98
118
  position: [
99
119
  48,
@@ -105,7 +125,7 @@ function A({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta:
105
125
  castShadow: !0,
106
126
  "shadow-mapSize": [1024, 1024]
107
127
  }),
108
- /* @__PURE__ */ E("directionalLight", {
128
+ /* @__PURE__ */ D("directionalLight", {
109
129
  position: [
110
130
  -42,
111
131
  28,
@@ -115,25 +135,25 @@ function A({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta:
115
135
  color: "#68a8ff"
116
136
  })
117
137
  ] }),
118
- /* @__PURE__ */ E(t, {
138
+ /* @__PURE__ */ D(t, {
119
139
  gravity: e,
120
140
  paused: n,
121
141
  timeScale: a,
122
142
  maxDelta: o,
123
143
  physicsDebug: u,
124
144
  world: null,
125
- children: O
145
+ children: C
126
146
  })
127
- ] }), N = S ? /* @__PURE__ */ E(C, {
147
+ ] }), N = S ? /* @__PURE__ */ D(w, {
128
148
  map: S,
129
- children: /* @__PURE__ */ E(c, { children: M })
130
- }) : /* @__PURE__ */ E(l.Provider, {
149
+ children: /* @__PURE__ */ D(c, { children: M })
150
+ }) : /* @__PURE__ */ D(l.Provider, {
131
151
  value: null,
132
152
  children: M
133
153
  });
134
- return x !== null && x !== A ? /* @__PURE__ */ E(w, {
154
+ return x !== null && x !== k ? /* @__PURE__ */ D(T, {
135
155
  world: x,
136
156
  children: N
137
157
  }) : N;
138
158
  }
139
- export { o as EMPTY_KOLMO_INPUT, s as KOLMO_KEY_MAP, O as KolmoCanvas, e as KolmoGravityContext, t as KolmoPhysics, A as KolmoWorld, d as RetroViewportSync, f as RoomEnvRig, p as ShadowSnapRig, n as useIsKolmoCustomGravity, u as useKolmoInput, r as useOptionalKootaWorld };
159
+ export { o as EMPTY_KOLMO_INPUT, s as KOLMO_KEY_MAP, A as KolmoCanvas, e as KolmoGravityContext, t as KolmoPhysics, M as KolmoWorld, d as RetroViewportSync, f as RoomEnvRig, p as ShadowSnapRig, n as useIsKolmoCustomGravity, u as useKolmoInput, r as useOptionalKootaWorld };
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { type CarCabinConfig } from "./cabinMixamoRig.js";
3
+ export interface CabinPreviewRigProps {
4
+ readonly cabin: CarCabinConfig;
5
+ readonly carBounds: {
6
+ readonly min: readonly [number, number, number];
7
+ readonly max: readonly [number, number, number];
8
+ };
9
+ readonly showTub?: boolean;
10
+ readonly showDummy?: boolean;
11
+ readonly showSockets?: boolean;
12
+ }
13
+ export declare function CabinPreviewRig({ cabin, carBounds, showTub, showDummy, showSockets, }: CabinPreviewRigProps): React.JSX.Element | null;
@@ -0,0 +1,138 @@
1
+ import { buildCabinTubGroup as e, buildMixamoSeatedDummyGroup as t, disposeObjectTree as n } from "./cabinMeshBuilders.js";
2
+ import { computeMixamoCabinPoints as r, evaluateCabinFit as i } from "./cabinMixamoRig.js";
3
+ import { useEffect as a, useMemo as o } from "react";
4
+ import * as s from "three";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ // src/importer/CabinPreviewRig.tsx
7
+ function u(e) {
8
+ e.traverse((e) => {
9
+ e instanceof s.Mesh && (e.raycast = () => null);
10
+ });
11
+ }
12
+ function d({ cabin: d, carBounds: f, showTub: p = !0, showDummy: m = !0, showSockets: h = !1 }) {
13
+ let g = o(() => {
14
+ if (!p || !d.enabled || !d.includeInteriorTub) return null;
15
+ let t = e(d, f.min, f.max);
16
+ return u(t), t;
17
+ }, [
18
+ p,
19
+ d,
20
+ f
21
+ ]), _ = o(() => {
22
+ if (!m || !d.enabled) return null;
23
+ let e = t(d, f.min, f.max);
24
+ return u(e), e;
25
+ }, [
26
+ m,
27
+ d,
28
+ f
29
+ ]);
30
+ a(() => () => {
31
+ g && n(g);
32
+ }, [g]), a(() => () => {
33
+ _ && n(_);
34
+ }, [_]);
35
+ let v = o(() => {
36
+ if (!h || !d.enabled) return null;
37
+ let e = r(d, f.min, f.max);
38
+ return {
39
+ fit: i(d, f.min, f.max),
40
+ crown: e.crown,
41
+ dots: [
42
+ {
43
+ key: "seat",
44
+ pos: e.hips,
45
+ color: "#10B981",
46
+ r: .045
47
+ },
48
+ {
49
+ key: "optic",
50
+ pos: e.eye,
51
+ color: "#00E5FF",
52
+ r: .036
53
+ },
54
+ {
55
+ key: "exit",
56
+ pos: e.exit,
57
+ color: "#FFB000",
58
+ r: .055
59
+ },
60
+ {
61
+ key: "handL",
62
+ pos: e.handL,
63
+ color: "#FACC15",
64
+ r: .032
65
+ },
66
+ {
67
+ key: "handR",
68
+ pos: e.handR,
69
+ color: "#FACC15",
70
+ r: .032
71
+ },
72
+ {
73
+ key: "footL",
74
+ pos: e.footL,
75
+ color: "#A855F7",
76
+ r: .032
77
+ },
78
+ {
79
+ key: "footR",
80
+ pos: e.footR,
81
+ color: "#A855F7",
82
+ r: .032
83
+ }
84
+ ]
85
+ };
86
+ }, [
87
+ h,
88
+ d,
89
+ f
90
+ ]);
91
+ return !g && !_ && !v ? null : /* @__PURE__ */ l("group", {
92
+ name: "CabinPreviewRig",
93
+ children: [
94
+ g && /* @__PURE__ */ c("primitive", { object: g }),
95
+ _ && /* @__PURE__ */ c("primitive", { object: _ }),
96
+ v && /* @__PURE__ */ l("group", { children: [v.dots.map((e) => /* @__PURE__ */ l("mesh", {
97
+ position: [
98
+ e.pos[0],
99
+ e.pos[1],
100
+ e.pos[2]
101
+ ],
102
+ raycast: () => null,
103
+ children: [/* @__PURE__ */ c("sphereGeometry", { args: [
104
+ e.r,
105
+ 10,
106
+ 8
107
+ ] }), /* @__PURE__ */ c("meshBasicMaterial", {
108
+ color: e.color,
109
+ depthTest: !1,
110
+ transparent: !0,
111
+ opacity: .92
112
+ })]
113
+ }, e.key)), /* @__PURE__ */ l("mesh", {
114
+ position: [
115
+ v.crown[0],
116
+ v.crown[1] + .02,
117
+ v.crown[2]
118
+ ],
119
+ rotation: [
120
+ Math.PI * .5,
121
+ 0,
122
+ 0
123
+ ],
124
+ raycast: () => null,
125
+ children: [/* @__PURE__ */ c("ringGeometry", { args: [
126
+ .11,
127
+ .14,
128
+ 16
129
+ ] }), /* @__PURE__ */ c("meshBasicMaterial", {
130
+ color: v.fit.headroomOk ? "#10B981" : "#F43F5E",
131
+ side: s.DoubleSide,
132
+ depthTest: !1
133
+ })]
134
+ })] })
135
+ ]
136
+ });
137
+ }
138
+ export { d as CabinPreviewRig };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import type { CabinFitReport, CarCabinConfig, DriverSeatLayout, ShellViewMode } from "./cabinMixamoRig.js";
3
+ export interface CabinStepSectionProps {
4
+ readonly shellViewMode: ShellViewMode;
5
+ readonly onChangeShellViewMode: (m: ShellViewMode) => void;
6
+ readonly cabin: CarCabinConfig;
7
+ readonly cabinFit: CabinFitReport;
8
+ readonly carBounds: {
9
+ readonly min: readonly [number, number, number];
10
+ readonly max: readonly [number, number, number];
11
+ };
12
+ readonly onUpdateCabin: (patch: Partial<CarCabinConfig>) => void;
13
+ readonly onSetCabinLayout: (layout: DriverSeatLayout) => void;
14
+ readonly onAutoFitCabin: () => void;
15
+ readonly onNextDrive: () => void;
16
+ }
17
+ export declare function CabinStepSection(p: CabinStepSectionProps): React.JSX.Element;
@@ -0,0 +1,222 @@
1
+ import { PillBtn as e, S_SEC as t, SliderRow as n } from "./chopShopUiComponents.js";
2
+ import "react";
3
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ // src/importer/CabinStepSection.tsx
5
+ function o(o) {
6
+ let s = (e) => `${e >= 0 ? "+" : ""}${Math.round(e * 100)}cm`, [c, l, u] = o.carBounds.min, [d, f, p] = o.carBounds.max, m = (e, t) => {
7
+ let n = [
8
+ o.cabin.seatPos[0],
9
+ o.cabin.seatPos[1],
10
+ o.cabin.seatPos[2]
11
+ ];
12
+ n[e] = Number(t.toFixed(3)), o.onUpdateCabin({ seatPos: n });
13
+ };
14
+ return /* @__PURE__ */ a(r, { children: [
15
+ /* @__PURE__ */ a("div", {
16
+ style: t,
17
+ children: [
18
+ /* @__PURE__ */ a("div", {
19
+ style: {
20
+ display: "flex",
21
+ justifyContent: "space-between",
22
+ alignItems: "center"
23
+ },
24
+ children: [/* @__PURE__ */ i("span", {
25
+ style: {
26
+ fontSize: 10,
27
+ color: "#94A3B8"
28
+ },
29
+ children: "SEE INSIDE SHELL"
30
+ }), /* @__PURE__ */ i(e, {
31
+ label: "Auto-Fit",
32
+ color: "#10B981",
33
+ onClick: o.onAutoFitCabin
34
+ })]
35
+ }),
36
+ /* @__PURE__ */ i("div", {
37
+ style: {
38
+ display: "grid",
39
+ gridTemplateColumns: "repeat(3, 1fr)",
40
+ gap: 4
41
+ },
42
+ children: [
43
+ ["solid", "Solid"],
44
+ ["xray", "X-Ray"],
45
+ ["cutaway", "Cutaway"]
46
+ ].map(([t, n]) => /* @__PURE__ */ i(e, {
47
+ label: n,
48
+ active: o.shellViewMode === t,
49
+ color: "#00E5FF",
50
+ center: !0,
51
+ onClick: () => o.onChangeShellViewMode(t)
52
+ }, t))
53
+ }),
54
+ /* @__PURE__ */ a("label", {
55
+ style: {
56
+ display: "flex",
57
+ alignItems: "center",
58
+ gap: 6,
59
+ fontSize: 10.5,
60
+ cursor: "pointer"
61
+ },
62
+ children: [/* @__PURE__ */ i("input", {
63
+ type: "checkbox",
64
+ checked: o.cabin.enabled,
65
+ onChange: (e) => o.onUpdateCabin({ enabled: e.target.checked }),
66
+ style: { accentColor: "#10B981" }
67
+ }), /* @__PURE__ */ i("span", { children: "Enable Mixamo Driver Seat & IK Sockets" })]
68
+ })
69
+ ]
70
+ }),
71
+ o.cabin.enabled && /* @__PURE__ */ a("div", {
72
+ style: t,
73
+ children: [
74
+ /* @__PURE__ */ i("div", {
75
+ style: {
76
+ display: "grid",
77
+ gridTemplateColumns: "repeat(3, 1fr)",
78
+ gap: 4
79
+ },
80
+ children: [
81
+ ["lhd", "LHD (Left)"],
82
+ ["center", "Center"],
83
+ ["rhd", "RHD (Right)"]
84
+ ].map(([t, n]) => /* @__PURE__ */ i(e, {
85
+ label: n,
86
+ active: o.cabin.layout === t,
87
+ color: "#FFB000",
88
+ center: !0,
89
+ onClick: () => o.onSetCabinLayout(t)
90
+ }, t))
91
+ }),
92
+ /* @__PURE__ */ a("div", {
93
+ style: {
94
+ display: "flex",
95
+ gap: 6,
96
+ fontSize: 10,
97
+ padding: "4px 6px",
98
+ borderRadius: 3,
99
+ background: "#0F151E",
100
+ border: `1px solid ${o.cabinFit.headroomOk && o.cabinFit.shoulderOk ? "#10B981" : "#F43F5E"}`
101
+ },
102
+ children: [
103
+ /* @__PURE__ */ i("span", {
104
+ style: { color: o.cabinFit.headroomOk ? "#34D399" : "#FB7185" },
105
+ children: `Headroom ${s(o.cabinFit.headroomM)} ${o.cabinFit.headroomOk ? "✓" : "CLIP"}`
106
+ }),
107
+ /* @__PURE__ */ i("span", {
108
+ style: { color: "#475569" },
109
+ children: "|"
110
+ }),
111
+ /* @__PURE__ */ i("span", {
112
+ style: { color: o.cabinFit.shoulderOk ? "#34D399" : "#FB7185" },
113
+ children: `Door ${s(o.cabinFit.shoulderClearanceM)} ${o.cabinFit.shoulderOk ? "✓" : "CLIP"}`
114
+ })
115
+ ]
116
+ }),
117
+ /* @__PURE__ */ i(n, {
118
+ label: "Seat X",
119
+ value: o.cabin.seatPos[0],
120
+ min: Number((c + .15).toFixed(2)),
121
+ max: Number((d - .15).toFixed(2)),
122
+ step: .01,
123
+ display: `${o.cabin.seatPos[0].toFixed(2)}m`,
124
+ onChange: (e) => m(0, e)
125
+ }),
126
+ /* @__PURE__ */ i(n, {
127
+ label: "Seat Y",
128
+ value: o.cabin.seatPos[1],
129
+ min: Number((l + .15).toFixed(2)),
130
+ max: Number(Math.max(l + .5, f - .55).toFixed(2)),
131
+ step: .01,
132
+ display: `${o.cabin.seatPos[1].toFixed(2)}m`,
133
+ accent: "#10B981",
134
+ onChange: (e) => m(1, e)
135
+ }),
136
+ /* @__PURE__ */ i(n, {
137
+ label: "Seat Z",
138
+ value: o.cabin.seatPos[2],
139
+ min: Number((u + .3).toFixed(2)),
140
+ max: Number((p - .5).toFixed(2)),
141
+ step: .01,
142
+ display: `${o.cabin.seatPos[2].toFixed(2)}m`,
143
+ accent: "#FFB000",
144
+ onChange: (e) => m(2, e)
145
+ }),
146
+ /* @__PURE__ */ i(n, {
147
+ label: "Wheel Z",
148
+ value: o.cabin.steerOffsetZ,
149
+ min: .28,
150
+ max: .68,
151
+ step: .01,
152
+ display: `${o.cabin.steerOffsetZ.toFixed(2)}m`,
153
+ onChange: (e) => o.onUpdateCabin({ steerOffsetZ: e })
154
+ }),
155
+ /* @__PURE__ */ i(n, {
156
+ label: "Wheel Y",
157
+ value: o.cabin.steerOffsetY,
158
+ min: .22,
159
+ max: .62,
160
+ step: .01,
161
+ display: `${o.cabin.steerOffsetY.toFixed(2)}m`,
162
+ onChange: (e) => o.onUpdateCabin({ steerOffsetY: e })
163
+ }),
164
+ /* @__PURE__ */ i(n, {
165
+ label: "Recline",
166
+ value: o.cabin.reclineDeg,
167
+ min: 0,
168
+ max: 32,
169
+ step: 1,
170
+ display: `${o.cabin.reclineDeg}°`,
171
+ accent: "#A855F7",
172
+ onChange: (e) => o.onUpdateCabin({ reclineDeg: e })
173
+ }),
174
+ /* @__PURE__ */ a("label", {
175
+ style: {
176
+ display: "flex",
177
+ alignItems: "center",
178
+ gap: 6,
179
+ fontSize: 10.5,
180
+ cursor: "pointer"
181
+ },
182
+ children: [/* @__PURE__ */ i("input", {
183
+ type: "checkbox",
184
+ checked: o.cabin.includeInteriorTub,
185
+ onChange: (e) => o.onUpdateCabin({ includeInteriorTub: e.target.checked }),
186
+ style: { accentColor: "#00E5FF" }
187
+ }), /* @__PURE__ */ i("span", { children: "Bake simple interior (floor + seats + dash + wheel)" })]
188
+ }),
189
+ o.cabin.includeInteriorTub && o.cabin.layout !== "center" && /* @__PURE__ */ a("label", {
190
+ style: {
191
+ display: "flex",
192
+ alignItems: "center",
193
+ gap: 6,
194
+ fontSize: 10.5,
195
+ cursor: "pointer"
196
+ },
197
+ children: [/* @__PURE__ */ i("input", {
198
+ type: "checkbox",
199
+ checked: o.cabin.passengerSeat,
200
+ onChange: (e) => o.onUpdateCabin({ passengerSeat: e.target.checked }),
201
+ style: { accentColor: "#00E5FF" }
202
+ }), /* @__PURE__ */ i("span", { children: "Include mirrored passenger seat" })]
203
+ }),
204
+ /* @__PURE__ */ i("div", {
205
+ style: {
206
+ fontSize: 9.5,
207
+ color: "#94A3B8"
208
+ },
209
+ children: "Auto-bakes 7 Mixamo sockets: Seat, Eye, Exit, Steer L/R, Pedal L/R."
210
+ })
211
+ ]
212
+ }),
213
+ /* @__PURE__ */ i(e, {
214
+ label: "Next: 4 · Test Drive & Export ->",
215
+ active: !0,
216
+ color: "#10B981",
217
+ center: !0,
218
+ onClick: o.onNextDrive
219
+ })
220
+ ] });
221
+ }
222
+ export { o as CabinStepSection };
@@ -1,9 +1,18 @@
1
1
  import React from "react";
2
+ import type { CabinFitReport, CarCabinConfig, DriverSeatLayout, ShellViewMode } from "./cabinMixamoRig.js";
3
+ import type { VehicleSubArchetype } from "./gateStore.js";
4
+ import { type CarDriveMode, type EngineTorqueCurveId, type SteerSpeedCurveId, type TireArchetypeId, type WheelVisualSource } from "./khrCompiler.js";
2
5
  import { type ActiveChopRole, type ChopPartRole, type SurfaceSelectMode } from "./surfaceCutter.js";
3
- import type { CarDriveMode, WheelVisualSource } from "./khrCompiler.js";
6
+ export type ChopWizardTab = "fit" | "shell" | "cabin" | "drive";
4
7
  export interface ChopShopPanelProps {
8
+ readonly vehicleArchetype: VehicleSubArchetype;
9
+ readonly wizardTab: ChopWizardTab;
10
+ readonly onChangeWizardTab: (tab: ChopWizardTab) => void;
5
11
  readonly targetMeters: number;
6
12
  readonly onChangeTargetMeters: (m: number) => void;
13
+ readonly onBumpTurn: (axis: 0 | 1 | 2) => void;
14
+ readonly onSnapYZero: () => void;
15
+ readonly onAutoPopWheels: () => void;
7
16
  readonly activeRole: ActiveChopRole;
8
17
  readonly onSelectRole: (r: ActiveChopRole) => void;
9
18
  readonly surfaceMode: SurfaceSelectMode;
@@ -20,12 +29,32 @@ export interface ChopShopPanelProps {
20
29
  readonly undoCount: number;
21
30
  readonly partPicks: Readonly<Record<number, ChopPartRole>>;
22
31
  readonly wheelCount: number;
32
+ readonly propellerCount: number;
23
33
  readonly wheelSource: WheelVisualSource;
24
34
  readonly onChangeWheelSource: (src: WheelVisualSource) => void;
35
+ readonly shellViewMode: ShellViewMode;
36
+ readonly onChangeShellViewMode: (m: ShellViewMode) => void;
37
+ readonly cabin: CarCabinConfig;
38
+ readonly cabinFit: CabinFitReport;
39
+ readonly carBounds: {
40
+ readonly min: readonly [number, number, number];
41
+ readonly max: readonly [number, number, number];
42
+ };
43
+ readonly onUpdateCabin: (patch: Partial<CarCabinConfig>) => void;
44
+ readonly onSetCabinLayout: (layout: DriverSeatLayout) => void;
45
+ readonly onAutoFitCabin: () => void;
25
46
  readonly driveType: CarDriveMode;
26
47
  readonly onChangeDriveType: (d: CarDriveMode) => void;
48
+ readonly massKg: number;
49
+ readonly onChangeMassKg: (kg: number) => void;
27
50
  readonly horsepower: number;
28
51
  readonly onChangeHorsepower: (hp: number) => void;
52
+ readonly tirePreset: TireArchetypeId;
53
+ readonly onChangeTirePreset: (id: TireArchetypeId) => void;
54
+ readonly torqueCurve: EngineTorqueCurveId;
55
+ readonly onChangeTorqueCurve: (id: EngineTorqueCurveId) => void;
56
+ readonly steerCurve: SteerSpeedCurveId;
57
+ readonly onChangeSteerCurve: (id: SteerSpeedCurveId) => void;
29
58
  readonly hingeScrub: number;
30
59
  readonly onChangeHingeScrub: (v: number) => void;
31
60
  readonly explodeAmount: number;
@@ -39,6 +68,7 @@ export interface ChopShopPanelProps {
39
68
  readonly onUndoCut: () => void;
40
69
  readonly onClearTags: () => void;
41
70
  readonly onGoTestDrive: () => void;
71
+ readonly onDownloadGlb: () => void;
42
72
  readonly onSpawnWorld?: () => void;
43
73
  }
44
74
  export declare function ChopShopPanel(p: ChopShopPanelProps): React.JSX.Element;