@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.
- package/bin/kolmo.mjs +1 -1
- package/dist/engine/kolmoActor.js +125 -83
- package/dist/engine/kolmoLongDrive.js +136 -91
- package/dist/engine/kolmoStore.d.ts +6 -5
- package/dist/engine/kolmoStore.js +115 -79
- package/dist/engine/kolmoVehicle.d.ts +1 -1
- package/dist/engine/kolmoVehicle.js +160 -147
- package/dist/engine/kolmoVehicleDriver.d.ts +12 -4
- package/dist/engine/kolmoVehicleDriver.js +40 -20
- package/dist/engine/kolmoWorld.js +55 -35
- package/dist/importer/CabinPreviewRig.d.ts +13 -0
- package/dist/importer/CabinPreviewRig.js +138 -0
- package/dist/importer/CabinStepSection.d.ts +17 -0
- package/dist/importer/CabinStepSection.js +222 -0
- package/dist/importer/ChopShopPanel.d.ts +31 -1
- package/dist/importer/ChopShopPanel.js +474 -380
- package/dist/importer/GateHudBar.d.ts +3 -0
- package/dist/importer/GateHudBar.js +8 -2
- package/dist/importer/GlbImportGate.js +183 -147
- package/dist/importer/ImporterPlinthUikitTags.d.ts +2 -1
- package/dist/importer/ImporterPlinthUikitTags.js +23 -16
- package/dist/importer/Step1CalibrationPlinth.d.ts +10 -0
- package/dist/importer/Step1CalibrationPlinth.js +203 -141
- package/dist/importer/Step2UniversalPad.d.ts +8 -1
- package/dist/importer/Step2UniversalPad.js +112 -90
- package/dist/importer/cabinMeshBuilders.d.ts +13 -0
- package/dist/importer/cabinMeshBuilders.js +104 -0
- package/dist/importer/cabinMixamoRig.d.ts +53 -0
- package/dist/importer/cabinMixamoRig.js +150 -0
- package/dist/importer/chopShopActions.d.ts +6 -0
- package/dist/importer/chopShopActions.js +86 -61
- package/dist/importer/chopShopUiComponents.d.ts +22 -0
- package/dist/importer/chopShopUiComponents.js +91 -0
- package/dist/importer/gateStore.d.ts +5 -2
- package/dist/importer/gateStore.js +13 -10
- package/dist/importer/glbNormalizer.d.ts +10 -1
- package/dist/importer/glbNormalizer.js +114 -49
- package/dist/importer/importerWebMcp.js +4 -1
- package/dist/importer/index.d.ts +4 -2
- package/dist/importer/index.js +24 -21
- package/dist/importer/khrCompiler.d.ts +20 -1
- package/dist/importer/khrCompiler.js +539 -290
- package/dist/importer/launcherBake.js +12 -8
- package/dist/importer/meshIslands.d.ts +4 -0
- package/dist/importer/meshIslands.js +104 -99
- package/dist/importer/surfaceCutter.d.ts +12 -3
- package/dist/importer/surfaceCutter.js +220 -127
- package/dist/importer/surfaceTopology.d.ts +13 -2
- package/dist/importer/surfaceTopology.js +57 -29
- package/dist/importer/universalGateBake.d.ts +7 -1
- package/dist/importer/universalGateBake.js +63 -60
- package/dist/importer/usdToGlb.js +19 -7
- package/dist/importer/useChopShopController.d.ts +27 -1
- package/dist/importer/useChopShopController.js +369 -255
- package/dist/importer/wheelAxlePairing.d.ts +3 -1
- package/dist/importer/wheelAxlePairing.js +82 -33
- package/dist/index.js +31 -28
- package/dist/junk/ShardPieces.js +3 -3
- package/dist/physics/index.d.ts +7 -0
- package/dist/physics/index.js +66 -40
- package/package.json +1 -1
|
@@ -7,9 +7,12 @@ export interface GateHudBarProps {
|
|
|
7
7
|
readonly usdInfo: string | null;
|
|
8
8
|
readonly busy: boolean;
|
|
9
9
|
readonly wheelCount: number;
|
|
10
|
+
readonly propellerCount?: number;
|
|
10
11
|
readonly choppedCount: number;
|
|
11
12
|
readonly stampTool: StampToolId;
|
|
12
13
|
readonly patchCount: number;
|
|
14
|
+
readonly showDriver?: boolean;
|
|
15
|
+
readonly onToggleDriver?: () => void;
|
|
13
16
|
readonly onChooseFile: () => void;
|
|
14
17
|
readonly onLoadStarterCar: (url: string, label: string) => void;
|
|
15
18
|
readonly onSelectDomain: (d: GateDomain) => void;
|
|
@@ -180,8 +180,8 @@ function _(c) {
|
|
|
180
180
|
active: !m.usePaperShellProxy && m.vehicleArchetype === e,
|
|
181
181
|
onClick: () => c.onSelectVehicleSub(e)
|
|
182
182
|
}, e)),
|
|
183
|
-
!m.usePaperShellProxy &&
|
|
184
|
-
label: `[ AUTO-POP TIRES (${c.wheelCount}W) ]`,
|
|
183
|
+
!m.usePaperShellProxy && /* @__PURE__ */ o(h, {
|
|
184
|
+
label: c.propellerCount ? `[ AUTO-POP TIRES (${c.wheelCount}W · ${c.propellerCount}P) ]` : `[ AUTO-POP TIRES (${c.wheelCount}W) ]`,
|
|
185
185
|
onClick: c.onAutoPopWheels
|
|
186
186
|
}),
|
|
187
187
|
/* @__PURE__ */ o(h, {
|
|
@@ -253,6 +253,12 @@ function _(c) {
|
|
|
253
253
|
onClick: () => m.resetAllPanels()
|
|
254
254
|
})
|
|
255
255
|
] }) : /* @__PURE__ */ s(a, { children: [
|
|
256
|
+
m.domain === "vehicle" && c.onToggleDriver && /* @__PURE__ */ o(h, {
|
|
257
|
+
label: c.showDriver ? "[ MIXAMO DRIVER: ON ]" : "[ MIXAMO DRIVER: OFF ]",
|
|
258
|
+
active: !!c.showDriver,
|
|
259
|
+
accent: p,
|
|
260
|
+
onClick: c.onToggleDriver
|
|
261
|
+
}),
|
|
256
262
|
m.domain === "vehicle" && c.choppedCount > 0 && /* @__PURE__ */ s(a, { children: [
|
|
257
263
|
/* @__PURE__ */ o(h, {
|
|
258
264
|
label: "[ SWING DOORS ]",
|
|
@@ -7,41 +7,41 @@ import { Step1CalibrationPlinth as o } from "./Step1CalibrationPlinth.js";
|
|
|
7
7
|
import { Step2UniversalPad as s } from "./Step2UniversalPad.js";
|
|
8
8
|
import { VfxEmitterPool as c } from "./VfxEmitterPool.js";
|
|
9
9
|
import { useChopShopController as l } from "./useChopShopController.js";
|
|
10
|
-
import { useMemo as u, useRef as d } from "react";
|
|
11
|
-
import { Canvas as
|
|
12
|
-
import { Grid as
|
|
13
|
-
import { jsx as
|
|
10
|
+
import { useMemo as u, useRef as d, useState as f } from "react";
|
|
11
|
+
import { Canvas as p } from "@react-three/fiber";
|
|
12
|
+
import { Grid as m, OrbitControls as h } from "@react-three/drei";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
14
|
// src/importer/GlbImportGate.tsx
|
|
15
|
-
function
|
|
16
|
-
let
|
|
15
|
+
function v({ onSpawnInWorld: v, enableWebMcp: y = !0 }) {
|
|
16
|
+
let b = l(v), { st: x } = b, S = d(null), [C, w] = f(!1), T = x.step === 1 && x.domain === "vehicle" && !x.usePaperShellProxy, E = !C && !(x.step === 2 && x.domain === "vehicle" && !x.usePaperShellProxy && x.chaseCam && b.stampTool === "none"), D = (t, n, r) => {
|
|
17
17
|
let i = e(t, r);
|
|
18
|
-
|
|
18
|
+
b.setPatches((e) => [...e, {
|
|
19
19
|
nodeName: t,
|
|
20
20
|
translation: n,
|
|
21
21
|
extension: { socket: i }
|
|
22
22
|
}]);
|
|
23
|
-
},
|
|
24
|
-
assetName:
|
|
25
|
-
wheelCount:
|
|
26
|
-
choppedCount:
|
|
27
|
-
unlocked:
|
|
28
|
-
targetMeters:
|
|
29
|
-
setTargetMeters:
|
|
30
|
-
bumpTurn:
|
|
31
|
-
autoPopWheels:
|
|
32
|
-
applyDomainDefaults:
|
|
33
|
-
loadStarterCar:
|
|
34
|
-
addAnchorPoint:
|
|
35
|
-
cutPart:
|
|
36
|
-
sealAndExport:
|
|
37
|
-
captureDataUrl: () =>
|
|
38
|
-
}), [
|
|
39
|
-
return a(
|
|
23
|
+
}, O = u(() => ({
|
|
24
|
+
assetName: b.assetName,
|
|
25
|
+
wheelCount: b.wheelCount,
|
|
26
|
+
choppedCount: b.choppedCount,
|
|
27
|
+
unlocked: b.unlocked,
|
|
28
|
+
targetMeters: b.targetMeters,
|
|
29
|
+
setTargetMeters: b.setTargetMeters,
|
|
30
|
+
bumpTurn: b.bumpTurn,
|
|
31
|
+
autoPopWheels: b.autoPopWheels,
|
|
32
|
+
applyDomainDefaults: b.applyDomainDefaults,
|
|
33
|
+
loadStarterCar: b.loadStarterCar,
|
|
34
|
+
addAnchorPoint: D,
|
|
35
|
+
cutPart: b.cutPart,
|
|
36
|
+
sealAndExport: b.sealAndExport,
|
|
37
|
+
captureDataUrl: () => S.current?.() ?? null
|
|
38
|
+
}), [b]);
|
|
39
|
+
return a(O, y), /* @__PURE__ */ _("div", {
|
|
40
40
|
onDragOver: (e) => e.preventDefault(),
|
|
41
41
|
onDrop: (e) => {
|
|
42
42
|
e.preventDefault();
|
|
43
43
|
let t = e.dataTransfer.files?.[0];
|
|
44
|
-
t &&
|
|
44
|
+
t && b.ingestFile(t);
|
|
45
45
|
},
|
|
46
46
|
style: {
|
|
47
47
|
position: "relative",
|
|
@@ -51,112 +51,139 @@ function _({ onSpawnInWorld: _, enableWebMcp: v = !0 }) {
|
|
|
51
51
|
height: "100%",
|
|
52
52
|
overflow: "hidden",
|
|
53
53
|
background: "#0A0C0E",
|
|
54
|
-
imageRendering:
|
|
54
|
+
imageRendering: x.eraMode === "psx-1-3" ? "pixelated" : "auto"
|
|
55
55
|
},
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
ref:
|
|
57
|
+
/* @__PURE__ */ g("input", {
|
|
58
|
+
ref: b.fileRef,
|
|
59
59
|
type: "file",
|
|
60
60
|
accept: ".glb,.usd,.usda,.usdc,.usdz",
|
|
61
61
|
hidden: !0,
|
|
62
62
|
onChange: (e) => {
|
|
63
63
|
let t = e.target.files?.[0];
|
|
64
|
-
t &&
|
|
64
|
+
t && b.ingestFile(t);
|
|
65
65
|
}
|
|
66
66
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
hasCustomFile:
|
|
69
|
-
assetName:
|
|
70
|
-
usdInfo:
|
|
71
|
-
busy:
|
|
72
|
-
wheelCount:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
/* @__PURE__ */ g(i, {
|
|
68
|
+
hasCustomFile: b.hasCustomFile,
|
|
69
|
+
assetName: b.assetName,
|
|
70
|
+
usdInfo: b.usdInfo,
|
|
71
|
+
busy: b.busy,
|
|
72
|
+
wheelCount: b.wheelCount,
|
|
73
|
+
propellerCount: b.propellerCount,
|
|
74
|
+
choppedCount: b.choppedCount,
|
|
75
|
+
stampTool: b.stampTool,
|
|
76
|
+
patchCount: b.patches.length,
|
|
77
|
+
showDriver: b.showDriverInStep2,
|
|
78
|
+
onToggleDriver: () => b.setShowDriverInStep2((e) => !e),
|
|
79
|
+
onChooseFile: () => b.fileRef.current?.click(),
|
|
77
80
|
onLoadStarterCar: (e, t) => {
|
|
78
|
-
|
|
81
|
+
b.loadStarterCar(e, t).catch(() => {});
|
|
79
82
|
},
|
|
80
|
-
onSelectDomain: (e) =>
|
|
81
|
-
onSelectVehicleSub: (e) =>
|
|
82
|
-
onBumpTurn:
|
|
83
|
-
onAutoScaleSi:
|
|
84
|
-
onSnapYZero: () =>
|
|
85
|
-
onSnapC12:
|
|
86
|
-
onWrapProxy:
|
|
87
|
-
onAutoPopWheels:
|
|
88
|
-
onSelectStampTool:
|
|
89
|
-
onUndoPatch: () =>
|
|
90
|
-
onSwingPanelRole: (e) =>
|
|
91
|
-
onDownloadGlb: () => void
|
|
92
|
-
onSpawnWorld:
|
|
83
|
+
onSelectDomain: (e) => b.applyDomainDefaults(e, x.vehicleArchetype, !1),
|
|
84
|
+
onSelectVehicleSub: (e) => b.applyDomainDefaults("vehicle", e, !1),
|
|
85
|
+
onBumpTurn: b.bumpTurn,
|
|
86
|
+
onAutoScaleSi: b.autoScaleSi,
|
|
87
|
+
onSnapYZero: () => b.setYOffset(0),
|
|
88
|
+
onSnapC12: b.snapC12,
|
|
89
|
+
onWrapProxy: b.wrapProxy,
|
|
90
|
+
onAutoPopWheels: b.autoPopWheels,
|
|
91
|
+
onSelectStampTool: b.setStampTool,
|
|
92
|
+
onUndoPatch: () => b.setPatches((e) => e.slice(0, -1)),
|
|
93
|
+
onSwingPanelRole: (e) => b.panelAnimRef.current?.toggleRolePrefix(e),
|
|
94
|
+
onDownloadGlb: () => void b.sealAndExport(!1),
|
|
95
|
+
onSpawnWorld: v ? () => void b.sealAndExport(!0) : void 0
|
|
93
96
|
}),
|
|
94
|
-
|
|
95
|
-
domain:
|
|
96
|
-
hasCustomFile:
|
|
97
|
-
targetMeters:
|
|
98
|
-
onChangeTargetMeters:
|
|
99
|
-
onSnapC12:
|
|
100
|
-
onLoadVaultUrl:
|
|
101
|
-
onForgeLauncherRecipe:
|
|
102
|
-
onAddSocketPatch:
|
|
103
|
-
workingScene:
|
|
104
|
-
onEnforceCrispyPerson: () => r(
|
|
105
|
-
onUploadToVault:
|
|
97
|
+
x.step === 1 && x.domain !== "vehicle" && /* @__PURE__ */ g(n, {
|
|
98
|
+
domain: x.domain,
|
|
99
|
+
hasCustomFile: b.hasCustomFile,
|
|
100
|
+
targetMeters: b.targetMeters,
|
|
101
|
+
onChangeTargetMeters: b.setTargetMeters,
|
|
102
|
+
onSnapC12: b.snapC12,
|
|
103
|
+
onLoadVaultUrl: b.loadStarterCar,
|
|
104
|
+
onForgeLauncherRecipe: b.forgeScene,
|
|
105
|
+
onAddSocketPatch: D,
|
|
106
|
+
workingScene: b.workingScene,
|
|
107
|
+
onEnforceCrispyPerson: () => r(b.workingScene),
|
|
108
|
+
onUploadToVault: b.uploadToVault
|
|
106
109
|
}),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
T && /* @__PURE__ */ g(t, {
|
|
111
|
+
vehicleArchetype: x.vehicleArchetype,
|
|
112
|
+
wizardTab: b.wizardTab,
|
|
113
|
+
onChangeWizardTab: b.handleChangeWizardTab,
|
|
114
|
+
targetMeters: b.targetMeters,
|
|
115
|
+
onChangeTargetMeters: b.setTargetMeters,
|
|
116
|
+
onBumpTurn: b.bumpTurn,
|
|
117
|
+
onSnapYZero: () => b.setYOffset(0),
|
|
118
|
+
onAutoPopWheels: b.autoPopWheels,
|
|
119
|
+
activeRole: b.activeRole,
|
|
120
|
+
onSelectRole: b.setActiveRole,
|
|
121
|
+
surfaceMode: b.surfaceMode,
|
|
113
122
|
onChangeSurfaceMode: (e) => {
|
|
114
|
-
|
|
123
|
+
b.setSurfaceMode(e), e !== "loop" && b.setLoopDots(null);
|
|
115
124
|
},
|
|
116
|
-
creaseDeg:
|
|
117
|
-
onChangeCreaseDeg:
|
|
118
|
-
mirrorX:
|
|
119
|
-
onToggleMirrorX:
|
|
120
|
-
splitCoarse:
|
|
121
|
-
onToggleSplitCoarse:
|
|
122
|
-
selectedFaces:
|
|
123
|
-
mirroredFaces:
|
|
124
|
-
loopDotCount:
|
|
125
|
-
undoCount:
|
|
126
|
-
partPicks:
|
|
127
|
-
wheelCount:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
125
|
+
creaseDeg: b.creaseDeg,
|
|
126
|
+
onChangeCreaseDeg: b.setCreaseDeg,
|
|
127
|
+
mirrorX: b.mirrorX,
|
|
128
|
+
onToggleMirrorX: b.setMirrorX,
|
|
129
|
+
splitCoarse: b.splitCoarse,
|
|
130
|
+
onToggleSplitCoarse: b.setSplitCoarse,
|
|
131
|
+
selectedFaces: b.selectedCounts.primary,
|
|
132
|
+
mirroredFaces: b.selectedCounts.mirrored,
|
|
133
|
+
loopDotCount: b.loopDots?.points.length ?? 0,
|
|
134
|
+
undoCount: b.undoStack.length,
|
|
135
|
+
partPicks: b.partPicks,
|
|
136
|
+
wheelCount: b.wheelCount,
|
|
137
|
+
propellerCount: b.propellerCount,
|
|
138
|
+
wheelSource: b.wheelSource,
|
|
139
|
+
onChangeWheelSource: b.setWheelSource,
|
|
140
|
+
shellViewMode: b.shellViewMode,
|
|
141
|
+
onChangeShellViewMode: b.setShellViewMode,
|
|
142
|
+
cabin: b.cabin,
|
|
143
|
+
cabinFit: b.cabinFit,
|
|
144
|
+
carBounds: b.carBounds,
|
|
145
|
+
onUpdateCabin: b.updateCabin,
|
|
146
|
+
onSetCabinLayout: b.setCabinLayout,
|
|
147
|
+
onAutoFitCabin: b.autoFitCabin,
|
|
148
|
+
driveType: x.driveType,
|
|
149
|
+
onChangeDriveType: (e) => x.setField("driveType", e),
|
|
150
|
+
massKg: x.massKg,
|
|
151
|
+
onChangeMassKg: (e) => x.setField("massKg", e),
|
|
152
|
+
horsepower: x.powerOrThrust,
|
|
153
|
+
onChangeHorsepower: (e) => x.setField("powerOrThrust", e),
|
|
154
|
+
tirePreset: x.tirePreset,
|
|
155
|
+
onChangeTirePreset: (e) => x.setField("tirePreset", e),
|
|
156
|
+
torqueCurve: x.torqueCurve,
|
|
157
|
+
onChangeTorqueCurve: (e) => x.setField("torqueCurve", e),
|
|
158
|
+
steerCurve: x.steerCurve,
|
|
159
|
+
onChangeSteerCurve: (e) => x.setField("steerCurve", e),
|
|
160
|
+
hingeScrub: b.hingeScrub,
|
|
161
|
+
onChangeHingeScrub: b.setHingeScrub,
|
|
162
|
+
explodeAmount: b.explodeAmount,
|
|
163
|
+
onChangeExplodeAmount: b.setExplodeAmount,
|
|
164
|
+
statusNote: b.statusNote,
|
|
165
|
+
unlocked: b.unlocked,
|
|
166
|
+
busy: b.busy,
|
|
167
|
+
onCloseLoop: b.handleCloseLoop,
|
|
168
|
+
onPeel: b.handlePeelSelection,
|
|
143
169
|
onClearSelection: () => {
|
|
144
|
-
|
|
170
|
+
b.setFaceSelection(null), b.setLoopDots(null);
|
|
145
171
|
},
|
|
146
|
-
onUndoCut:
|
|
172
|
+
onUndoCut: b.handleUndoCut,
|
|
147
173
|
onClearTags: () => {
|
|
148
|
-
|
|
174
|
+
b.setPartPicks({}), b.setPropellerIds([]), b.setHingeScrub(0);
|
|
149
175
|
},
|
|
150
|
-
onGoTestDrive: () =>
|
|
151
|
-
|
|
176
|
+
onGoTestDrive: () => x.setField("step", 2),
|
|
177
|
+
onDownloadGlb: () => void b.sealAndExport(!1),
|
|
178
|
+
onSpawnWorld: v ? () => void b.sealAndExport(!0) : void 0
|
|
152
179
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ g("div", {
|
|
154
181
|
style: {
|
|
155
182
|
flex: 1,
|
|
156
183
|
minHeight: 0
|
|
157
184
|
},
|
|
158
|
-
children: /* @__PURE__ */
|
|
159
|
-
dpr:
|
|
185
|
+
children: /* @__PURE__ */ _(p, {
|
|
186
|
+
dpr: x.eraMode === "psx-1-3" ? .333 : [1, 1.5],
|
|
160
187
|
gl: {
|
|
161
188
|
localClippingEnabled: !0,
|
|
162
189
|
antialias: !1,
|
|
@@ -171,15 +198,15 @@ function _({ onSpawnInWorld: _, enableWebMcp: v = !0 }) {
|
|
|
171
198
|
fov: 45
|
|
172
199
|
},
|
|
173
200
|
onCreated: ({ gl: e, scene: t, camera: n }) => {
|
|
174
|
-
|
|
201
|
+
S.current = () => (e.render(t, n), typeof e.domElement?.toDataURL == "function" ? e.domElement.toDataURL("image/png") : null);
|
|
175
202
|
},
|
|
176
203
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ g("color", {
|
|
178
205
|
attach: "background",
|
|
179
206
|
args: ["#0A0C0E"]
|
|
180
207
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ g("ambientLight", { intensity: .72 }),
|
|
209
|
+
/* @__PURE__ */ g("directionalLight", {
|
|
183
210
|
position: [
|
|
184
211
|
6,
|
|
185
212
|
10,
|
|
@@ -187,7 +214,7 @@ function _({ onSpawnInWorld: _, enableWebMcp: v = !0 }) {
|
|
|
187
214
|
],
|
|
188
215
|
intensity: 1.35
|
|
189
216
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ g("directionalLight", {
|
|
191
218
|
position: [
|
|
192
219
|
-6,
|
|
193
220
|
4,
|
|
@@ -196,50 +223,59 @@ function _({ onSpawnInWorld: _, enableWebMcp: v = !0 }) {
|
|
|
196
223
|
intensity: .45,
|
|
197
224
|
color: "#00E5FF"
|
|
198
225
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ g(m, {
|
|
200
227
|
infiniteGrid: !0,
|
|
201
|
-
cellSize:
|
|
228
|
+
cellSize: x.domain === "c12" ? 1 / 12 : .5,
|
|
202
229
|
sectionSize: 3,
|
|
203
230
|
sectionColor: "#1C2229",
|
|
204
231
|
cellColor: "#12161B",
|
|
205
232
|
fadeDistance: 90
|
|
206
233
|
}),
|
|
207
|
-
/* @__PURE__ */ h
|
|
234
|
+
/* @__PURE__ */ g(h, {
|
|
208
235
|
makeDefault: !0,
|
|
209
|
-
enabled:
|
|
236
|
+
enabled: E,
|
|
210
237
|
enableDamping: !0
|
|
211
238
|
}),
|
|
212
|
-
|
|
213
|
-
assembly:
|
|
214
|
-
useProxy:
|
|
215
|
-
previewScene:
|
|
216
|
-
islands:
|
|
217
|
-
axles:
|
|
218
|
-
wheelColors:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
+
x.step === 1 ? /* @__PURE__ */ g(o, {
|
|
240
|
+
assembly: b.assembly,
|
|
241
|
+
useProxy: x.domain === "vehicle" && x.usePaperShellProxy,
|
|
242
|
+
previewScene: b.workingScene,
|
|
243
|
+
islands: b.islands,
|
|
244
|
+
axles: b.axles,
|
|
245
|
+
wheelColors: b.wheelColors,
|
|
246
|
+
propellerSet: b.propellerSet,
|
|
247
|
+
partPicks: b.partPicks,
|
|
248
|
+
wheelSource: b.wheelSource,
|
|
249
|
+
surfaceMode: b.surfaceMode,
|
|
250
|
+
activeRoleColor: b.activeRoleColor,
|
|
251
|
+
faceSelection: b.faceSelection,
|
|
252
|
+
loopDots: b.loopDots,
|
|
253
|
+
hingeScrub: b.hingeScrub,
|
|
254
|
+
explodeAmount: b.explodeAmount,
|
|
255
|
+
shellViewMode: b.shellViewMode,
|
|
256
|
+
cabin: x.domain === "vehicle" && x.vehicleArchetype === "car" ? b.cabin : void 0,
|
|
257
|
+
carBounds: b.carBounds,
|
|
258
|
+
showCabinSockets: b.wizardTab === "cabin",
|
|
259
|
+
rootObjRef: b.rootObjRef,
|
|
260
|
+
onClickIsland: b.handleBucketIsland,
|
|
261
|
+
onPickFace: b.handlePickFace,
|
|
262
|
+
onBrushActiveChange: w
|
|
263
|
+
}) : /* @__PURE__ */ g(s, {
|
|
264
|
+
assembly: b.assembly,
|
|
265
|
+
importedRoot: b.workingScene,
|
|
266
|
+
rootObjRef: b.rootObjRef,
|
|
267
|
+
liveBundle: b.liveBundle,
|
|
268
|
+
patches: b.patches,
|
|
269
|
+
stampActive: b.stampTool !== "none",
|
|
270
|
+
panelAnimRef: b.panelAnimRef,
|
|
271
|
+
cabin: x.domain === "vehicle" && x.vehicleArchetype === "car" ? b.cabin : void 0,
|
|
272
|
+
carBounds: b.carBounds,
|
|
273
|
+
showDriver: b.showDriverInStep2,
|
|
274
|
+
onStampSurface: b.handleStampSurface
|
|
239
275
|
}),
|
|
240
|
-
|
|
241
|
-
chassisObjRef:
|
|
242
|
-
emitters:
|
|
276
|
+
x.domain === "vehicle" && x.usePaperShellProxy && /* @__PURE__ */ g(c, {
|
|
277
|
+
chassisObjRef: b.rootObjRef,
|
|
278
|
+
emitters: b.assembly.emitters
|
|
243
279
|
})
|
|
244
280
|
]
|
|
245
281
|
})
|
|
@@ -247,4 +283,4 @@ function _({ onSpawnInWorld: _, enableWebMcp: v = !0 }) {
|
|
|
247
283
|
]
|
|
248
284
|
});
|
|
249
285
|
}
|
|
250
|
-
export {
|
|
286
|
+
export { v as GlbImportGate };
|
|
@@ -9,10 +9,11 @@ export declare function makeStarterDomainScene(domain: GateDomain): THREE.Group;
|
|
|
9
9
|
* - SI Bounding-Box Dimension Tag (`W × H × L m · Y-floor`)
|
|
10
10
|
* - Interactive 3D Pills over tagged `Wheel` & `Door`/`Hood`/`Trunk` islands as you orbit around the model.
|
|
11
11
|
*/
|
|
12
|
-
export declare function ImporterPlinthUikitTags({ cal, islands, wheelColors, partPicks, explodeAmount, onClickIsland, }: {
|
|
12
|
+
export declare function ImporterPlinthUikitTags({ cal, islands, wheelColors, propellerSet, partPicks, explodeAmount, onClickIsland, }: {
|
|
13
13
|
readonly cal: CalibrationMetrics;
|
|
14
14
|
readonly islands: readonly MeshIsland[];
|
|
15
15
|
readonly wheelColors: ReadonlyMap<number, string>;
|
|
16
|
+
readonly propellerSet?: ReadonlySet<number>;
|
|
16
17
|
readonly partPicks: Readonly<Record<number, ChopPartRole>>;
|
|
17
18
|
readonly explodeAmount: number;
|
|
18
19
|
readonly onClickIsland: (id: number) => void;
|
|
@@ -56,30 +56,36 @@ function d({ position: e, label: n, sub: u, accent: d, onClick: f }) {
|
|
|
56
56
|
})
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
function f({ cal: t, islands: n, wheelColors: r,
|
|
60
|
-
let
|
|
59
|
+
function f({ cal: t, islands: n, wheelColors: r, propellerSet: i, partPicks: s, explodeAmount: c, onClickIsland: l }) {
|
|
60
|
+
let u = e(() => `${t.aabbSize[0].toFixed(2)}m W × ${t.aabbSize[1].toFixed(2)}m H × ${t.aabbSize[2].toFixed(2)}m L`, [t.aabbSize]), f = e(() => `Ymin ${t.minY >= 0 ? "+" : ""}${t.minY.toFixed(3)}m`, [t.minY]), p = e(() => {
|
|
61
61
|
let e = [];
|
|
62
62
|
for (let t of n) {
|
|
63
|
-
let n = r.get(t.id), a = i[t.id];
|
|
64
|
-
if (!n && !a) continue;
|
|
65
|
-
let
|
|
66
|
-
t.center[0] +
|
|
67
|
-
t.center[1] + t.size[1] * .5 + .16,
|
|
63
|
+
let n = r.get(t.id), a = !!i?.has(t.id), o = s[t.id];
|
|
64
|
+
if (!n && !a && !o) continue;
|
|
65
|
+
let l = Math.sign(t.center[0] || 1) * c * .65, u = [
|
|
66
|
+
t.center[0] + (n ? l : 0),
|
|
67
|
+
t.center[1] + t.size[1] * .5 + .16 + (a ? c * .65 : 0),
|
|
68
68
|
t.center[2]
|
|
69
69
|
];
|
|
70
70
|
if (n) {
|
|
71
|
-
let r = t.center[0]
|
|
71
|
+
let r = Math.abs(t.center[0]) <= .1 ? "C" : t.center[0] > 0 ? "L" : "R", i = t.center[2] >= 0 ? "F" : "R";
|
|
72
72
|
e.push({
|
|
73
73
|
id: t.id,
|
|
74
|
-
pos:
|
|
74
|
+
pos: u,
|
|
75
75
|
label: `WHEEL ${i}${r}`,
|
|
76
76
|
sub: `R ${(t.size[1] * .5).toFixed(2)}m`,
|
|
77
77
|
accent: n
|
|
78
78
|
});
|
|
79
|
-
} else a
|
|
79
|
+
} else a ? e.push({
|
|
80
80
|
id: t.id,
|
|
81
|
-
pos:
|
|
82
|
-
label:
|
|
81
|
+
pos: u,
|
|
82
|
+
label: "ROTOR",
|
|
83
|
+
sub: `${t.triangleIndices.length} tris`,
|
|
84
|
+
accent: "#EC4899"
|
|
85
|
+
}) : o && e.push({
|
|
86
|
+
id: t.id,
|
|
87
|
+
pos: u,
|
|
88
|
+
label: o.toUpperCase(),
|
|
83
89
|
sub: `${t.triangleIndices.length} tris`,
|
|
84
90
|
accent: "#38bdf8"
|
|
85
91
|
});
|
|
@@ -90,7 +96,8 @@ function f({ cal: t, islands: n, wheelColors: r, partPicks: i, explodeAmount: s,
|
|
|
90
96
|
n,
|
|
91
97
|
r,
|
|
92
98
|
i,
|
|
93
|
-
s
|
|
99
|
+
s,
|
|
100
|
+
c
|
|
94
101
|
]);
|
|
95
102
|
return /* @__PURE__ */ o("group", { children: [/* @__PURE__ */ a(d, {
|
|
96
103
|
position: [
|
|
@@ -99,14 +106,14 @@ function f({ cal: t, islands: n, wheelColors: r, partPicks: i, explodeAmount: s,
|
|
|
99
106
|
0
|
|
100
107
|
],
|
|
101
108
|
label: "SI BOUNDS",
|
|
102
|
-
sub: `${
|
|
109
|
+
sub: `${u} · ${f}`,
|
|
103
110
|
accent: "#00e5ff"
|
|
104
|
-
}),
|
|
111
|
+
}), p.map((e) => /* @__PURE__ */ a(d, {
|
|
105
112
|
position: e.pos,
|
|
106
113
|
label: e.label,
|
|
107
114
|
sub: e.sub,
|
|
108
115
|
accent: e.accent,
|
|
109
|
-
onClick: () =>
|
|
116
|
+
onClick: () => l(e.id)
|
|
110
117
|
}, `pill_${e.id}`))] });
|
|
111
118
|
}
|
|
112
119
|
export { f as ImporterPlinthUikitTags, u as makeStarterDomainScene };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PaperShellAssembly } from "@khr3/vehicles/paper-shell";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import * as THREE from "three";
|
|
4
|
+
import type { CarCabinConfig, ShellViewMode } from "./cabinMixamoRig.js";
|
|
4
5
|
import { makeStarterDomainScene } from "./ImporterPlinthUikitTags.js";
|
|
5
6
|
export { makeStarterDomainScene };
|
|
6
7
|
import { type WheelVisualSource } from "./khrCompiler.js";
|
|
@@ -20,6 +21,7 @@ export interface Step1CalibrationPlinthProps {
|
|
|
20
21
|
readonly islands: readonly MeshIsland[];
|
|
21
22
|
readonly axles: readonly WheelAxle[];
|
|
22
23
|
readonly wheelColors: ReadonlyMap<number, string>;
|
|
24
|
+
readonly propellerSet?: ReadonlySet<number>;
|
|
23
25
|
readonly partPicks: Readonly<Record<number, ChopPartRole>>;
|
|
24
26
|
readonly wheelSource: WheelVisualSource;
|
|
25
27
|
readonly surfaceMode: SurfaceSelectMode;
|
|
@@ -31,8 +33,16 @@ export interface Step1CalibrationPlinthProps {
|
|
|
31
33
|
} | null;
|
|
32
34
|
readonly hingeScrub: number;
|
|
33
35
|
readonly explodeAmount: number;
|
|
36
|
+
readonly shellViewMode?: ShellViewMode;
|
|
37
|
+
readonly cabin?: CarCabinConfig;
|
|
38
|
+
readonly carBounds?: {
|
|
39
|
+
readonly min: readonly [number, number, number];
|
|
40
|
+
readonly max: readonly [number, number, number];
|
|
41
|
+
};
|
|
42
|
+
readonly showCabinSockets?: boolean;
|
|
34
43
|
readonly onClickIsland: (id: number) => void;
|
|
35
44
|
readonly onPickFace: (hit: Step1FaceHit) => void;
|
|
45
|
+
readonly onBrushActiveChange?: (active: boolean) => void;
|
|
36
46
|
readonly rootObjRef: React.RefObject<THREE.Group | null>;
|
|
37
47
|
}
|
|
38
48
|
export declare function Step1CalibrationPlinth(p: Step1CalibrationPlinthProps): React.JSX.Element;
|