@pinkaphant/kolmo 0.1.0 → 0.1.2
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/README.md +2 -2
- package/bin/kolmo.mjs +47 -10
- package/dist/body/HeldItem.d.ts +22 -0
- package/dist/body/KhrBody.d.ts +26 -0
- package/dist/body/bodySi.d.ts +59 -0
- package/dist/body/index.d.ts +3 -0
- package/dist/body/index.js +1 -0
- package/dist/body-B7FTf67o.js +362 -0
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.js +3 -3
- package/dist/engine/kolmoStore.d.ts +17 -11
- package/dist/{engine-BiMeAPAi.js → engine-BeKvBM8d.js} +452 -424
- package/dist/importer/ImporterPlinthUikitTags.d.ts +19 -0
- package/dist/importer/Step1CalibrationPlinth.d.ts +3 -3
- package/dist/importer/index.js +1 -1
- package/dist/{importer-Cz5w0mnC.js → importer-B2-S-N_e.js} +1164 -1056
- package/dist/index.d.ts +1 -2
- package/dist/index.js +13 -14
- package/package.json +18 -10
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { VAULT_CATALOG as
|
|
17
|
-
import { KOLMOGOROV_CARBINE as
|
|
1
|
+
import { i as e } from "./body-B7FTf67o.js";
|
|
2
|
+
import { a as t, d as n, i as r, l as i, o as a, r as o, s } from "./kolmoSurface-DTnrFXH0.js";
|
|
3
|
+
import { g as c } from "./shaders-GS71Ek1A.js";
|
|
4
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
5
|
+
import * as m from "three";
|
|
6
|
+
import { Canvas as h, useFrame as g, useThree as _ } from "@react-three/fiber";
|
|
7
|
+
import { Bounds as v, Bvh as y, Grid as b, Line as x, OrbitControls as S } from "@react-three/drei";
|
|
8
|
+
import { KhrAssembly as C, cloneKhrBundle as w, exportKhrGlb as T, loadKhrGlb as E, patchGlbJsonChunk as D } from "@khr3/core";
|
|
9
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
10
|
+
import { CuboidCollider as j, Physics as ee, RigidBody as M, useBeforePhysicsStep as te, useRevoluteJoint as ne } from "@react-three/rapier";
|
|
11
|
+
import { easing as re } from "maath";
|
|
12
|
+
import { KhrVehicle as ie } from "@khr3/core/vehicle";
|
|
13
|
+
import { ENGINE_TORQUE_CURVES as ae, STEER_SPEED_CURVES as oe, TIRE_ARCHETYPES as se, tireGripForSurface as ce } from "@khr3/core/curves";
|
|
14
|
+
import { DOOR_HINGE_SPEC as N } from "@khr3/c12";
|
|
15
|
+
import { GLTFLoader as le } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
16
|
+
import { VAULT_CATALOG as P, createAssetVault as F } from "@khr3/assets";
|
|
17
|
+
import { KOLMOGOROV_CARBINE as ue, KOLMOGOROV_PISTOL as de, KOLMOGOROV_SHOTGUN as fe, LAUNCHER_RECIPES as pe, findLauncherRecipe as me, planLauncher as he } from "@khr3/launchers";
|
|
18
18
|
import { create as ge } from "zustand";
|
|
19
|
-
import { ALL_PANELS_ATTACHED_MASK as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
19
|
+
import { ALL_PANELS_ATTACHED_MASK as I, PaperShellMassMemo as _e, buildPaperShellAssembly as ve, exportPaperShellKhrGlb as ye } from "@khr3/vehicles/paper-shell";
|
|
20
|
+
import { Container as be, Root as xe, Text as Se } from "@react-three/uikit";
|
|
21
|
+
import { EcctrlVehicle as Ce, ShapeCastWheel as we } from "@pinkaphant/ecctrl/vehicle";
|
|
22
|
+
import { unzipSync as L, zipSync as Te } from "three/examples/jsm/libs/fflate.module.js";
|
|
23
|
+
import { USDLoader as Ee } from "three/examples/jsm/loaders/USDLoader.js";
|
|
23
24
|
// src/importer/wheelAxlePairing.ts
|
|
24
|
-
function
|
|
25
|
+
function R(e, t) {
|
|
25
26
|
let n = new Map(e.map((e) => [e.id, e])), r = [
|
|
26
27
|
Infinity,
|
|
27
28
|
Infinity,
|
|
@@ -51,14 +52,14 @@ function I(e, t) {
|
|
|
51
52
|
halfWidth: (i[0] - r[0]) * .5
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function De(e) {
|
|
55
56
|
let t = Math.max(e.size[1], e.size[2], 1e-5), n = Math.min(e.size[1], e.size[2]) / t, r = t / Math.max(e.size[0], 1e-5);
|
|
56
57
|
return n >= .56 && r >= 1.25;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function z(e, t, n) {
|
|
59
60
|
let r = t, i = Math.max(t.size[1], t.size[2]);
|
|
60
61
|
for (let a of e) {
|
|
61
|
-
if (a.id === t.id || n?.has(a.id) || !
|
|
62
|
+
if (a.id === t.id || n?.has(a.id) || !De(a)) continue;
|
|
62
63
|
let e = Math.max(a.size[1], a.size[2]);
|
|
63
64
|
if (!(e <= i * 1.32 || e > 1.3) && Math.hypot(a.center[0] - t.center[0], a.center[1] - t.center[1], a.center[2] - t.center[2]) <= e * .45) {
|
|
64
65
|
r = a;
|
|
@@ -77,13 +78,13 @@ function Te(e, t, n) {
|
|
|
77
78
|
}
|
|
78
79
|
return c;
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function Oe(e) {
|
|
81
82
|
if (e.length === 0) return [];
|
|
82
83
|
let t = Infinity, n = Infinity, r = -Infinity;
|
|
83
84
|
for (let i of e) t = Math.min(t, i.min[1]), n = Math.min(n, i.min[2]), r = Math.max(r, i.max[2]);
|
|
84
85
|
let i = Math.max(r - n, 1e-6), a = (e) => Math.max(e.size[1], e.size[2]), o = e.filter((e) => {
|
|
85
86
|
let n = a(e);
|
|
86
|
-
return
|
|
87
|
+
return De(e) && n >= i * .06 && n <= i * .6 && e.min[1] <= t + n * .18 && Math.abs(e.center[0]) > e.size[0] * .45;
|
|
87
88
|
}).sort((e, t) => a(t) - a(e)), s = /* @__PURE__ */ new Set(), c = [];
|
|
88
89
|
for (let t of o) {
|
|
89
90
|
if (s.has(t.id)) continue;
|
|
@@ -93,7 +94,7 @@ function Ee(e) {
|
|
|
93
94
|
})).filter((e) => e.s < .65).sort((e, t) => e.s - t.s)[0]?.c;
|
|
94
95
|
if (!i) continue;
|
|
95
96
|
s.add(t.id), s.add(i.id);
|
|
96
|
-
let a =
|
|
97
|
+
let a = z(e, t, s), l = z(e, i, s);
|
|
97
98
|
a.forEach((e) => s.add(e)), l.forEach((e) => s.add(e)), c.push(t.center[0] >= 0 ? {
|
|
98
99
|
left: a,
|
|
99
100
|
right: l
|
|
@@ -102,9 +103,9 @@ function Ee(e) {
|
|
|
102
103
|
right: a
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
|
-
return c.sort((t, n) =>
|
|
106
|
+
return c.sort((t, n) => R(e, [...n.left, ...n.right]).center[2] - R(e, [...t.left, ...t.right]).center[2]);
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function ke(e) {
|
|
108
109
|
if (e.length === 0) return [];
|
|
109
110
|
let t = Infinity, n = Infinity, r = -Infinity;
|
|
110
111
|
for (let i of e) t = Math.min(t, i.min[1]), n = Math.min(n, i.min[2]), r = Math.max(r, i.max[2]);
|
|
@@ -113,7 +114,7 @@ function De(e) {
|
|
|
113
114
|
return Math.abs(e.center[0]) < .15 * i && n >= i * .12 && n <= i * .55 && Math.abs(e.size[1] - e.size[2]) <= n * .25 && e.size[0] <= n * .85 && e.min[1] <= t + n * .24;
|
|
114
115
|
}).sort((e, t) => a(t) - a(e)), s = o.find((e) => e.center[2] > 0), c = o.find((e) => e.center[2] < 0 && e.id !== s?.id), l = /* @__PURE__ */ new Set(), u = [];
|
|
115
116
|
if (s) {
|
|
116
|
-
let t =
|
|
117
|
+
let t = z(e, s, l);
|
|
117
118
|
t.forEach((e) => l.add(e)), u.push({
|
|
118
119
|
left: t,
|
|
119
120
|
right: [],
|
|
@@ -123,7 +124,7 @@ function De(e) {
|
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
126
|
if (c) {
|
|
126
|
-
let t =
|
|
127
|
+
let t = z(e, c, l);
|
|
127
128
|
t.forEach((e) => l.add(e)), u.push({
|
|
128
129
|
left: t,
|
|
129
130
|
right: [],
|
|
@@ -134,20 +135,20 @@ function De(e) {
|
|
|
134
135
|
}
|
|
135
136
|
return u;
|
|
136
137
|
}
|
|
137
|
-
function
|
|
138
|
+
function Ae(e, t, n, r) {
|
|
138
139
|
let i = t.findIndex((e) => e.left.includes(n) || e.right.includes(n));
|
|
139
140
|
if (i >= 0) return t.filter((e, t) => t !== i);
|
|
140
141
|
let a = e.find((e) => e.id === n);
|
|
141
142
|
if (!a) return [...t];
|
|
142
|
-
let o =
|
|
143
|
+
let o = z(e, a), s = e.find((e) => e.id === o[0]) ?? a;
|
|
143
144
|
if (r === "motorcycle") return [...t, {
|
|
144
145
|
left: o,
|
|
145
146
|
right: [],
|
|
146
147
|
steered: s.center[2] >= 0,
|
|
147
148
|
driven: s.center[2] < 0,
|
|
148
149
|
brake: !0
|
|
149
|
-
}].sort((t, n) =>
|
|
150
|
-
let c = e.filter((e) => !o.includes(e.id)).sort((e, t) => Math.hypot(e.center[0] + s.center[0], e.center[1] - s.center[1], e.center[2] - s.center[2]) - Math.hypot(t.center[0] + s.center[0], t.center[1] - s.center[1], t.center[2] - s.center[2]))[0], l = c && Math.hypot(c.center[0] + s.center[0], c.center[1] - s.center[1], c.center[2] - s.center[2]) < Math.max(...s.size) * .45 ?
|
|
150
|
+
}].sort((t, n) => R(e, n.left).center[2] - R(e, t.left).center[2]);
|
|
151
|
+
let c = e.filter((e) => !o.includes(e.id)).sort((e, t) => Math.hypot(e.center[0] + s.center[0], e.center[1] - s.center[1], e.center[2] - s.center[2]) - Math.hypot(t.center[0] + s.center[0], t.center[1] - s.center[1], t.center[2] - s.center[2]))[0], l = c && Math.hypot(c.center[0] + s.center[0], c.center[1] - s.center[1], c.center[2] - s.center[2]) < Math.max(...s.size) * .45 ? z(e, c) : [], u = l.length > 0 ? s.center[0] >= 0 ? {
|
|
151
152
|
left: o,
|
|
152
153
|
right: l
|
|
153
154
|
} : {
|
|
@@ -157,10 +158,10 @@ function Oe(e, t, n, r) {
|
|
|
157
158
|
left: o,
|
|
158
159
|
right: []
|
|
159
160
|
};
|
|
160
|
-
return [...t, u].sort((t, n) =>
|
|
161
|
+
return [...t, u].sort((t, n) => R(e, [...n.left, ...n.right]).center[2] - R(e, [...t.left, ...t.right]).center[2]);
|
|
161
162
|
}
|
|
162
163
|
// src/importer/meshIslands.ts
|
|
163
|
-
var
|
|
164
|
+
var B = class {
|
|
164
165
|
p;
|
|
165
166
|
constructor(e) {
|
|
166
167
|
this.p = new Int32Array(e);
|
|
@@ -179,8 +180,8 @@ var ke = class {
|
|
|
179
180
|
let n = this.find(e), r = this.find(t);
|
|
180
181
|
n !== r && (this.p[r] = n);
|
|
181
182
|
}
|
|
182
|
-
},
|
|
183
|
-
function
|
|
183
|
+
}, V = (e) => (Array.isArray(e.material) ? e.material[0] : e.material) ?? new m.MeshStandardMaterial({ color: "#cbd5e1" });
|
|
184
|
+
function H(e, t) {
|
|
184
185
|
let n = e.clone(), r = t.determinant() < 0;
|
|
185
186
|
if (n.applyMatrix4(t), r) {
|
|
186
187
|
let e = n.getIndex(), t = n.getAttribute("position")?.count ?? 0;
|
|
@@ -194,37 +195,37 @@ function je(e, t) {
|
|
|
194
195
|
} else {
|
|
195
196
|
let e = new Uint32Array(t);
|
|
196
197
|
for (let n = 0; n + 2 < t; n += 3) e[n] = n, e[n + 1] = n + 2, e[n + 2] = n + 1;
|
|
197
|
-
n.setIndex(new
|
|
198
|
+
n.setIndex(new m.BufferAttribute(e, 1));
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
201
|
return n.getAttribute("normal") || n.computeVertexNormals(), n.computeBoundingBox(), n.computeBoundingSphere(), n;
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function je(e, t) {
|
|
203
204
|
let n = t.turns ?? [
|
|
204
205
|
0,
|
|
205
206
|
0,
|
|
206
207
|
0
|
|
207
208
|
], r = t.axis ?? "lengthZ";
|
|
208
209
|
if (!(t.targetMeters > 0)) throw Error(`normalizeSceneToSi: invalid targetMeters ${t.targetMeters}`);
|
|
209
|
-
let i = e.clone(!0), a = new
|
|
210
|
-
a.quaternion.setFromEuler(new
|
|
211
|
-
let o = new
|
|
210
|
+
let i = e.clone(!0), a = new m.Group();
|
|
211
|
+
a.quaternion.setFromEuler(new m.Euler(n[0] * Math.PI * .5, n[1] * Math.PI * .5, n[2] * Math.PI * .5, "XYZ")), a.add(i), a.updateMatrixWorld(!0);
|
|
212
|
+
let o = new m.Box3().setFromObject(a);
|
|
212
213
|
if (o.isEmpty()) throw Error("normalizeSceneToSi: empty scene bounds");
|
|
213
|
-
let s = o.getSize(new
|
|
214
|
+
let s = o.getSize(new m.Vector3()), c = o.getCenter(new m.Vector3()), l = r === "widthX" ? s.x : r === "heightY" ? s.y : r === "lengthZ" ? s.z : Math.max(s.x, s.y, s.z), u = t.targetMeters / Math.max(l, 1e-5), d = new m.Matrix4().makeTranslation(-c.x * u, -o.min.y * u, -c.z * u).multiply(new m.Matrix4().makeScale(u, u, u)), f = new m.Group();
|
|
214
215
|
f.name = e.name || "KolmoAsset";
|
|
215
|
-
let
|
|
216
|
+
let p = new m.Matrix4(), h = new m.Vector3();
|
|
216
217
|
i.traverse((e) => {
|
|
217
218
|
if (e !== i) {
|
|
218
|
-
if (e instanceof
|
|
219
|
-
let t = new
|
|
219
|
+
if (e instanceof m.Mesh && e.geometry) {
|
|
220
|
+
let t = new m.Mesh(H(e.geometry, p.multiplyMatrices(d, e.matrixWorld)), e.material);
|
|
220
221
|
t.name = e.name, t.userData = { ...e.userData }, f.add(t);
|
|
221
222
|
} else if (e.children.length === 0 && e.name) {
|
|
222
|
-
let t = new
|
|
223
|
+
let t = new m.Object3D();
|
|
223
224
|
t.name = e.name, t.userData = { ...e.userData }, t.position.copy(e.getWorldPosition(h).applyMatrix4(d)), f.add(t);
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
}), f.updateMatrixWorld(!0);
|
|
227
|
-
let g = new
|
|
228
|
+
let g = new m.Box3().setFromObject(f).getSize(new m.Vector3());
|
|
228
229
|
return {
|
|
229
230
|
scene: f,
|
|
230
231
|
sizeMeters: [
|
|
@@ -235,12 +236,12 @@ function Me(e, t) {
|
|
|
235
236
|
scaleApplied: u
|
|
236
237
|
};
|
|
237
238
|
}
|
|
238
|
-
function
|
|
239
|
+
function U(e, t, n = [
|
|
239
240
|
0,
|
|
240
241
|
0,
|
|
241
242
|
0
|
|
242
243
|
]) {
|
|
243
|
-
let r = e.getIndex(), i = t.length, a = new
|
|
244
|
+
let r = e.getIndex(), i = t.length, a = new m.BufferGeometry();
|
|
244
245
|
for (let o of Object.keys(e.attributes)) {
|
|
245
246
|
let s = e.getAttribute(o);
|
|
246
247
|
if (!s) continue;
|
|
@@ -253,33 +254,33 @@ function R(e, t, n = [
|
|
|
253
254
|
else for (let e = 0; e < c; e++) l[o + e] = s.getComponent(a, e);
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
|
-
a.setAttribute(o, new
|
|
257
|
+
a.setAttribute(o, new m.BufferAttribute(l, c));
|
|
257
258
|
}
|
|
258
259
|
return a.computeBoundingBox(), a.computeBoundingSphere(), a;
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
+
function Me(e, t = 1e-4) {
|
|
261
262
|
let n = 1 / Math.max(1e-7, t);
|
|
262
263
|
e.updateMatrixWorld(!0);
|
|
263
|
-
let r = new
|
|
264
|
+
let r = new m.Matrix4().copy(e.matrixWorld).invert(), i = new m.Matrix4(), a = [], o = 0;
|
|
264
265
|
return e.traverse((e) => {
|
|
265
|
-
if (!(e instanceof
|
|
266
|
+
if (!(e instanceof m.Mesh) || !e.geometry) return;
|
|
266
267
|
let t = e.geometry.getAttribute("position");
|
|
267
268
|
if (!t || t.count < 3) return;
|
|
268
|
-
let s =
|
|
269
|
+
let s = H(e.geometry, i.multiplyMatrices(r, e.matrixWorld)), c = s.getAttribute("position"), l = s.getIndex(), u = Math.floor(l ? l.count / 3 : c.count / 3);
|
|
269
270
|
if (u === 0) return;
|
|
270
|
-
let d = new
|
|
271
|
+
let d = new B(u), f = /* @__PURE__ */ new Map();
|
|
271
272
|
for (let e = 0; e < u; e++) for (let t = 0; t < 3; t++) {
|
|
272
273
|
let r = l ? l.getX(e * 3 + t) : e * 3 + t, i = `${Math.round(c.getX(r) * n)},${Math.round(c.getY(r) * n)},${Math.round(c.getZ(r) * n)}`, a = f.get(i);
|
|
273
274
|
a === void 0 ? f.set(i, e) : d.union(e, a);
|
|
274
275
|
}
|
|
275
|
-
let
|
|
276
|
+
let p = /* @__PURE__ */ new Map();
|
|
276
277
|
for (let e = 0; e < u; e++) {
|
|
277
|
-
let t = d.find(e), n =
|
|
278
|
-
n || (n = [],
|
|
278
|
+
let t = d.find(e), n = p.get(t);
|
|
279
|
+
n || (n = [], p.set(t, n)), n.push(e);
|
|
279
280
|
}
|
|
280
|
-
let h =
|
|
281
|
-
for (let t of
|
|
282
|
-
let n = new Uint32Array(t), r =
|
|
281
|
+
let h = V(e);
|
|
282
|
+
for (let t of p.values()) {
|
|
283
|
+
let n = new Uint32Array(t), r = U(s, n), i = r.boundingBox, c = [
|
|
283
284
|
i.min.x,
|
|
284
285
|
i.min.y,
|
|
285
286
|
i.min.z
|
|
@@ -310,11 +311,11 @@ function Ne(e, t = 1e-4) {
|
|
|
310
311
|
}
|
|
311
312
|
}), a;
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function Ne(e, t, n, r = []) {
|
|
314
315
|
e.updateMatrixWorld(!0);
|
|
315
|
-
let i = new
|
|
316
|
+
let i = new m.Matrix4().copy(e.matrixWorld).invert(), a = new m.Matrix4(), o = new Map(t.map((e) => [e.id, e])), s = /* @__PURE__ */ new Map(), c = (e) => {
|
|
316
317
|
let t = s.get(e);
|
|
317
|
-
return t || (t =
|
|
318
|
+
return t || (t = H(e.geometry, a.multiplyMatrices(i, e.matrixWorld)), s.set(e, t)), t;
|
|
318
319
|
}, l = /* @__PURE__ */ new Map(), u = [], d = [];
|
|
319
320
|
for (let e of n) {
|
|
320
321
|
let t = e.islandIds.map((e) => o.get(e)).filter((e) => !!e);
|
|
@@ -343,15 +344,15 @@ function z(e, t, n, r = []) {
|
|
|
343
344
|
(n[0] + r[0]) * .5,
|
|
344
345
|
(n[1] + r[1]) * .5,
|
|
345
346
|
(n[2] + r[2]) * .5
|
|
346
|
-
], s = new
|
|
347
|
+
], s = new m.Group();
|
|
347
348
|
s.name = e.nodeName, s.position.set(a[0], a[1], a[2]);
|
|
348
349
|
let d = 0;
|
|
349
350
|
for (let [t, n] of i) {
|
|
350
|
-
let r = new
|
|
351
|
+
let r = new m.Mesh(U(c(t), n, [
|
|
351
352
|
-a[0],
|
|
352
353
|
-a[1],
|
|
353
354
|
-a[2]
|
|
354
|
-
]),
|
|
355
|
+
]), V(t));
|
|
355
356
|
r.name = `${e.nodeName}_mesh_${d++}`, s.add(r);
|
|
356
357
|
}
|
|
357
358
|
u.push({
|
|
@@ -391,15 +392,15 @@ function z(e, t, n, r = []) {
|
|
|
391
392
|
Math.max(.05, r[0] - n[0]),
|
|
392
393
|
Math.max(.05, r[1] - n[1]),
|
|
393
394
|
Math.max(.05, r[2] - n[2])
|
|
394
|
-
], [u, f,
|
|
395
|
-
h.name = e.nodeName, h.position.set(u, f,
|
|
395
|
+
], [u, f, p] = e.anchor, h = new m.Group();
|
|
396
|
+
h.name = e.nodeName, h.position.set(u, f, p);
|
|
396
397
|
let g = 0;
|
|
397
398
|
for (let [t, n] of i) {
|
|
398
|
-
let r = new
|
|
399
|
+
let r = new m.Mesh(U(c(t), n, [
|
|
399
400
|
-u,
|
|
400
401
|
-f,
|
|
401
|
-
-
|
|
402
|
-
]),
|
|
402
|
+
-p
|
|
403
|
+
]), V(t));
|
|
403
404
|
r.name = `${e.nodeName}_skin_${g++}`, h.add(r);
|
|
404
405
|
}
|
|
405
406
|
d.push({
|
|
@@ -407,28 +408,28 @@ function z(e, t, n, r = []) {
|
|
|
407
408
|
anchor: [
|
|
408
409
|
u,
|
|
409
410
|
f,
|
|
410
|
-
|
|
411
|
+
p
|
|
411
412
|
],
|
|
412
413
|
center: a,
|
|
413
414
|
size: s,
|
|
414
415
|
group: h
|
|
415
416
|
});
|
|
416
417
|
}
|
|
417
|
-
let f = new
|
|
418
|
+
let f = new m.Group();
|
|
418
419
|
f.name = "ChassisVisuals";
|
|
419
|
-
let
|
|
420
|
+
let p = 0;
|
|
420
421
|
e.traverse((e) => {
|
|
421
|
-
if (!(e instanceof
|
|
422
|
+
if (!(e instanceof m.Mesh) || !e.geometry) return;
|
|
422
423
|
let t = c(e), n = t.getAttribute("position"), r = t.getIndex(), i = Math.floor(r ? r.count / 3 : (n?.count ?? 0) / 3), a = l.get(e);
|
|
423
424
|
if (i === 0 || a && a.size >= i) return;
|
|
424
425
|
let o = [];
|
|
425
426
|
for (let e = 0; e < i; e++) a && a.has(e) || o.push(e);
|
|
426
427
|
if (o.length > 0) {
|
|
427
|
-
let n = new
|
|
428
|
-
n.name = `Body_mesh_${
|
|
428
|
+
let n = new m.Mesh(U(t, o), V(e));
|
|
429
|
+
n.name = `Body_mesh_${p++}`, f.add(n);
|
|
429
430
|
}
|
|
430
431
|
});
|
|
431
|
-
let h = new
|
|
432
|
+
let h = new m.Box3().setFromObject(e), g = h.getSize(new m.Vector3()), _ = h.getCenter(new m.Vector3());
|
|
432
433
|
return {
|
|
433
434
|
wheels: u,
|
|
434
435
|
panels: d,
|
|
@@ -495,20 +496,20 @@ var Pe = [
|
|
|
495
496
|
color: "#38BDF8",
|
|
496
497
|
massKg: 12
|
|
497
498
|
}
|
|
498
|
-
],
|
|
499
|
-
function
|
|
500
|
-
let t =
|
|
499
|
+
], Fe = 2 ** 26, Ie = .65, Le = /* @__PURE__ */ new WeakMap(), Re = (e, t) => e < t ? e * Fe + t : t * Fe + e, ze = (e, t, n) => `${Math.round(e * 1e4)},${Math.round(t * 1e4)},${Math.round(n * 1e4)}`;
|
|
500
|
+
function Be(e) {
|
|
501
|
+
let t = Le.get(e.geometry);
|
|
501
502
|
if (t) return t;
|
|
502
|
-
let n =
|
|
503
|
-
return
|
|
503
|
+
let n = Ve(e.geometry);
|
|
504
|
+
return Le.set(e.geometry, n), n;
|
|
504
505
|
}
|
|
505
|
-
function
|
|
506
|
+
function Ve(e) {
|
|
506
507
|
let t = e.getAttribute("position"), n = e.getIndex(), r = t ? n ? n.count : t.count : 0, i = Math.floor(r / 3), a = new Uint32Array(i * 3), o = /* @__PURE__ */ new Map(), s = [];
|
|
507
508
|
for (let e = 0; e < i * 3; e++) {
|
|
508
|
-
let r = n ? n.getX(e) : e, i = t.getX(r), c = t.getY(r), l = t.getZ(r), u =
|
|
509
|
+
let r = n ? n.getX(e) : e, i = t.getX(r), c = t.getY(r), l = t.getZ(r), u = ze(i, c, l), d = o.get(u);
|
|
509
510
|
d === void 0 && (d = o.size, o.set(u, d), s.push(i, c, l)), a[e] = d;
|
|
510
511
|
}
|
|
511
|
-
let c = Float32Array.from(s), l = o.size, u = new Float32Array(i * 3), d = new Float32Array(i), f = /* @__PURE__ */ new Map(),
|
|
512
|
+
let c = Float32Array.from(s), l = o.size, u = new Float32Array(i * 3), d = new Float32Array(i), f = /* @__PURE__ */ new Map(), p = Array.from({ length: l }, () => /* @__PURE__ */ new Set()), h = new m.Vector3(), g = new m.Vector3(), _ = new m.Vector3(), v = new m.Vector3();
|
|
512
513
|
for (let e = 0; e < i; e++) {
|
|
513
514
|
let t = a[e * 3], n = a[e * 3 + 1], r = a[e * 3 + 2];
|
|
514
515
|
h.fromArray(c, t * 3), g.fromArray(c, n * 3), _.fromArray(c, r * 3), v.crossVectors(g.sub(h), _.sub(h));
|
|
@@ -520,8 +521,8 @@ function ze(e) {
|
|
|
520
521
|
[r, t]
|
|
521
522
|
]) {
|
|
522
523
|
if (i === a) continue;
|
|
523
|
-
let t =
|
|
524
|
-
n ? n.push(e) : f.set(t, [e]),
|
|
524
|
+
let t = Re(i, a), n = f.get(t);
|
|
525
|
+
n ? n.push(e) : f.set(t, [e]), p[i].add(a), p[a].add(i);
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
528
|
return {
|
|
@@ -533,10 +534,10 @@ function ze(e) {
|
|
|
533
534
|
normals: u,
|
|
534
535
|
areas: d,
|
|
535
536
|
edgeTriangles: f,
|
|
536
|
-
neighbors:
|
|
537
|
+
neighbors: p.map((e) => [...e])
|
|
537
538
|
};
|
|
538
539
|
}
|
|
539
|
-
function
|
|
540
|
+
function He(e, t, n) {
|
|
540
541
|
if (t < 0 || t >= e.triangleCount) return [];
|
|
541
542
|
let r = new Uint8Array(e.triangleCount), i = [t];
|
|
542
543
|
r[t] = 1;
|
|
@@ -545,17 +546,17 @@ function Be(e, t, n) {
|
|
|
545
546
|
for (let t = 0; t < 3; t++) {
|
|
546
547
|
let o = e.corners[a * 3 + t], s = e.corners[a * 3 + (t + 1) % 3];
|
|
547
548
|
if (o === s) continue;
|
|
548
|
-
let c =
|
|
549
|
+
let c = Re(o, s);
|
|
549
550
|
for (let t of e.edgeTriangles.get(c) ?? []) !r[t] && n(c, a, t) && (r[t] = 1, i.push(t));
|
|
550
551
|
}
|
|
551
552
|
}
|
|
552
553
|
return i.sort((e, t) => e - t);
|
|
553
554
|
}
|
|
554
|
-
function
|
|
555
|
+
function Ue(e, t, n = 32) {
|
|
555
556
|
let r = Math.cos(n * Math.PI / 180), i = e.normals;
|
|
556
|
-
return
|
|
557
|
+
return He(e, t, (e, t, n) => i[t * 3] * i[n * 3] + i[t * 3 + 1] * i[n * 3 + 1] + i[t * 3 + 2] * i[n * 3 + 2] >= r);
|
|
557
558
|
}
|
|
558
|
-
function
|
|
559
|
+
function We(e, t, n = .03) {
|
|
559
560
|
let r = Math.max(n, 1e-4), i = (e, t, n) => `${Math.floor(e / r)},${Math.floor(t / r)},${Math.floor(n / r)}`, a = /* @__PURE__ */ new Map(), o = new Float32Array(e.triangleCount * 3);
|
|
560
561
|
for (let t = 0; t < e.triangleCount; t++) {
|
|
561
562
|
let n = 0, r = 0, s = 0;
|
|
@@ -579,19 +580,19 @@ function He(e, t, n = .03) {
|
|
|
579
580
|
}
|
|
580
581
|
return [...c].sort((e, t) => e - t);
|
|
581
582
|
}
|
|
582
|
-
function
|
|
583
|
+
function Ge(e, t, n) {
|
|
583
584
|
let r = e.points;
|
|
584
585
|
return Math.hypot(r[t * 3] - r[n * 3], r[t * 3 + 1] - r[n * 3 + 1], r[t * 3 + 2] - r[n * 3 + 2]);
|
|
585
586
|
}
|
|
586
|
-
function
|
|
587
|
-
let r = e.edgeTriangles.get(
|
|
587
|
+
function Ke(e, t, n) {
|
|
588
|
+
let r = e.edgeTriangles.get(Re(t, n)), i = 1;
|
|
588
589
|
if (r && r.length === 2) {
|
|
589
590
|
let t = e.normals, n = r[0], a = r[1], o = t[n * 3] * t[a * 3] + t[n * 3 + 1] * t[a * 3 + 1] + t[n * 3 + 2] * t[a * 3 + 2];
|
|
590
591
|
i = Math.min(1, Math.acos(Math.max(-1, Math.min(1, o))) / (Math.PI / 2));
|
|
591
592
|
}
|
|
592
|
-
return
|
|
593
|
+
return Ge(e, t, n) * (1 - Ie * i);
|
|
593
594
|
}
|
|
594
|
-
function
|
|
595
|
+
function qe(e, t) {
|
|
595
596
|
let n = 0, r = Infinity;
|
|
596
597
|
for (let i = 0; i < e.vertexCount; i++) {
|
|
597
598
|
let a = (e.points[i * 3] - t[0]) ** 2 + (e.points[i * 3 + 1] - t[1]) ** 2 + (e.points[i * 3 + 2] - t[2]) ** 2;
|
|
@@ -599,7 +600,7 @@ function Ge(e, t) {
|
|
|
599
600
|
}
|
|
600
601
|
return n;
|
|
601
602
|
}
|
|
602
|
-
function
|
|
603
|
+
function Je(e, t, n, r, i = Ke) {
|
|
603
604
|
if (t === n) return [t];
|
|
604
605
|
let a = new Float64Array(e.vertexCount).fill(Infinity), o = new Int32Array(e.vertexCount).fill(-1), s = [[0, t]];
|
|
605
606
|
a[t] = 0;
|
|
@@ -639,7 +640,7 @@ function Ke(e, t, n, r, i = We) {
|
|
|
639
640
|
return u.reverse();
|
|
640
641
|
}
|
|
641
642
|
// src/importer/surfaceCutter.ts
|
|
642
|
-
function
|
|
643
|
+
function Ye(e, t) {
|
|
643
644
|
let n = 0, r = 0;
|
|
644
645
|
for (let i of t) {
|
|
645
646
|
let t = e.areas[i];
|
|
@@ -648,28 +649,28 @@ function qe(e, t) {
|
|
|
648
649
|
}
|
|
649
650
|
return r > 0 ? n / r : 0;
|
|
650
651
|
}
|
|
651
|
-
function
|
|
652
|
-
let r =
|
|
652
|
+
function Xe(e, t, n) {
|
|
653
|
+
let r = Be(e), i = [...new Set(t)].sort((e, t) => e - t), a = n && Math.abs(Ye(r, i)) > .08 ? We(r, i) : [];
|
|
653
654
|
return {
|
|
654
655
|
islandId: e.id,
|
|
655
656
|
triangles: i,
|
|
656
657
|
mirrored: a
|
|
657
658
|
};
|
|
658
659
|
}
|
|
659
|
-
function
|
|
660
|
-
let i =
|
|
660
|
+
function Ze(e, t, n, r) {
|
|
661
|
+
let i = Be(e), a = n === "crease" ? Ue(i, t, r.creaseDeg) : [t], o = r.current?.islandId === e.id ? new Set(r.current.triangles) : /* @__PURE__ */ new Set();
|
|
661
662
|
for (let e of a) r.remove ? o.delete(e) : o.add(e);
|
|
662
|
-
return
|
|
663
|
+
return Xe(e, [...o], r.mirrorX);
|
|
663
664
|
}
|
|
664
|
-
function
|
|
665
|
+
function Qe(e, t) {
|
|
665
666
|
if (t.length < 2) return t.map((e) => [
|
|
666
667
|
e[0],
|
|
667
668
|
e[1],
|
|
668
669
|
e[2]
|
|
669
670
|
]);
|
|
670
|
-
let n =
|
|
671
|
+
let n = Be(e), r = t.map((e) => qe(n, e)), i = [], a = t.length >= 3 ? r.length : r.length - 1;
|
|
671
672
|
for (let e = 0; e < a; e++) {
|
|
672
|
-
let o =
|
|
673
|
+
let o = Je(n, r[e], r[(e + 1) % r.length]) ?? [r[e], r[(e + 1) % r.length]];
|
|
673
674
|
for (let r of o.slice(0, e === a - 1 && t.length < 3 ? void 0 : -1)) i.push([
|
|
674
675
|
n.points[r * 3],
|
|
675
676
|
n.points[r * 3 + 1],
|
|
@@ -678,26 +679,26 @@ function Xe(e, t) {
|
|
|
678
679
|
}
|
|
679
680
|
return t.length >= 3 && i.length > 0 && i.push([...i[0]]), i;
|
|
680
681
|
}
|
|
681
|
-
function
|
|
682
|
+
function $e(e, t, n) {
|
|
682
683
|
if (t.length < 3) throw Error("Place at least 3 seam dots around the panel first.");
|
|
683
|
-
let r =
|
|
684
|
+
let r = Be(e), i = t.map((e) => qe(r, e));
|
|
684
685
|
if (new Set(i).size !== i.length) throw Error("Two dots snapped to the same vertex — spread dots apart or enable Split Coarse Edges.");
|
|
685
686
|
let a = [], o = /* @__PURE__ */ new Set();
|
|
686
687
|
for (let e = 0; e < i.length; e++) {
|
|
687
|
-
let t =
|
|
688
|
+
let t = Je(r, i[e], i[(e + 1) % i.length], o, n.exact ? Ge : Ke);
|
|
688
689
|
if (!t) throw Error(`No mesh edge path connects dot ${e + 1} to dot ${(e + 1) % i.length + 1}.`);
|
|
689
690
|
for (let e of t.slice(0, -1)) a.push(e), o.add(e);
|
|
690
691
|
}
|
|
691
692
|
let s = /* @__PURE__ */ new Set();
|
|
692
|
-
for (let e = 0; e < a.length; e++) s.add(
|
|
693
|
+
for (let e = 0; e < a.length; e++) s.add(Re(a[e], a[(e + 1) % a.length]));
|
|
693
694
|
let c = [...s].map((e) => r.edgeTriangles.get(e) ?? []).find((e) => e.length === 2);
|
|
694
695
|
if (!c) throw Error("Loop runs only along open mesh border — nothing enclosed to peel.");
|
|
695
|
-
let l =
|
|
696
|
+
let l = He(r, c[0], (e) => !s.has(e));
|
|
696
697
|
if (new Set(l).has(c[1])) throw Error("Loop didn't enclose an isolated patch — add another dot along the shutline.");
|
|
697
|
-
let u =
|
|
698
|
-
return
|
|
698
|
+
let u = He(r, c[1], (e) => !s.has(e)), d = (e) => e.reduce((e, t) => e + r.areas[t], 0);
|
|
699
|
+
return Xe(e, d(l) <= d(u) ? l : u, n.mirrorX);
|
|
699
700
|
}
|
|
700
|
-
function
|
|
701
|
+
function et(e, t, n = .28) {
|
|
701
702
|
let r = e.index ? e.toNonIndexed() : e.clone(), i = Object.keys(r.attributes), a = i.map((e) => r.getAttribute(e).itemSize), o = i.slice(0, i.indexOf("position")).reduce((e, t, n) => e + a[n], 0), s = r.getAttribute("position").count, c = (e) => {
|
|
702
703
|
let t = [];
|
|
703
704
|
return i.forEach((n, i) => {
|
|
@@ -710,22 +711,22 @@ function Qe(e, t, n = .28) {
|
|
|
710
711
|
c(e * 3 + 1),
|
|
711
712
|
c(e * 3 + 2)
|
|
712
713
|
]);
|
|
713
|
-
let u = l.length, d = (e) => new
|
|
714
|
+
let u = l.length, d = (e) => new m.Vector3(e[o], e[o + 1], e[o + 2]), f = (e, t, n) => e.map((e, r) => e + (t[r] - e) * n), p = Ve(r);
|
|
714
715
|
for (let e = 0; e < t.length; e++) {
|
|
715
|
-
let r = new
|
|
716
|
+
let r = new m.Vector3(...t[e]), i = new m.Vector3(...t[(e + 1) % t.length]), a = i.clone().sub(r), o = a.length();
|
|
716
717
|
if (o < 1e-7) continue;
|
|
717
718
|
a.divideScalar(o);
|
|
718
|
-
let s = r.clone().add(i).multiplyScalar(.5), c = new
|
|
719
|
-
for (let e = 0; e <
|
|
719
|
+
let s = r.clone().add(i).multiplyScalar(.5), c = new m.Vector3(), u = new m.Vector3();
|
|
720
|
+
for (let e = 0; e < p.triangleCount; e++) {
|
|
720
721
|
u.set(0, 0, 0);
|
|
721
|
-
for (let t = 0; t < 3; t++) u.add(new
|
|
722
|
-
u.multiplyScalar(1 / 3).distanceTo(s) <= Math.max(o, .25) && c.addScaledVector(new
|
|
722
|
+
for (let t = 0; t < 3; t++) u.add(new m.Vector3().fromArray(p.points, p.corners[e * 3 + t] * 3));
|
|
723
|
+
u.multiplyScalar(1 / 3).distanceTo(s) <= Math.max(o, .25) && c.addScaledVector(new m.Vector3().fromArray(p.normals, e * 3), p.areas[e]);
|
|
723
724
|
}
|
|
724
|
-
let h = c.lengthSq() > 0 ? c.normalize() : new
|
|
725
|
+
let h = c.lengthSq() > 0 ? c.normalize() : new m.Vector3(0, 1, 0), g = new m.Vector3().crossVectors(a, h);
|
|
725
726
|
if (g.lengthSq() < 1e-12) continue;
|
|
726
727
|
g.normalize();
|
|
727
728
|
let _ = (e) => g.dot(e) - g.dot(r), v = 1e-6, y = /* @__PURE__ */ new Map(), b = (e) => {
|
|
728
|
-
let t = d(e), n =
|
|
729
|
+
let t = d(e), n = ze(t.x, t.y, t.z), r = y.get(n);
|
|
729
730
|
return r === void 0 && (r = y.size, y.set(n, r)), r;
|
|
730
731
|
}, x = l.map((e) => {
|
|
731
732
|
let t = e.map((e) => _(d(e))), n = t.filter((e) => e > v).length, r = t.filter((e) => e < -1e-6).length;
|
|
@@ -745,8 +746,8 @@ function Qe(e, t, n = .28) {
|
|
|
745
746
|
c2: s,
|
|
746
747
|
p01: p,
|
|
747
748
|
p02: m,
|
|
748
|
-
k01: p ?
|
|
749
|
-
k02: m ?
|
|
749
|
+
k01: p ? Re(b(a), b(o)) : -1,
|
|
750
|
+
k02: m ? Re(b(a), b(s)) : -1,
|
|
750
751
|
chord: [p ?? o, m ?? s]
|
|
751
752
|
};
|
|
752
753
|
}), S = /* @__PURE__ */ new Set();
|
|
@@ -798,37 +799,37 @@ function Qe(e, t, n = .28) {
|
|
|
798
799
|
]);
|
|
799
800
|
}), l = C;
|
|
800
801
|
}
|
|
801
|
-
let h = new
|
|
802
|
+
let h = new m.BufferGeometry(), g = 0;
|
|
802
803
|
return i.forEach((e, t) => {
|
|
803
804
|
let n = a[t], i = new Float32Array(l.length * 3 * n);
|
|
804
805
|
l.forEach((e, t) => {
|
|
805
806
|
for (let r = 0; r < 3; r++) for (let a = 0; a < n; a++) i[(t * 3 + r) * n + a] = e[r][g + a];
|
|
806
|
-
}), h.setAttribute(e, new
|
|
807
|
+
}), h.setAttribute(e, new m.BufferAttribute(i, n, r.getAttribute(e).normalized)), g += n;
|
|
807
808
|
}), h.getAttribute("normal") || h.computeVertexNormals(), h.computeBoundingBox(), h.computeBoundingSphere(), {
|
|
808
809
|
geometry: h,
|
|
809
810
|
added: l.length - u
|
|
810
811
|
};
|
|
811
812
|
}
|
|
812
|
-
function
|
|
813
|
+
function tt(e, t, n) {
|
|
813
814
|
let r = e.mesh, i = r.parent;
|
|
814
815
|
if (!i) throw Error("Selected island mesh has no parent scene.");
|
|
815
|
-
let a = r.geometry, o = a.getAttribute("position"), s = a.getIndex(), c = o ? Math.floor((s ? s.count : o.count) / 3) : 0, l = (t) => t.map((t) => e.triangleIndices[t]), u = l(t.triangles), d = l(t.mirrored), f = /* @__PURE__ */ new Set([...u, ...d]),
|
|
816
|
+
let a = r.geometry, o = a.getAttribute("position"), s = a.getIndex(), c = o ? Math.floor((s ? s.count : o.count) / 3) : 0, l = (t) => t.map((t) => e.triangleIndices[t]), u = l(t.triangles), d = l(t.mirrored), f = /* @__PURE__ */ new Set([...u, ...d]), p = [], h = (e, t) => {
|
|
816
817
|
if (e.length === 0) return;
|
|
817
|
-
let n = new
|
|
818
|
-
n.name = t, n.position.copy(r.position), n.quaternion.copy(r.quaternion), n.scale.copy(r.scale), i.add(n),
|
|
818
|
+
let n = new m.Mesh(U(a, e), r.material);
|
|
819
|
+
n.name = t, n.position.copy(r.position), n.quaternion.copy(r.quaternion), n.scale.copy(r.scale), i.add(n), p.push(n);
|
|
819
820
|
};
|
|
820
821
|
h(u, n), h(d, `${n}_mirror`);
|
|
821
822
|
let g = [];
|
|
822
823
|
for (let e = 0; e < c; e++) f.has(e) || g.push(e);
|
|
823
|
-
return r.geometry = g.length > 0 ?
|
|
824
|
-
mintedMeshes:
|
|
824
|
+
return r.geometry = g.length > 0 ? U(a, g) : new m.BufferGeometry(), {
|
|
825
|
+
mintedMeshes: p,
|
|
825
826
|
undo: () => {
|
|
826
827
|
r.geometry = a;
|
|
827
|
-
for (let e of
|
|
828
|
+
for (let e of p) e.removeFromParent(), e.geometry.dispose();
|
|
828
829
|
}
|
|
829
830
|
};
|
|
830
831
|
}
|
|
831
|
-
function
|
|
832
|
+
function nt(e, t) {
|
|
832
833
|
let n = (e) => `${e.mesh.uuid}|${e.triangleIndices.length}|${e.center.map((e) => e.toFixed(4)).join(",")}`, r = /* @__PURE__ */ new Map();
|
|
833
834
|
for (let e of t) {
|
|
834
835
|
let t = n(e), i = r.get(t);
|
|
@@ -838,7 +839,7 @@ function et(e, t) {
|
|
|
838
839
|
for (let t of e) i.set(t.id, r.get(n(t))?.shift() ?? null);
|
|
839
840
|
return i;
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
+
function rt(e, t, n) {
|
|
842
843
|
let r = e.find((e) => e.id === t);
|
|
843
844
|
if (!r || Math.abs(r.center[0]) <= .08) return null;
|
|
844
845
|
let i = Math.max(...r.size, .15), a = null, o = .55;
|
|
@@ -849,38 +850,38 @@ function tt(e, t, n) {
|
|
|
849
850
|
}
|
|
850
851
|
return a;
|
|
851
852
|
}
|
|
852
|
-
function
|
|
853
|
-
let r =
|
|
853
|
+
function it(e, t, n = .004) {
|
|
854
|
+
let r = U(e, t), i = r.getAttribute("position"), a = r.getAttribute("normal");
|
|
854
855
|
if (i && a) {
|
|
855
856
|
for (let e = 0; e < i.count; e++) i.setXYZ(e, i.getX(e) + a.getX(e) * n, i.getY(e) + a.getY(e) * n, i.getZ(e) + a.getZ(e) * n);
|
|
856
857
|
i.needsUpdate = !0;
|
|
857
858
|
}
|
|
858
859
|
return r;
|
|
859
860
|
}
|
|
860
|
-
function
|
|
861
|
-
let r = new
|
|
861
|
+
function at(e, t, n = "Wheel_12gon") {
|
|
862
|
+
let r = new m.Group();
|
|
862
863
|
r.name = n;
|
|
863
|
-
let i = new
|
|
864
|
+
let i = new m.CylinderGeometry(e, e, t, 12, 1);
|
|
864
865
|
i.rotateZ(Math.PI * .5);
|
|
865
|
-
let a = new
|
|
866
|
+
let a = new m.CylinderGeometry(e * .62, e * .62, t * 1.04, 12, 1);
|
|
866
867
|
a.rotateZ(Math.PI * .5);
|
|
867
|
-
let o = new
|
|
868
|
+
let o = new m.CylinderGeometry(e * .22, e * .22, t * 1.1, 6, 1);
|
|
868
869
|
o.rotateZ(Math.PI * .5);
|
|
869
|
-
let s = new
|
|
870
|
+
let s = new m.Mesh(i, new m.MeshStandardMaterial({
|
|
870
871
|
color: "#1b2028",
|
|
871
872
|
roughness: .92,
|
|
872
873
|
metalness: .05,
|
|
873
874
|
flatShading: !0
|
|
874
875
|
}));
|
|
875
876
|
s.name = `${n}_tire`;
|
|
876
|
-
let c = new
|
|
877
|
+
let c = new m.Mesh(a, new m.MeshStandardMaterial({
|
|
877
878
|
color: "#cbd5e1",
|
|
878
879
|
roughness: .36,
|
|
879
880
|
metalness: .72,
|
|
880
881
|
flatShading: !0
|
|
881
882
|
}));
|
|
882
883
|
c.name = `${n}_rim`;
|
|
883
|
-
let l = new
|
|
884
|
+
let l = new m.Mesh(o, new m.MeshStandardMaterial({
|
|
884
885
|
color: "#f59e0b",
|
|
885
886
|
roughness: .45,
|
|
886
887
|
metalness: .6,
|
|
@@ -889,21 +890,21 @@ function rt(e, t, n = "Wheel_12gon") {
|
|
|
889
890
|
return l.name = `${n}_hub`, r.add(s, c, l), r;
|
|
890
891
|
}
|
|
891
892
|
// src/importer/khrCompiler.ts
|
|
892
|
-
var
|
|
893
|
+
var ot = [
|
|
893
894
|
"map",
|
|
894
895
|
"normalMap",
|
|
895
896
|
"roughnessMap",
|
|
896
897
|
"metalnessMap",
|
|
897
898
|
"aoMap",
|
|
898
899
|
"emissiveMap"
|
|
899
|
-
],
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
900
|
+
], W = (e) => Number(e.toFixed(4)), st = (e, t, n, r) => [
|
|
901
|
+
W(e / 12 * (n * n + r * r)),
|
|
902
|
+
W(e / 12 * (t * t + r * r)),
|
|
903
|
+
W(e / 12 * (t * t + n * n))
|
|
903
904
|
];
|
|
904
|
-
function
|
|
905
|
+
function ct(e, n, r) {
|
|
905
906
|
if (!n) return [];
|
|
906
|
-
let i = new Map(
|
|
907
|
+
let i = new Map(e.map((e) => [e.id, e])), a = (e) => Object.entries(n).filter(([t, n]) => n === e && !r.has(Number(t)) && i.has(Number(t))).map(([e]) => Number(e)), o = [], s = (e) => Pe.find((t) => t.role === e)?.massKg ?? 16;
|
|
907
908
|
for (let n of [1, -1]) {
|
|
908
909
|
let r = a("door").filter((e) => (i.get(e).center[0] >= 0 ? 1 : -1) === n);
|
|
909
910
|
if (r.length === 0) continue;
|
|
@@ -915,7 +916,7 @@ function ot(t, n, r) {
|
|
|
915
916
|
role: `door_${a.toLowerCase()}`,
|
|
916
917
|
islandIds: r,
|
|
917
918
|
massKg: s("door"),
|
|
918
|
-
hinge:
|
|
919
|
+
hinge: t(R(e, r), "door")
|
|
919
920
|
});
|
|
920
921
|
});
|
|
921
922
|
}
|
|
@@ -926,7 +927,7 @@ function ot(t, n, r) {
|
|
|
926
927
|
role: n,
|
|
927
928
|
islandIds: r,
|
|
928
929
|
massKg: s(n),
|
|
929
|
-
hinge:
|
|
930
|
+
hinge: t(R(e, r), n)
|
|
930
931
|
});
|
|
931
932
|
}
|
|
932
933
|
for (let n of ["fender", "bumper"]) a(n).forEach((r, i) => {
|
|
@@ -935,20 +936,20 @@ function ot(t, n, r) {
|
|
|
935
936
|
role: n,
|
|
936
937
|
islandIds: [r],
|
|
937
938
|
massKg: s(n),
|
|
938
|
-
hinge:
|
|
939
|
+
hinge: t(R(e, [r]), n)
|
|
939
940
|
});
|
|
940
941
|
});
|
|
941
942
|
return o;
|
|
942
943
|
}
|
|
943
|
-
function
|
|
944
|
+
function lt(e, t, n, r, i) {
|
|
944
945
|
let a = t.filter((e) => e.left.length > 0);
|
|
945
946
|
if (a.length > 0) {
|
|
946
947
|
let t = a.map((t) => ({
|
|
947
948
|
a: t,
|
|
948
|
-
z:
|
|
949
|
+
z: R(e, [...t.left, ...t.right]).center[2]
|
|
949
950
|
})).sort((e, t) => t.z - e.z), i = t.length, o = [];
|
|
950
951
|
return t.forEach(({ a: t }, a) => {
|
|
951
|
-
let s =
|
|
952
|
+
let s = R(e, t.left), c = t.right.length > 0 ? R(e, t.right) : s, l = Math.max(.12, s.radius, c.radius), u = Math.max(.09, Math.max(s.halfWidth, c.halfWidth) * 2), d = n === "motorcycle" ? a > 0 : r === "AWD" || i === 1 ? !0 : r === "FWD" ? a === 0 : a > 0, f = t.steered ?? a === 0, p = t.driven ?? d, m = t.brake ?? !0, h = i === 2 ? a === 0 ? "F" : "R" : `A${a}`;
|
|
952
953
|
t.right.length === 0 ? o.push({
|
|
953
954
|
nodeName: `Wheel_${h}C`,
|
|
954
955
|
islandIds: [...t.left],
|
|
@@ -1067,40 +1068,40 @@ function st(e, t, n, r, i) {
|
|
|
1067
1068
|
}
|
|
1068
1069
|
];
|
|
1069
1070
|
}
|
|
1070
|
-
async function
|
|
1071
|
+
async function ut(e, t) {
|
|
1071
1072
|
e.updateMatrixWorld(!0);
|
|
1072
|
-
let r = new
|
|
1073
|
-
u.name =
|
|
1073
|
+
let r = new m.Box3().setFromObject(e), i = r.getSize(new m.Vector3()), a = r.getCenter(new m.Vector3()), o = Math.max(.25, i.x), s = Math.max(.25, i.y), c = Math.max(.25, i.z), l = Math.max(5, t.massKg || 1e3), u = new m.Group();
|
|
1074
|
+
u.name = t.name || e.name || `Kolmo_${t.archetype}`;
|
|
1074
1075
|
let d = [], f;
|
|
1075
|
-
if (
|
|
1076
|
-
let
|
|
1076
|
+
if (t.archetype === "car" || t.archetype === "motorcycle") {
|
|
1077
|
+
let n = t.islands ?? Me(e), i = t.axles ?? (t.archetype === "motorcycle" ? ke(n) : Oe(n)), p = t.driveType ?? (t.archetype === "motorcycle" ? "RWD" : "AWD"), h = lt(n, i, t.archetype, p, [
|
|
1077
1078
|
o,
|
|
1078
1079
|
s,
|
|
1079
1080
|
c
|
|
1080
|
-
]), g =
|
|
1081
|
+
]), g = ct(n, t.partPicks, new Set(h.flatMap((e) => e.islandIds))), _ = Ne(e, n, h.filter((e) => e.islandIds.length > 0), g.map((e) => ({
|
|
1081
1082
|
nodeName: e.nodeName,
|
|
1082
1083
|
islandIds: e.islandIds,
|
|
1083
1084
|
anchor: e.hinge.anchor
|
|
1084
|
-
}))), v = new
|
|
1085
|
+
}))), v = new m.Group();
|
|
1085
1086
|
v.name = "Chassis", v.add(_.chassisGroup), u.add(v);
|
|
1086
1087
|
for (let e of h) {
|
|
1087
|
-
let
|
|
1088
|
+
let n = _.wheels.find((t) => t.nodeName === e.nodeName), r = n?.center ?? e.fallbackPos ?? [
|
|
1088
1089
|
0,
|
|
1089
1090
|
e.radius,
|
|
1090
1091
|
0
|
|
1091
1092
|
];
|
|
1092
|
-
if (
|
|
1093
|
-
let t =
|
|
1093
|
+
if (t.wheelSource === "fleet12" || !n) {
|
|
1094
|
+
let t = at(e.radius, e.width, e.nodeName);
|
|
1094
1095
|
t.position.set(r[0], r[1], r[2]), u.add(t);
|
|
1095
|
-
} else u.add(
|
|
1096
|
+
} else u.add(n.group);
|
|
1096
1097
|
}
|
|
1097
1098
|
let y = Math.max(...h.map((e) => e.radius)), b = Math.max(.08, Math.min(.3, y * .68)), x = b * .4, S = Math.min(r.max.y - .2, Math.max(y * 1.15, b - x + .16)), C = Math.max(S + .26, r.max.y * .92), w = [
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
], T = new
|
|
1102
|
-
T.name = "Chassis_Hull", T.position.set(
|
|
1103
|
-
let E =
|
|
1099
|
+
W(Math.max(t.archetype === "motorcycle" ? .26 : .45, o * (t.archetype === "motorcycle" ? .55 : .92))),
|
|
1100
|
+
W(Math.max(.26, C - S)),
|
|
1101
|
+
W(Math.max(.55, c * .92))
|
|
1102
|
+
], T = new m.Object3D();
|
|
1103
|
+
T.name = "Chassis_Hull", T.position.set(W(a.x), W((S + C) * .5), W(a.z)), v.add(T);
|
|
1104
|
+
let E = t.archetype === "motorcycle" ? Math.max(y * .95, s * .32) : Math.min(C, Math.max(y + .14, s * .36)), D = h.map((e) => _.wheels.find((t) => t.nodeName === e.nodeName)?.center[2] ?? e.fallbackPos?.[2] ?? 0), O = D.reduce((e, t) => e + t, 0) / Math.max(1, D.length), k = Math.max(80, l - g.reduce((e, t) => e + t.massKg, 0)), A = se.streetDrift90s, j = ce(A.muPeakLng, .82);
|
|
1104
1105
|
d = [{
|
|
1105
1106
|
nodeName: "Chassis",
|
|
1106
1107
|
motion: {
|
|
@@ -1108,10 +1109,10 @@ async function ct(e, n) {
|
|
|
1108
1109
|
mass: k,
|
|
1109
1110
|
centerOfMass: [
|
|
1110
1111
|
0,
|
|
1111
|
-
|
|
1112
|
-
|
|
1112
|
+
W(E),
|
|
1113
|
+
W(O)
|
|
1113
1114
|
],
|
|
1114
|
-
inertiaDiagonal:
|
|
1115
|
+
inertiaDiagonal: st(k, o, Math.max(.45, s - y * .5), c)
|
|
1115
1116
|
},
|
|
1116
1117
|
extras: { role: "chassis" }
|
|
1117
1118
|
}, {
|
|
@@ -1130,19 +1131,19 @@ async function ct(e, n) {
|
|
|
1130
1131
|
if (!t) continue;
|
|
1131
1132
|
v.add(t.group);
|
|
1132
1133
|
let n = [
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
], r = new
|
|
1134
|
+
W(t.center[0] - t.anchor[0]),
|
|
1135
|
+
W(t.center[1] - t.anchor[1]),
|
|
1136
|
+
W(t.center[2] - t.anchor[2])
|
|
1137
|
+
], r = new m.Object3D();
|
|
1137
1138
|
r.name = `${e.nodeName}_Panel`, r.position.set(n[0], n[1], n[2]), t.group.add(r), d.push({
|
|
1138
1139
|
nodeName: r.name,
|
|
1139
1140
|
collider: {
|
|
1140
1141
|
shape: {
|
|
1141
1142
|
type: "box",
|
|
1142
1143
|
size: [
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1144
|
+
W(t.size[0]),
|
|
1145
|
+
W(t.size[1]),
|
|
1146
|
+
W(t.size[2])
|
|
1146
1147
|
]
|
|
1147
1148
|
},
|
|
1148
1149
|
friction: .45
|
|
@@ -1153,7 +1154,7 @@ async function ct(e, n) {
|
|
|
1153
1154
|
isKinematic: !1,
|
|
1154
1155
|
mass: e.massKg,
|
|
1155
1156
|
centerOfMass: n,
|
|
1156
|
-
inertiaDiagonal:
|
|
1157
|
+
inertiaDiagonal: st(e.massKg, t.size[0], t.size[1], t.size[2])
|
|
1157
1158
|
},
|
|
1158
1159
|
joint: {
|
|
1159
1160
|
connectedNodeName: "Chassis",
|
|
@@ -1171,12 +1172,12 @@ async function ct(e, n) {
|
|
|
1171
1172
|
});
|
|
1172
1173
|
}
|
|
1173
1174
|
for (let e of h) {
|
|
1174
|
-
let t =
|
|
1175
|
+
let t = W(Math.max(.08, Math.min(.3, e.radius * .68))), n = W(t * .4);
|
|
1175
1176
|
d.push({
|
|
1176
1177
|
nodeName: e.nodeName,
|
|
1177
1178
|
extras: { ecctrlWheel: {
|
|
1178
|
-
radius:
|
|
1179
|
-
width:
|
|
1179
|
+
radius: W(e.radius),
|
|
1180
|
+
width: W(e.width),
|
|
1180
1181
|
travel: t,
|
|
1181
1182
|
sag: n,
|
|
1182
1183
|
steer: e.steered,
|
|
@@ -1191,8 +1192,8 @@ async function ct(e, n) {
|
|
|
1191
1192
|
} }
|
|
1192
1193
|
});
|
|
1193
1194
|
}
|
|
1194
|
-
let ee = Math.max(25,
|
|
1195
|
-
f = { tune:
|
|
1195
|
+
let ee = Math.max(25, t.powerOrThrust || (t.archetype === "motorcycle" ? 165 : 280));
|
|
1196
|
+
f = { tune: t.archetype === "motorcycle" ? {
|
|
1196
1197
|
engineHorsepower: ee,
|
|
1197
1198
|
engineMaxRPM: 13500,
|
|
1198
1199
|
gearRatios: [
|
|
@@ -1212,7 +1213,7 @@ async function ct(e, n) {
|
|
|
1212
1213
|
maxLeanAngle: .78,
|
|
1213
1214
|
leanOmega: 10,
|
|
1214
1215
|
leanDampingRatio: .85,
|
|
1215
|
-
engineTorqueCurveData:
|
|
1216
|
+
engineTorqueCurveData: ae.naScreamer
|
|
1216
1217
|
} : {
|
|
1217
1218
|
engineHorsepower: ee,
|
|
1218
1219
|
engineMaxRPM: 7e3,
|
|
@@ -1228,14 +1229,14 @@ async function ct(e, n) {
|
|
|
1228
1229
|
maxSteerAngle: .55,
|
|
1229
1230
|
rollCenterHeight: .12,
|
|
1230
1231
|
antiRollStiffness: 14e3,
|
|
1231
|
-
engineTorqueCurveData:
|
|
1232
|
-
steerAngleCurveData:
|
|
1232
|
+
engineTorqueCurveData: ae.naScreamer,
|
|
1233
|
+
steerAngleCurveData: oe.driftCountersteer
|
|
1233
1234
|
} };
|
|
1234
|
-
} else if (
|
|
1235
|
+
} else if (t.archetype === "starcraft") {
|
|
1235
1236
|
for (let t of e.clone(!0).children) u.add(t);
|
|
1236
|
-
let
|
|
1237
|
-
|
|
1238
|
-
let r = Math.max(400,
|
|
1237
|
+
let n = new m.Object3D();
|
|
1238
|
+
n.name = "HullBody", n.position.set(a.x, a.y, a.z), u.add(n);
|
|
1239
|
+
let r = Math.max(400, t.powerOrThrust || 4500, Math.ceil(l * 9.81 * .72));
|
|
1239
1240
|
d = [{
|
|
1240
1241
|
nodeName: "HullBody",
|
|
1241
1242
|
motion: {
|
|
@@ -1243,18 +1244,18 @@ async function ct(e, n) {
|
|
|
1243
1244
|
mass: l,
|
|
1244
1245
|
centerOfMass: [
|
|
1245
1246
|
0,
|
|
1246
|
-
|
|
1247
|
+
W(-s * .06),
|
|
1247
1248
|
0
|
|
1248
1249
|
],
|
|
1249
|
-
inertiaDiagonal:
|
|
1250
|
+
inertiaDiagonal: st(l, o, s, c)
|
|
1250
1251
|
},
|
|
1251
1252
|
collider: {
|
|
1252
1253
|
shape: {
|
|
1253
1254
|
type: "box",
|
|
1254
1255
|
size: [
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1256
|
+
W(o * .86),
|
|
1257
|
+
W(s * .78),
|
|
1258
|
+
W(c * .9)
|
|
1258
1259
|
]
|
|
1259
1260
|
},
|
|
1260
1261
|
friction: .35,
|
|
@@ -1287,7 +1288,7 @@ async function ct(e, n) {
|
|
|
1287
1288
|
!1
|
|
1288
1289
|
]
|
|
1289
1290
|
]) {
|
|
1290
|
-
let o = new
|
|
1291
|
+
let o = new m.Object3D();
|
|
1291
1292
|
o.name = e, o.position.set(a.x + t, a.y, a.z + n), u.add(o), d.push({
|
|
1292
1293
|
nodeName: e,
|
|
1293
1294
|
extras: { ecctrlPropeller: {
|
|
@@ -1306,23 +1307,23 @@ async function ct(e, n) {
|
|
|
1306
1307
|
airDragFactor: .18
|
|
1307
1308
|
} };
|
|
1308
1309
|
} else {
|
|
1309
|
-
let
|
|
1310
|
-
|
|
1310
|
+
let n = new m.Group();
|
|
1311
|
+
n.name = "PropBody";
|
|
1311
1312
|
let r = !1;
|
|
1312
|
-
for (let
|
|
1313
|
-
e instanceof
|
|
1313
|
+
for (let t of e.clone(!0).children) n.add(t), t.traverse((e) => {
|
|
1314
|
+
e instanceof m.Mesh && (e.geometry?.getAttribute("position")?.count ?? 0) >= 3 && (r = !0);
|
|
1314
1315
|
});
|
|
1315
|
-
u.add(
|
|
1316
|
+
u.add(n), d = [{
|
|
1316
1317
|
nodeName: "PropBody",
|
|
1317
|
-
motion:
|
|
1318
|
+
motion: t.staticProp ? { isKinematic: !0 } : {
|
|
1318
1319
|
isKinematic: !1,
|
|
1319
1320
|
mass: l,
|
|
1320
1321
|
centerOfMass: [
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1322
|
+
W(a.x),
|
|
1323
|
+
W(a.y),
|
|
1324
|
+
W(a.z)
|
|
1324
1325
|
],
|
|
1325
|
-
inertiaDiagonal:
|
|
1326
|
+
inertiaDiagonal: st(l, o, s, c)
|
|
1326
1327
|
},
|
|
1327
1328
|
collider: r ? {
|
|
1328
1329
|
meshNodeName: "PropBody",
|
|
@@ -1333,9 +1334,9 @@ async function ct(e, n) {
|
|
|
1333
1334
|
shape: {
|
|
1334
1335
|
type: "box",
|
|
1335
1336
|
size: [
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1337
|
+
W(o),
|
|
1338
|
+
W(s),
|
|
1339
|
+
W(c)
|
|
1339
1340
|
]
|
|
1340
1341
|
},
|
|
1341
1342
|
friction: .6,
|
|
@@ -1343,13 +1344,13 @@ async function ct(e, n) {
|
|
|
1343
1344
|
}
|
|
1344
1345
|
}];
|
|
1345
1346
|
}
|
|
1346
|
-
let
|
|
1347
|
+
let p = [];
|
|
1347
1348
|
u.traverse((e) => {
|
|
1348
|
-
if (!(e instanceof
|
|
1349
|
+
if (!(e instanceof m.Mesh) || !e.material) return;
|
|
1349
1350
|
let t = e.material;
|
|
1350
|
-
for (let e of
|
|
1351
|
+
for (let e of ot) {
|
|
1351
1352
|
let n = t[e];
|
|
1352
|
-
n && !n.image && (
|
|
1353
|
+
n && !n.image && (p.push({
|
|
1353
1354
|
rec: t,
|
|
1354
1355
|
slot: e,
|
|
1355
1356
|
tex: n
|
|
@@ -1358,15 +1359,15 @@ async function ct(e, n) {
|
|
|
1358
1359
|
});
|
|
1359
1360
|
let h;
|
|
1360
1361
|
try {
|
|
1361
|
-
h = new Uint8Array(await
|
|
1362
|
+
h = new Uint8Array(await T(u, d, f));
|
|
1362
1363
|
} finally {
|
|
1363
|
-
for (let e of
|
|
1364
|
+
for (let e of p) e.rec[e.slot] = e.tex;
|
|
1364
1365
|
}
|
|
1365
|
-
let g =
|
|
1366
|
+
let g = n(h, t.patches ?? []);
|
|
1366
1367
|
return g instanceof Uint8Array ? g : new Uint8Array(g);
|
|
1367
1368
|
}
|
|
1368
1369
|
// src/importer/ChopShopPanel.tsx
|
|
1369
|
-
var
|
|
1370
|
+
var dt = [
|
|
1370
1371
|
{
|
|
1371
1372
|
mode: "island",
|
|
1372
1373
|
label: "1 · Bucket",
|
|
@@ -1387,7 +1388,7 @@ var lt = [
|
|
|
1387
1388
|
label: "4 · Brush",
|
|
1388
1389
|
hint: "Click or drag to paint faces. Alt / Right-click erases."
|
|
1389
1390
|
}
|
|
1390
|
-
],
|
|
1391
|
+
], ft = {
|
|
1391
1392
|
position: "absolute",
|
|
1392
1393
|
top: 52,
|
|
1393
1394
|
right: 10,
|
|
@@ -1405,15 +1406,15 @@ var lt = [
|
|
|
1405
1406
|
overflowY: "auto",
|
|
1406
1407
|
zIndex: 18,
|
|
1407
1408
|
backdropFilter: "blur(6px)"
|
|
1408
|
-
},
|
|
1409
|
+
}, pt = {
|
|
1409
1410
|
border: "1px solid #1E293B",
|
|
1410
1411
|
borderRadius: 4,
|
|
1411
1412
|
padding: "7px 8px",
|
|
1412
1413
|
display: "grid",
|
|
1413
1414
|
gap: 6
|
|
1414
1415
|
};
|
|
1415
|
-
function
|
|
1416
|
-
return /* @__PURE__ */
|
|
1416
|
+
function G({ label: e, active: t = !1, disabled: n = !1, color: r = "#FFB000", onClick: i }) {
|
|
1417
|
+
return /* @__PURE__ */ k("button", {
|
|
1417
1418
|
type: "button",
|
|
1418
1419
|
disabled: n,
|
|
1419
1420
|
onClick: i,
|
|
@@ -1432,19 +1433,19 @@ function U({ label: e, active: t = !1, disabled: n = !1, color: r = "#FFB000", o
|
|
|
1432
1433
|
children: e
|
|
1433
1434
|
});
|
|
1434
1435
|
}
|
|
1435
|
-
function
|
|
1436
|
+
function mt(e) {
|
|
1436
1437
|
let t = Pe.find((t) => t.role === e.activeRole) ?? Pe[0], n = (t) => t === "wheel" ? e.wheelCount : Object.values(e.partPicks).filter((e) => e === t).length, r = Object.keys(e.partPicks).length;
|
|
1437
|
-
return /* @__PURE__ */
|
|
1438
|
-
style:
|
|
1438
|
+
return /* @__PURE__ */ A("aside", {
|
|
1439
|
+
style: ft,
|
|
1439
1440
|
"aria-label": "Car Chop-Shop",
|
|
1440
1441
|
children: [
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ A("div", {
|
|
1442
1443
|
style: {
|
|
1443
1444
|
display: "flex",
|
|
1444
1445
|
justifyContent: "space-between",
|
|
1445
1446
|
alignItems: "center"
|
|
1446
1447
|
},
|
|
1447
|
-
children: [/* @__PURE__ */
|
|
1448
|
+
children: [/* @__PURE__ */ k("span", {
|
|
1448
1449
|
style: {
|
|
1449
1450
|
fontSize: 11.5,
|
|
1450
1451
|
fontWeight: 800,
|
|
@@ -1452,7 +1453,7 @@ function ft(e) {
|
|
|
1452
1453
|
letterSpacing: "0.05em"
|
|
1453
1454
|
},
|
|
1454
1455
|
children: "CHOP-SHOP · CUT & HINGE"
|
|
1455
|
-
}), /* @__PURE__ */
|
|
1456
|
+
}), /* @__PURE__ */ k("span", {
|
|
1456
1457
|
style: {
|
|
1457
1458
|
fontSize: 10,
|
|
1458
1459
|
color: "#38BDF8"
|
|
@@ -1460,23 +1461,23 @@ function ft(e) {
|
|
|
1460
1461
|
children: `${e.wheelCount}W · ${r}P`
|
|
1461
1462
|
})]
|
|
1462
1463
|
}),
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
style:
|
|
1465
|
-
children: [/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ A("div", {
|
|
1465
|
+
style: pt,
|
|
1466
|
+
children: [/* @__PURE__ */ A("div", {
|
|
1466
1467
|
style: {
|
|
1467
1468
|
display: "flex",
|
|
1468
1469
|
justifyContent: "space-between",
|
|
1469
1470
|
fontSize: 10.5,
|
|
1470
1471
|
color: "#94A3B8"
|
|
1471
1472
|
},
|
|
1472
|
-
children: [/* @__PURE__ */
|
|
1473
|
+
children: [/* @__PURE__ */ k("span", { children: "LENGTH (+Z SI)" }), /* @__PURE__ */ k("span", {
|
|
1473
1474
|
style: {
|
|
1474
1475
|
color: "#00E5FF",
|
|
1475
1476
|
fontWeight: 700
|
|
1476
1477
|
},
|
|
1477
1478
|
children: `${e.targetMeters.toFixed(2)} m`
|
|
1478
1479
|
})]
|
|
1479
|
-
}), /* @__PURE__ */
|
|
1480
|
+
}), /* @__PURE__ */ k("input", {
|
|
1480
1481
|
type: "range",
|
|
1481
1482
|
min: 1.6,
|
|
1482
1483
|
max: 7.5,
|
|
@@ -1489,16 +1490,16 @@ function ft(e) {
|
|
|
1489
1490
|
}
|
|
1490
1491
|
})]
|
|
1491
1492
|
}),
|
|
1492
|
-
/* @__PURE__ */
|
|
1493
|
-
style:
|
|
1494
|
-
children: [/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ A("div", {
|
|
1494
|
+
style: pt,
|
|
1495
|
+
children: [/* @__PURE__ */ k("span", {
|
|
1495
1496
|
style: {
|
|
1496
1497
|
fontSize: 10,
|
|
1497
1498
|
color: "#94A3B8",
|
|
1498
1499
|
letterSpacing: "0.06em"
|
|
1499
1500
|
},
|
|
1500
1501
|
children: "1. PICK PART ROLE TO TAG OR CUT"
|
|
1501
|
-
}), /* @__PURE__ */
|
|
1502
|
+
}), /* @__PURE__ */ k("div", {
|
|
1502
1503
|
style: {
|
|
1503
1504
|
display: "grid",
|
|
1504
1505
|
gridTemplateColumns: "1fr 1fr",
|
|
@@ -1506,7 +1507,7 @@ function ft(e) {
|
|
|
1506
1507
|
},
|
|
1507
1508
|
children: Pe.map((t) => {
|
|
1508
1509
|
let r = n(t.role);
|
|
1509
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ k(G, {
|
|
1510
1511
|
active: e.activeRole === t.role,
|
|
1511
1512
|
color: t.color,
|
|
1512
1513
|
label: `${t.label}${r > 0 ? ` (${r})` : ""}`,
|
|
@@ -1515,10 +1516,10 @@ function ft(e) {
|
|
|
1515
1516
|
})
|
|
1516
1517
|
})]
|
|
1517
1518
|
}),
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
style:
|
|
1519
|
+
/* @__PURE__ */ A("div", {
|
|
1520
|
+
style: pt,
|
|
1520
1521
|
children: [
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ k("span", {
|
|
1522
1523
|
style: {
|
|
1523
1524
|
fontSize: 10,
|
|
1524
1525
|
color: "#94A3B8",
|
|
@@ -1526,28 +1527,28 @@ function ft(e) {
|
|
|
1526
1527
|
},
|
|
1527
1528
|
children: "2. SURFACE CUTTER (FUSED MESHES)"
|
|
1528
1529
|
}),
|
|
1529
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ k("div", {
|
|
1530
1531
|
style: {
|
|
1531
1532
|
display: "grid",
|
|
1532
1533
|
gridTemplateColumns: "1fr 1fr",
|
|
1533
1534
|
gap: 5
|
|
1534
1535
|
},
|
|
1535
|
-
children:
|
|
1536
|
+
children: dt.map((t) => /* @__PURE__ */ k(G, {
|
|
1536
1537
|
label: t.label,
|
|
1537
1538
|
active: e.surfaceMode === t.mode,
|
|
1538
1539
|
color: "#00E5FF",
|
|
1539
1540
|
onClick: () => e.onChangeSurfaceMode(t.mode)
|
|
1540
1541
|
}, t.mode))
|
|
1541
1542
|
}),
|
|
1542
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ k("div", {
|
|
1543
1544
|
style: {
|
|
1544
1545
|
fontSize: 10,
|
|
1545
1546
|
color: "#94A3B8",
|
|
1546
1547
|
lineHeight: 1.35
|
|
1547
1548
|
},
|
|
1548
|
-
children:
|
|
1549
|
+
children: dt.find((t) => t.mode === e.surfaceMode)?.hint
|
|
1549
1550
|
}),
|
|
1550
|
-
e.surfaceMode === "crease" && /* @__PURE__ */
|
|
1551
|
+
e.surfaceMode === "crease" && /* @__PURE__ */ A("label", {
|
|
1551
1552
|
style: {
|
|
1552
1553
|
display: "grid",
|
|
1553
1554
|
gridTemplateColumns: "72px 1fr 36px",
|
|
@@ -1556,8 +1557,8 @@ function ft(e) {
|
|
|
1556
1557
|
fontSize: 10.5
|
|
1557
1558
|
},
|
|
1558
1559
|
children: [
|
|
1559
|
-
/* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ k("span", { children: "Crease" }),
|
|
1561
|
+
/* @__PURE__ */ k("input", {
|
|
1561
1562
|
type: "range",
|
|
1562
1563
|
min: 12,
|
|
1563
1564
|
max: 62,
|
|
@@ -1566,7 +1567,7 @@ function ft(e) {
|
|
|
1566
1567
|
onChange: (t) => e.onChangeCreaseDeg(Number(t.target.value)),
|
|
1567
1568
|
style: { accentColor: "#FFB000" }
|
|
1568
1569
|
}),
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ k("span", {
|
|
1570
1571
|
style: {
|
|
1571
1572
|
textAlign: "right",
|
|
1572
1573
|
color: "#FFB000"
|
|
@@ -1575,7 +1576,7 @@ function ft(e) {
|
|
|
1575
1576
|
})
|
|
1576
1577
|
]
|
|
1577
1578
|
}),
|
|
1578
|
-
/* @__PURE__ */
|
|
1579
|
+
/* @__PURE__ */ A("label", {
|
|
1579
1580
|
style: {
|
|
1580
1581
|
display: "flex",
|
|
1581
1582
|
alignItems: "center",
|
|
@@ -1583,14 +1584,14 @@ function ft(e) {
|
|
|
1583
1584
|
fontSize: 10.5,
|
|
1584
1585
|
cursor: "pointer"
|
|
1585
1586
|
},
|
|
1586
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ k("input", {
|
|
1587
1588
|
type: "checkbox",
|
|
1588
1589
|
checked: e.mirrorX,
|
|
1589
1590
|
onChange: (t) => e.onToggleMirrorX(t.target.checked),
|
|
1590
1591
|
style: { accentColor: "#00E5FF" }
|
|
1591
|
-
}), /* @__PURE__ */
|
|
1592
|
+
}), /* @__PURE__ */ k("span", { children: "Mirror cut/tag across X = 0 (L + R)" })]
|
|
1592
1593
|
}),
|
|
1593
|
-
e.surfaceMode === "loop" && /* @__PURE__ */
|
|
1594
|
+
e.surfaceMode === "loop" && /* @__PURE__ */ A("label", {
|
|
1594
1595
|
style: {
|
|
1595
1596
|
display: "flex",
|
|
1596
1597
|
alignItems: "center",
|
|
@@ -1598,59 +1599,59 @@ function ft(e) {
|
|
|
1598
1599
|
fontSize: 10.5,
|
|
1599
1600
|
cursor: "pointer"
|
|
1600
1601
|
},
|
|
1601
|
-
children: [/* @__PURE__ */
|
|
1602
|
+
children: [/* @__PURE__ */ k("input", {
|
|
1602
1603
|
type: "checkbox",
|
|
1603
1604
|
checked: e.splitCoarse,
|
|
1604
1605
|
onChange: (t) => e.onToggleSplitCoarse(t.target.checked),
|
|
1605
1606
|
style: { accentColor: "#FFB000" }
|
|
1606
|
-
}), /* @__PURE__ */
|
|
1607
|
+
}), /* @__PURE__ */ k("span", { children: "Split coarse triangles under cut line" })]
|
|
1607
1608
|
}),
|
|
1608
|
-
e.surfaceMode !== "island" && /* @__PURE__ */
|
|
1609
|
+
e.surfaceMode !== "island" && /* @__PURE__ */ A("div", {
|
|
1609
1610
|
style: {
|
|
1610
1611
|
display: "flex",
|
|
1611
1612
|
flexWrap: "wrap",
|
|
1612
1613
|
gap: 5
|
|
1613
1614
|
},
|
|
1614
1615
|
children: [
|
|
1615
|
-
e.surfaceMode === "loop" && /* @__PURE__ */
|
|
1616
|
+
e.surfaceMode === "loop" && /* @__PURE__ */ k(G, {
|
|
1616
1617
|
label: `[ CLOSE LOOP (${e.loopDotCount}) ]`,
|
|
1617
1618
|
disabled: e.loopDotCount < 3,
|
|
1618
1619
|
color: "#00E5FF",
|
|
1619
1620
|
onClick: e.onCloseLoop
|
|
1620
1621
|
}),
|
|
1621
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ k(G, {
|
|
1622
1623
|
label: `[ PEEL ${e.selectedFaces}${e.mirroredFaces > 0 ? `+${e.mirroredFaces}` : ""} FACES → ${e.activeRole.toUpperCase()} ]`,
|
|
1623
1624
|
active: e.selectedFaces > 0,
|
|
1624
1625
|
disabled: e.selectedFaces === 0,
|
|
1625
1626
|
color: t.color,
|
|
1626
1627
|
onClick: e.onPeel
|
|
1627
1628
|
}),
|
|
1628
|
-
(e.selectedFaces > 0 || e.loopDotCount > 0) && /* @__PURE__ */
|
|
1629
|
+
(e.selectedFaces > 0 || e.loopDotCount > 0) && /* @__PURE__ */ k(G, {
|
|
1629
1630
|
label: "[ CLEAR ]",
|
|
1630
1631
|
onClick: e.onClearSelection
|
|
1631
1632
|
})
|
|
1632
1633
|
]
|
|
1633
1634
|
}),
|
|
1634
|
-
(e.undoCount > 0 || r > 0) && /* @__PURE__ */
|
|
1635
|
+
(e.undoCount > 0 || r > 0) && /* @__PURE__ */ A("div", {
|
|
1635
1636
|
style: {
|
|
1636
1637
|
display: "flex",
|
|
1637
1638
|
gap: 5
|
|
1638
1639
|
},
|
|
1639
|
-
children: [e.undoCount > 0 && /* @__PURE__ */
|
|
1640
|
+
children: [e.undoCount > 0 && /* @__PURE__ */ k(G, {
|
|
1640
1641
|
label: `[ UNDO CUT (${e.undoCount}) ]`,
|
|
1641
1642
|
color: "#F43F5E",
|
|
1642
1643
|
onClick: e.onUndoCut
|
|
1643
|
-
}), r > 0 && /* @__PURE__ */
|
|
1644
|
+
}), r > 0 && /* @__PURE__ */ k(G, {
|
|
1644
1645
|
label: "[ CLEAR TAGS ]",
|
|
1645
1646
|
onClick: e.onClearTags
|
|
1646
1647
|
})]
|
|
1647
1648
|
})
|
|
1648
1649
|
]
|
|
1649
1650
|
}),
|
|
1650
|
-
/* @__PURE__ */
|
|
1651
|
-
style:
|
|
1651
|
+
/* @__PURE__ */ A("div", {
|
|
1652
|
+
style: pt,
|
|
1652
1653
|
children: [
|
|
1653
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ k("span", {
|
|
1654
1655
|
style: {
|
|
1655
1656
|
fontSize: 10,
|
|
1656
1657
|
color: "#94A3B8",
|
|
@@ -1658,7 +1659,7 @@ function ft(e) {
|
|
|
1658
1659
|
},
|
|
1659
1660
|
children: "3. HINGE & EXPLODE PREVIEW"
|
|
1660
1661
|
}),
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ A("label", {
|
|
1662
1663
|
style: {
|
|
1663
1664
|
display: "grid",
|
|
1664
1665
|
gridTemplateColumns: "62px 1fr 42px",
|
|
@@ -1667,8 +1668,8 @@ function ft(e) {
|
|
|
1667
1668
|
fontSize: 10.5
|
|
1668
1669
|
},
|
|
1669
1670
|
children: [
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ k("span", { children: "Hinges" }),
|
|
1672
|
+
/* @__PURE__ */ k("input", {
|
|
1672
1673
|
type: "range",
|
|
1673
1674
|
min: 0,
|
|
1674
1675
|
max: 1,
|
|
@@ -1677,7 +1678,7 @@ function ft(e) {
|
|
|
1677
1678
|
onChange: (t) => e.onChangeHingeScrub(Number(t.target.value)),
|
|
1678
1679
|
style: { accentColor: "#10B981" }
|
|
1679
1680
|
}),
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ k("span", {
|
|
1681
1682
|
style: {
|
|
1682
1683
|
textAlign: "right",
|
|
1683
1684
|
color: "#10B981"
|
|
@@ -1686,7 +1687,7 @@ function ft(e) {
|
|
|
1686
1687
|
})
|
|
1687
1688
|
]
|
|
1688
1689
|
}),
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ A("label", {
|
|
1690
1691
|
style: {
|
|
1691
1692
|
display: "grid",
|
|
1692
1693
|
gridTemplateColumns: "62px 1fr 42px",
|
|
@@ -1695,8 +1696,8 @@ function ft(e) {
|
|
|
1695
1696
|
fontSize: 10.5
|
|
1696
1697
|
},
|
|
1697
1698
|
children: [
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1699
|
+
/* @__PURE__ */ k("span", { children: "Explode" }),
|
|
1700
|
+
/* @__PURE__ */ k("input", {
|
|
1700
1701
|
type: "range",
|
|
1701
1702
|
min: 0,
|
|
1702
1703
|
max: 1.2,
|
|
@@ -1705,7 +1706,7 @@ function ft(e) {
|
|
|
1705
1706
|
onChange: (t) => e.onChangeExplodeAmount(Number(t.target.value)),
|
|
1706
1707
|
style: { accentColor: "#FFB000" }
|
|
1707
1708
|
}),
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ k("span", {
|
|
1709
1710
|
style: {
|
|
1710
1711
|
textAlign: "right",
|
|
1711
1712
|
color: "#FFB000"
|
|
@@ -1716,10 +1717,10 @@ function ft(e) {
|
|
|
1716
1717
|
})
|
|
1717
1718
|
]
|
|
1718
1719
|
}),
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
style:
|
|
1720
|
+
/* @__PURE__ */ A("div", {
|
|
1721
|
+
style: pt,
|
|
1721
1722
|
children: [
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ k("span", {
|
|
1723
1724
|
style: {
|
|
1724
1725
|
fontSize: 10,
|
|
1725
1726
|
color: "#94A3B8",
|
|
@@ -1727,25 +1728,25 @@ function ft(e) {
|
|
|
1727
1728
|
},
|
|
1728
1729
|
children: "4. WHEELS & POWERTRAIN"
|
|
1729
1730
|
}),
|
|
1730
|
-
/* @__PURE__ */
|
|
1731
|
+
/* @__PURE__ */ A("div", {
|
|
1731
1732
|
style: {
|
|
1732
1733
|
display: "grid",
|
|
1733
1734
|
gridTemplateColumns: "1fr 1fr",
|
|
1734
1735
|
gap: 5
|
|
1735
1736
|
},
|
|
1736
|
-
children: [/* @__PURE__ */
|
|
1737
|
+
children: [/* @__PURE__ */ k(G, {
|
|
1737
1738
|
label: "Imported Tires",
|
|
1738
1739
|
active: e.wheelSource === "imported",
|
|
1739
1740
|
color: "#00E5FF",
|
|
1740
1741
|
onClick: () => e.onChangeWheelSource("imported")
|
|
1741
|
-
}), /* @__PURE__ */
|
|
1742
|
+
}), /* @__PURE__ */ k(G, {
|
|
1742
1743
|
label: "12-Gon Fleet",
|
|
1743
1744
|
active: e.wheelSource === "fleet12",
|
|
1744
1745
|
color: "#10B981",
|
|
1745
1746
|
onClick: () => e.onChangeWheelSource("fleet12")
|
|
1746
1747
|
})]
|
|
1747
1748
|
}),
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
+
/* @__PURE__ */ k("div", {
|
|
1749
1750
|
style: {
|
|
1750
1751
|
display: "grid",
|
|
1751
1752
|
gridTemplateColumns: "repeat(3, 1fr)",
|
|
@@ -1755,14 +1756,14 @@ function ft(e) {
|
|
|
1755
1756
|
"AWD",
|
|
1756
1757
|
"RWD",
|
|
1757
1758
|
"FWD"
|
|
1758
|
-
].map((t) => /* @__PURE__ */
|
|
1759
|
+
].map((t) => /* @__PURE__ */ k(G, {
|
|
1759
1760
|
label: t,
|
|
1760
1761
|
active: e.driveType === t,
|
|
1761
1762
|
color: "#FFB000",
|
|
1762
1763
|
onClick: () => e.onChangeDriveType(t)
|
|
1763
1764
|
}, t))
|
|
1764
1765
|
}),
|
|
1765
|
-
/* @__PURE__ */
|
|
1766
|
+
/* @__PURE__ */ A("label", {
|
|
1766
1767
|
style: {
|
|
1767
1768
|
display: "grid",
|
|
1768
1769
|
gridTemplateColumns: "62px 1fr 46px",
|
|
@@ -1771,8 +1772,8 @@ function ft(e) {
|
|
|
1771
1772
|
fontSize: 10.5
|
|
1772
1773
|
},
|
|
1773
1774
|
children: [
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ k("span", { children: "Power" }),
|
|
1776
|
+
/* @__PURE__ */ k("input", {
|
|
1776
1777
|
type: "range",
|
|
1777
1778
|
min: 90,
|
|
1778
1779
|
max: 720,
|
|
@@ -1781,7 +1782,7 @@ function ft(e) {
|
|
|
1781
1782
|
onChange: (t) => e.onChangeHorsepower(Number(t.target.value)),
|
|
1782
1783
|
style: { accentColor: "#FFB000" }
|
|
1783
1784
|
}),
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ k("span", {
|
|
1785
1786
|
style: {
|
|
1786
1787
|
textAlign: "right",
|
|
1787
1788
|
color: "#FFB000"
|
|
@@ -1792,7 +1793,7 @@ function ft(e) {
|
|
|
1792
1793
|
})
|
|
1793
1794
|
]
|
|
1794
1795
|
}),
|
|
1795
|
-
e.statusNote && /* @__PURE__ */
|
|
1796
|
+
e.statusNote && /* @__PURE__ */ k("div", {
|
|
1796
1797
|
style: {
|
|
1797
1798
|
fontSize: 10.5,
|
|
1798
1799
|
color: "#34D399",
|
|
@@ -1803,19 +1804,19 @@ function ft(e) {
|
|
|
1803
1804
|
},
|
|
1804
1805
|
children: e.statusNote
|
|
1805
1806
|
}),
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ A("div", {
|
|
1807
1808
|
style: {
|
|
1808
1809
|
display: "grid",
|
|
1809
1810
|
gap: 6,
|
|
1810
1811
|
marginTop: "auto"
|
|
1811
1812
|
},
|
|
1812
|
-
children: [/* @__PURE__ */
|
|
1813
|
+
children: [/* @__PURE__ */ k(G, {
|
|
1813
1814
|
label: "[ -> STEP 2: COMPILE & TEST TRACK (WASD) ]",
|
|
1814
1815
|
active: e.unlocked,
|
|
1815
1816
|
disabled: !e.unlocked || e.busy,
|
|
1816
1817
|
color: "#FFB000",
|
|
1817
1818
|
onClick: e.onGoTestDrive
|
|
1818
|
-
}), e.onSpawnWorld && /* @__PURE__ */
|
|
1819
|
+
}), e.onSpawnWorld && /* @__PURE__ */ k(G, {
|
|
1819
1820
|
label: e.busy ? "[ COMPILING KHR3… ]" : "[ -> SPAWN & DRIVE ON LONG DRIVE ]",
|
|
1820
1821
|
active: e.unlocked,
|
|
1821
1822
|
disabled: !e.unlocked || e.busy,
|
|
@@ -1827,7 +1828,7 @@ function ft(e) {
|
|
|
1827
1828
|
});
|
|
1828
1829
|
}
|
|
1829
1830
|
// src/importer/launcherBake.ts
|
|
1830
|
-
var
|
|
1831
|
+
var ht = {
|
|
1831
1832
|
receiver: "#334155",
|
|
1832
1833
|
barrel: "#1e293b",
|
|
1833
1834
|
bolt: "#94a3b8",
|
|
@@ -1837,21 +1838,21 @@ var pt = {
|
|
|
1837
1838
|
stock: "#475569",
|
|
1838
1839
|
screen_rect: "#38bdf8"
|
|
1839
1840
|
};
|
|
1840
|
-
function
|
|
1841
|
-
let n = new
|
|
1841
|
+
function gt(e, t) {
|
|
1842
|
+
let n = new m.Group();
|
|
1842
1843
|
n.name = e.recipeId;
|
|
1843
1844
|
let r = /* @__PURE__ */ new Map([["root", n]]);
|
|
1844
1845
|
for (let i of e.nodes) {
|
|
1845
1846
|
let a = r.get(i.parent) ?? n, o;
|
|
1846
1847
|
if (i.size[0] > 0 && i.size[1] > 0 && i.size[2] > 0) {
|
|
1847
|
-
let n = e.parts.find((e) => e.name === i.name || `${e.name}_Collider` === i.name), r =
|
|
1848
|
+
let n = e.parts.find((e) => e.name === i.name || `${e.name}_Collider` === i.name), r = ht[n?.role ?? "receiver"] ?? "#475569", a = new m.MeshStandardMaterial({
|
|
1848
1849
|
color: r,
|
|
1849
1850
|
roughness: .72,
|
|
1850
1851
|
metalness: .28,
|
|
1851
1852
|
flatShading: !0
|
|
1852
|
-
}), s = new
|
|
1853
|
+
}), s = new m.Mesh(new m.BoxGeometry(i.size[0], i.size[1], i.size[2]), a);
|
|
1853
1854
|
t && n && !n.joint && (s.visible = !1), o = s;
|
|
1854
|
-
} else o = new
|
|
1855
|
+
} else o = new m.Group();
|
|
1855
1856
|
o.name = i.name, o.position.set(i.position[0], i.position[1], i.position[2]), a.add(o), r.set(i.name, o);
|
|
1856
1857
|
}
|
|
1857
1858
|
if (t) {
|
|
@@ -1860,20 +1861,20 @@ function mt(e, t) {
|
|
|
1860
1861
|
}
|
|
1861
1862
|
return n;
|
|
1862
1863
|
}
|
|
1863
|
-
async function
|
|
1864
|
-
let i = typeof e == "string" ? pe.find((t) => t.id === e) ?? me("kolmogorov_carbine") : e, a = he(i), o =
|
|
1864
|
+
async function _t(e = ue, t, r = []) {
|
|
1865
|
+
let i = typeof e == "string" ? pe.find((t) => t.id === e) ?? me("kolmogorov_carbine") : e, a = he(i), o = gt(a, t), s = new Uint8Array(await T(o, a.specs, {
|
|
1865
1866
|
gateDomain: "launcher",
|
|
1866
1867
|
launcher: a.spec,
|
|
1867
1868
|
ikSockets: a.sockets
|
|
1868
|
-
})), c =
|
|
1869
|
+
})), c = n(s, r), l = c instanceof Uint8Array ? c : new Uint8Array(c), u = l.buffer.slice(l.byteOffset, l.byteOffset + l.byteLength);
|
|
1869
1870
|
return {
|
|
1870
1871
|
glbBytes: l,
|
|
1871
|
-
bundle: await
|
|
1872
|
+
bundle: await E(u),
|
|
1872
1873
|
plan: a
|
|
1873
1874
|
};
|
|
1874
1875
|
}
|
|
1875
1876
|
// src/importer/DomainWorkshopPanel.tsx
|
|
1876
|
-
var
|
|
1877
|
+
var vt = {
|
|
1877
1878
|
position: "absolute",
|
|
1878
1879
|
top: 52,
|
|
1879
1880
|
left: 12,
|
|
@@ -1891,7 +1892,7 @@ var gt = {
|
|
|
1891
1892
|
display: "flex",
|
|
1892
1893
|
flexDirection: "column",
|
|
1893
1894
|
gap: 8
|
|
1894
|
-
},
|
|
1895
|
+
}, K = {
|
|
1895
1896
|
padding: "5px 8px",
|
|
1896
1897
|
background: "#11161C",
|
|
1897
1898
|
border: "1px solid #00E5FF",
|
|
@@ -1902,26 +1903,26 @@ var gt = {
|
|
|
1902
1903
|
cursor: "pointer",
|
|
1903
1904
|
textAlign: "left"
|
|
1904
1905
|
};
|
|
1905
|
-
function
|
|
1906
|
+
function yt(e) {
|
|
1906
1907
|
if (!e) return 0;
|
|
1907
1908
|
let t = 0;
|
|
1908
1909
|
return e.traverse((e) => {
|
|
1909
1910
|
let n = e;
|
|
1910
1911
|
if (n.isMesh && n.material) for (let e of Array.isArray(n.material) ? n.material : [n.material]) {
|
|
1911
1912
|
let n = e;
|
|
1912
|
-
n.flatShading = !0, n.normalMap = null, n.bumpMap = null, n.map && (n.map.magFilter =
|
|
1913
|
+
n.flatShading = !0, n.normalMap = null, n.bumpMap = null, n.map && (n.map.magFilter = m.NearestFilter, n.map.anisotropy = 1, n.map.needsUpdate = !0), n.needsUpdate = !0, t++;
|
|
1913
1914
|
}
|
|
1914
1915
|
}), t;
|
|
1915
1916
|
}
|
|
1916
|
-
function
|
|
1917
|
-
let [
|
|
1918
|
-
if (
|
|
1919
|
-
let
|
|
1920
|
-
return /* @__PURE__ */
|
|
1921
|
-
style:
|
|
1922
|
-
"aria-label": `${
|
|
1917
|
+
function bt({ domain: t, targetMeters: n, onChangeTargetMeters: r, onSnapC12: i, onLoadVaultUrl: a, onForgeLauncherRecipe: o, onAddSocketPatch: s, onEnforceCrispyPerson: c, onUploadToVault: l }) {
|
|
1918
|
+
let [u, d] = p(!1), [f, m] = p("cars"), [h, g] = p(""), [_, v] = p(null);
|
|
1919
|
+
if (t === "vehicle" && !u) return null;
|
|
1920
|
+
let y = Object.entries(P[f]);
|
|
1921
|
+
return /* @__PURE__ */ A("aside", {
|
|
1922
|
+
style: vt,
|
|
1923
|
+
"aria-label": `${t.toUpperCase()} Workshop`,
|
|
1923
1924
|
children: [
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
+
/* @__PURE__ */ A("div", {
|
|
1925
1926
|
style: {
|
|
1926
1927
|
display: "flex",
|
|
1927
1928
|
justifyContent: "space-between",
|
|
@@ -1929,99 +1930,99 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
|
|
|
1929
1930
|
color: "#FFB000",
|
|
1930
1931
|
fontWeight: 700
|
|
1931
1932
|
},
|
|
1932
|
-
children: [/* @__PURE__ */
|
|
1933
|
+
children: [/* @__PURE__ */ k("span", { children: `WORKSHOP :: ${t.toUpperCase()}` }), /* @__PURE__ */ k("button", {
|
|
1933
1934
|
type: "button",
|
|
1934
1935
|
style: {
|
|
1935
|
-
...
|
|
1936
|
+
...K,
|
|
1936
1937
|
padding: "2px 6px",
|
|
1937
1938
|
borderColor: "#10B981"
|
|
1938
1939
|
},
|
|
1939
|
-
onClick: () =>
|
|
1940
|
-
children:
|
|
1940
|
+
onClick: () => d((e) => !e),
|
|
1941
|
+
children: u ? "HIDE VAULT" : "R2 VAULT"
|
|
1941
1942
|
})]
|
|
1942
1943
|
}),
|
|
1943
|
-
|
|
1944
|
-
/* @__PURE__ */
|
|
1944
|
+
t === "c12" && /* @__PURE__ */ A(O, { children: [
|
|
1945
|
+
/* @__PURE__ */ k("div", {
|
|
1945
1946
|
style: { color: "#94A3B8" },
|
|
1946
1947
|
children: "Exact 3.0m / 0.25m C12 Cyclotomic Lattice & Openings"
|
|
1947
1948
|
}),
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ k("button", {
|
|
1949
1950
|
type: "button",
|
|
1950
|
-
style:
|
|
1951
|
+
style: K,
|
|
1951
1952
|
onClick: () => {
|
|
1952
|
-
|
|
1953
|
+
r(3), i(), v("Snapped to 3.00 m C12 module (12 steps).");
|
|
1953
1954
|
},
|
|
1954
1955
|
children: "[ SNAP TO 3.00M C12 MODULE ]"
|
|
1955
1956
|
}),
|
|
1956
|
-
/* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ k("button", {
|
|
1957
1958
|
type: "button",
|
|
1958
|
-
style:
|
|
1959
|
+
style: K,
|
|
1959
1960
|
onClick: () => {
|
|
1960
|
-
|
|
1961
|
+
s("Aperture_Doorway_900x2100", [
|
|
1961
1962
|
0,
|
|
1962
|
-
|
|
1963
|
+
N.openingHeightM * .5,
|
|
1963
1964
|
0
|
|
1964
|
-
]),
|
|
1965
|
+
]), s("Socket_DoorHinge", [...N.hingeOffsetLocal]), v("Stamped 900x2100 doorway + KHR revolute hinge socket.");
|
|
1965
1966
|
},
|
|
1966
1967
|
children: "[ STAMP 0.9x2.1M HINGED DOORWAY ]"
|
|
1967
1968
|
}),
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
+
/* @__PURE__ */ k("button", {
|
|
1969
1970
|
type: "button",
|
|
1970
|
-
style:
|
|
1971
|
+
style: K,
|
|
1971
1972
|
onClick: () => {
|
|
1972
|
-
|
|
1973
|
+
s("Aperture_Window", [
|
|
1973
1974
|
0,
|
|
1974
1975
|
1.45,
|
|
1975
1976
|
0
|
|
1976
|
-
]),
|
|
1977
|
+
]), v("Stamped window opening anchor.");
|
|
1977
1978
|
},
|
|
1978
1979
|
children: "[ STAMP WINDOW APERTURE ]"
|
|
1979
1980
|
}),
|
|
1980
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ k("button", {
|
|
1981
1982
|
type: "button",
|
|
1982
|
-
style:
|
|
1983
|
-
onClick: () =>
|
|
1983
|
+
style: K,
|
|
1984
|
+
onClick: () => a(P.city.door_hinged_single, "door_hinged_900x2100"),
|
|
1984
1985
|
children: "[ LOAD VAULT: HINGED DOOR .GLB ]"
|
|
1985
1986
|
})
|
|
1986
1987
|
] }),
|
|
1987
|
-
|
|
1988
|
-
/* @__PURE__ */
|
|
1988
|
+
t === "launcher" && /* @__PURE__ */ A(O, { children: [
|
|
1989
|
+
/* @__PURE__ */ k("div", {
|
|
1989
1990
|
style: { color: "#94A3B8" },
|
|
1990
1991
|
children: "Articulated `@khr3/launchers` Forger (`Receiver_Root` + `Bolt`/`Pump`/`Trigger` KHR drives)"
|
|
1991
1992
|
}),
|
|
1992
|
-
/* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ k("div", {
|
|
1993
1994
|
style: {
|
|
1994
1995
|
display: "flex",
|
|
1995
1996
|
flexWrap: "wrap",
|
|
1996
1997
|
gap: 4
|
|
1997
1998
|
},
|
|
1998
|
-
children: pe.map((e) => /* @__PURE__ */
|
|
1999
|
+
children: pe.map((e) => /* @__PURE__ */ k("button", {
|
|
1999
2000
|
type: "button",
|
|
2000
2001
|
style: {
|
|
2001
|
-
...
|
|
2002
|
+
...K,
|
|
2002
2003
|
borderColor: "#FFB000",
|
|
2003
2004
|
fontSize: 10
|
|
2004
2005
|
},
|
|
2005
2006
|
onClick: () => {
|
|
2006
2007
|
let t = he(e), n = Number((e.dims.receiverLength + e.dims.barrelLength + (e.dims.hasStock ? .22 : 0)).toFixed(2));
|
|
2007
|
-
|
|
2008
|
+
o?.(e.id, gt(t), n), v(`Forged ${e.label} (${t.parts.length} parts, ${e.spec.magazineCapacity} rd, ${e.spec.fireRateHz} Hz)`);
|
|
2008
2009
|
},
|
|
2009
2010
|
children: `FORGE ${e.id.replace("kolmogorov_", "").toUpperCase()}`
|
|
2010
2011
|
}, e.id))
|
|
2011
2012
|
}),
|
|
2012
|
-
/* @__PURE__ */
|
|
2013
|
+
/* @__PURE__ */ A("label", {
|
|
2013
2014
|
style: {
|
|
2014
2015
|
display: "flex",
|
|
2015
2016
|
justifyContent: "space-between",
|
|
2016
2017
|
alignItems: "center"
|
|
2017
2018
|
},
|
|
2018
|
-
children: [/* @__PURE__ */
|
|
2019
|
+
children: [/* @__PURE__ */ k("span", { children: "Length (m):" }), /* @__PURE__ */ k("input", {
|
|
2019
2020
|
type: "number",
|
|
2020
2021
|
step: .05,
|
|
2021
2022
|
min: .12,
|
|
2022
2023
|
max: 2.2,
|
|
2023
|
-
value:
|
|
2024
|
-
onChange: (e) =>
|
|
2024
|
+
value: n,
|
|
2025
|
+
onChange: (e) => r(Number(e.target.value) || .72),
|
|
2025
2026
|
style: {
|
|
2026
2027
|
width: 72,
|
|
2027
2028
|
background: "#0A0C0E",
|
|
@@ -2050,7 +2051,7 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
|
|
|
2050
2051
|
["Socket_Muzzle", [
|
|
2051
2052
|
0,
|
|
2052
2053
|
.04,
|
|
2053
|
-
|
|
2054
|
+
n * .5
|
|
2054
2055
|
]],
|
|
2055
2056
|
["Socket_Eject", [
|
|
2056
2057
|
.03,
|
|
@@ -2062,88 +2063,88 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
|
|
|
2062
2063
|
.07,
|
|
2063
2064
|
-.12
|
|
2064
2065
|
]]
|
|
2065
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
2066
|
+
].map(([e, t]) => /* @__PURE__ */ k("button", {
|
|
2066
2067
|
type: "button",
|
|
2067
|
-
style:
|
|
2068
|
+
style: K,
|
|
2068
2069
|
onClick: () => {
|
|
2069
|
-
|
|
2070
|
+
s(e, [
|
|
2070
2071
|
t[0],
|
|
2071
2072
|
t[1],
|
|
2072
2073
|
t[2]
|
|
2073
|
-
]),
|
|
2074
|
+
]), v(`Stamped ${e}`);
|
|
2074
2075
|
},
|
|
2075
2076
|
children: `+ STAMP ${e}`
|
|
2076
2077
|
}, e)),
|
|
2077
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ k("div", {
|
|
2078
2079
|
style: {
|
|
2079
2080
|
display: "flex",
|
|
2080
2081
|
flexWrap: "wrap",
|
|
2081
2082
|
gap: 4
|
|
2082
2083
|
},
|
|
2083
|
-
children: Object.entries(
|
|
2084
|
+
children: Object.entries(P.weapons).map(([e, t]) => /* @__PURE__ */ k("button", {
|
|
2084
2085
|
type: "button",
|
|
2085
2086
|
style: {
|
|
2086
|
-
...
|
|
2087
|
+
...K,
|
|
2087
2088
|
borderColor: "#10B981",
|
|
2088
2089
|
fontSize: 9.5
|
|
2089
2090
|
},
|
|
2090
|
-
onClick: () =>
|
|
2091
|
+
onClick: () => a(t, e),
|
|
2091
2092
|
children: e.replace("kolmogorov_", "").toUpperCase()
|
|
2092
2093
|
}, e))
|
|
2093
2094
|
})
|
|
2094
2095
|
] }),
|
|
2095
|
-
|
|
2096
|
-
/* @__PURE__ */
|
|
2096
|
+
t === "person" && /* @__PURE__ */ A(O, { children: [
|
|
2097
|
+
/* @__PURE__ */ k("div", {
|
|
2097
2098
|
style: { color: "#94A3B8" },
|
|
2098
2099
|
children: "SI 1.75m Capsule (`BODY_SI`) & Faceted Mixamo Rig"
|
|
2099
2100
|
}),
|
|
2100
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ k("button", {
|
|
2101
2102
|
type: "button",
|
|
2102
|
-
style:
|
|
2103
|
+
style: K,
|
|
2103
2104
|
onClick: () => {
|
|
2104
|
-
|
|
2105
|
+
r(e.capsuleHalfHeight * 2 + e.capsuleRadius * 2 + e.floatHeight), v("Scaled character to exact 1.75 m SI standing height.");
|
|
2105
2106
|
},
|
|
2106
2107
|
children: "[ LOCK 1.75M SI STANDING HEIGHT ]"
|
|
2107
2108
|
}),
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ k("button", {
|
|
2109
2110
|
type: "button",
|
|
2110
|
-
style:
|
|
2111
|
+
style: K,
|
|
2111
2112
|
onClick: () => {
|
|
2112
|
-
|
|
2113
|
+
c(), v("Stripped normalMap/bumpMap + forced flatShading & NearestFilter.");
|
|
2113
2114
|
},
|
|
2114
2115
|
children: "[ ENFORCE FACETED RETRO SHADING ]"
|
|
2115
2116
|
}),
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
+
/* @__PURE__ */ k("button", {
|
|
2117
2118
|
type: "button",
|
|
2118
|
-
style:
|
|
2119
|
+
style: K,
|
|
2119
2120
|
onClick: () => {
|
|
2120
|
-
|
|
2121
|
+
s("Socket_Hand_R", [
|
|
2121
2122
|
.22,
|
|
2122
2123
|
1.12,
|
|
2123
2124
|
.28
|
|
2124
|
-
]),
|
|
2125
|
+
]), s("Socket_Hand_L", [
|
|
2125
2126
|
-.22,
|
|
2126
2127
|
1.12,
|
|
2127
2128
|
.28
|
|
2128
|
-
]),
|
|
2129
|
+
]), s("Socket_Back", [
|
|
2129
2130
|
0,
|
|
2130
2131
|
1.25,
|
|
2131
2132
|
-.18
|
|
2132
|
-
]),
|
|
2133
|
+
]), v("Stamped Socket_Hand_R, Socket_Hand_L & Socket_Back.");
|
|
2133
2134
|
},
|
|
2134
2135
|
children: "[ STAMP HAND & BACK SOCKETS ]"
|
|
2135
2136
|
})
|
|
2136
2137
|
] }),
|
|
2137
|
-
(
|
|
2138
|
+
(t === "prop" || t === "junk") && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("div", {
|
|
2138
2139
|
style: { color: "#94A3B8" },
|
|
2139
|
-
children:
|
|
2140
|
-
}), /* @__PURE__ */
|
|
2140
|
+
children: t === "junk" ? "BVH Shatter & Local Decal Target" : "KHR Convex/Box Prop"
|
|
2141
|
+
}), /* @__PURE__ */ k("button", {
|
|
2141
2142
|
type: "button",
|
|
2142
|
-
style:
|
|
2143
|
-
onClick: () =>
|
|
2143
|
+
style: K,
|
|
2144
|
+
onClick: () => a(P.city.prop_arcade_cabinet, "prop_arcade_cabinet"),
|
|
2144
2145
|
children: "[ LOAD VAULT: ARCADE CABINET ]"
|
|
2145
2146
|
})] }),
|
|
2146
|
-
|
|
2147
|
+
u && /* @__PURE__ */ A("div", {
|
|
2147
2148
|
style: {
|
|
2148
2149
|
borderTop: "1px solid #1C2229",
|
|
2149
2150
|
paddingTop: 8,
|
|
@@ -2152,7 +2153,7 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
|
|
|
2152
2153
|
gap: 6
|
|
2153
2154
|
},
|
|
2154
2155
|
children: [
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ k("div", {
|
|
2156
2157
|
style: {
|
|
2157
2158
|
display: "flex",
|
|
2158
2159
|
gap: 4
|
|
@@ -2161,17 +2162,17 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
|
|
|
2161
2162
|
"cars",
|
|
2162
2163
|
"weapons",
|
|
2163
2164
|
"city"
|
|
2164
|
-
].map((e) => /* @__PURE__ */
|
|
2165
|
+
].map((e) => /* @__PURE__ */ k("button", {
|
|
2165
2166
|
type: "button",
|
|
2166
2167
|
style: {
|
|
2167
|
-
...
|
|
2168
|
-
borderColor:
|
|
2168
|
+
...K,
|
|
2169
|
+
borderColor: f === e ? "#FFB000" : "#1C2229"
|
|
2169
2170
|
},
|
|
2170
|
-
onClick: () =>
|
|
2171
|
+
onClick: () => m(e),
|
|
2171
2172
|
children: e.toUpperCase()
|
|
2172
2173
|
}, e))
|
|
2173
2174
|
}),
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ k("div", {
|
|
2175
2176
|
style: {
|
|
2176
2177
|
maxHeight: 120,
|
|
2177
2178
|
overflowY: "auto",
|
|
@@ -2179,26 +2180,26 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
|
|
|
2179
2180
|
flexDirection: "column",
|
|
2180
2181
|
gap: 3
|
|
2181
2182
|
},
|
|
2182
|
-
children:
|
|
2183
|
+
children: y.map(([e, t]) => /* @__PURE__ */ k("button", {
|
|
2183
2184
|
type: "button",
|
|
2184
2185
|
style: {
|
|
2185
|
-
...
|
|
2186
|
+
...K,
|
|
2186
2187
|
fontSize: 10
|
|
2187
2188
|
},
|
|
2188
|
-
onClick: () =>
|
|
2189
|
+
onClick: () => a(t, e),
|
|
2189
2190
|
children: `-> ${e}`
|
|
2190
2191
|
}, e))
|
|
2191
2192
|
}),
|
|
2192
|
-
|
|
2193
|
+
l && /* @__PURE__ */ A("div", {
|
|
2193
2194
|
style: {
|
|
2194
2195
|
display: "flex",
|
|
2195
2196
|
gap: 4
|
|
2196
2197
|
},
|
|
2197
|
-
children: [/* @__PURE__ */
|
|
2198
|
+
children: [/* @__PURE__ */ k("input", {
|
|
2198
2199
|
type: "password",
|
|
2199
2200
|
placeholder: "VAULT_WRITE_TOKEN",
|
|
2200
|
-
value:
|
|
2201
|
-
onChange: (e) =>
|
|
2201
|
+
value: h,
|
|
2202
|
+
onChange: (e) => g(e.target.value),
|
|
2202
2203
|
style: {
|
|
2203
2204
|
flex: 1,
|
|
2204
2205
|
background: "#0A0C0E",
|
|
@@ -2207,40 +2208,40 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
|
|
|
2207
2208
|
padding: "3px 5px",
|
|
2208
2209
|
fontSize: 10
|
|
2209
2210
|
}
|
|
2210
|
-
}), /* @__PURE__ */
|
|
2211
|
+
}), /* @__PURE__ */ k("button", {
|
|
2211
2212
|
type: "button",
|
|
2212
2213
|
style: {
|
|
2213
|
-
...
|
|
2214
|
+
...K,
|
|
2214
2215
|
borderColor: "#10B981"
|
|
2215
2216
|
},
|
|
2216
2217
|
onClick: () => {
|
|
2217
|
-
|
|
2218
|
+
l(f, h), v(`Uploading to ${F().baseUrl}/assets/${f}…`);
|
|
2218
2219
|
},
|
|
2219
2220
|
children: "PUT R2"
|
|
2220
2221
|
})]
|
|
2221
2222
|
})
|
|
2222
2223
|
]
|
|
2223
2224
|
}),
|
|
2224
|
-
|
|
2225
|
+
_ && /* @__PURE__ */ k("div", {
|
|
2225
2226
|
style: {
|
|
2226
2227
|
color: "#10B981",
|
|
2227
2228
|
fontSize: 10
|
|
2228
2229
|
},
|
|
2229
|
-
children:
|
|
2230
|
+
children: _
|
|
2230
2231
|
})
|
|
2231
2232
|
]
|
|
2232
2233
|
});
|
|
2233
2234
|
}
|
|
2234
2235
|
// src/importer/gateStore.ts
|
|
2235
|
-
var
|
|
2236
|
+
var xt = Object.freeze({
|
|
2236
2237
|
TRUCK: 1.4,
|
|
2237
2238
|
STREET: 1.9,
|
|
2238
2239
|
SPORT: 2.8
|
|
2239
|
-
}),
|
|
2240
|
+
}), St = Object.freeze({
|
|
2240
2241
|
PLUSH: .65,
|
|
2241
2242
|
BALANCED: .75,
|
|
2242
2243
|
STIFF: .85
|
|
2243
|
-
}),
|
|
2244
|
+
}), q = {
|
|
2244
2245
|
massKg: 780,
|
|
2245
2246
|
com: [
|
|
2246
2247
|
0,
|
|
@@ -2254,7 +2255,7 @@ var yt = Object.freeze({
|
|
|
2254
2255
|
sparkBurst: null,
|
|
2255
2256
|
massDirty: !0
|
|
2256
2257
|
};
|
|
2257
|
-
function
|
|
2258
|
+
function Ct(e, t, n, r) {
|
|
2258
2259
|
let [i, a, o] = e.aabbSize, s = i >= .04 && a >= .04 && o >= .04 && Math.max(i, a, o) <= 120, c = Math.abs(e.minY) <= .005;
|
|
2259
2260
|
if (!s || !c) return !1;
|
|
2260
2261
|
if (t === "c12") return e.c12Aligned;
|
|
@@ -2264,7 +2265,7 @@ function xt(e, t, n, r) {
|
|
|
2264
2265
|
}
|
|
2265
2266
|
return !0;
|
|
2266
2267
|
}
|
|
2267
|
-
var
|
|
2268
|
+
var J = ge((e) => ({
|
|
2268
2269
|
step: 1,
|
|
2269
2270
|
domain: "vehicle",
|
|
2270
2271
|
vehicleArchetype: "car",
|
|
@@ -2279,7 +2280,7 @@ var K = ge((e) => ({
|
|
|
2279
2280
|
staticProp: !1,
|
|
2280
2281
|
massKg: 1380,
|
|
2281
2282
|
powerOrThrust: 240,
|
|
2282
|
-
attachedMask:
|
|
2283
|
+
attachedMask: I,
|
|
2283
2284
|
unlatchedMask: 0,
|
|
2284
2285
|
fuelLiters: 42,
|
|
2285
2286
|
dropTrigger: 0,
|
|
@@ -2313,24 +2314,24 @@ var K = ge((e) => ({
|
|
|
2313
2314
|
setCalibration: (t) => e({ calibration: t }),
|
|
2314
2315
|
triggerDrop: () => e((e) => ({ dropTrigger: e.dropTrigger + 1 })),
|
|
2315
2316
|
resetAllPanels: () => {
|
|
2316
|
-
|
|
2317
|
-
attachedMask:
|
|
2317
|
+
q.massDirty = !0, e({
|
|
2318
|
+
attachedMask: I,
|
|
2318
2319
|
unlatchedMask: 0,
|
|
2319
2320
|
detachedDebris: []
|
|
2320
2321
|
});
|
|
2321
2322
|
}
|
|
2322
|
-
})),
|
|
2323
|
-
function
|
|
2324
|
-
return /* @__PURE__ */
|
|
2323
|
+
})), wt = "#0A0C0E", Tt = "#1C2229", Et = "#FFB000", Dt = "#00E5FF", Ot = "#FF3B30", kt = "#10B981", At = "#E6EDF3";
|
|
2324
|
+
function Y({ label: e, active: t = !1, disabled: n = !1, accent: r = Et, onClick: i }) {
|
|
2325
|
+
return /* @__PURE__ */ k("button", {
|
|
2325
2326
|
type: "button",
|
|
2326
2327
|
disabled: n,
|
|
2327
2328
|
onClick: i,
|
|
2328
2329
|
style: {
|
|
2329
2330
|
padding: "4px 8px",
|
|
2330
2331
|
borderRadius: 2,
|
|
2331
|
-
border: `1px solid ${n ?
|
|
2332
|
-
background: t ? r :
|
|
2333
|
-
color: n ? "#55606E" : t ?
|
|
2332
|
+
border: `1px solid ${n ? Tt : t ? r : Dt}`,
|
|
2333
|
+
background: t ? r : wt,
|
|
2334
|
+
color: n ? "#55606E" : t ? wt : At,
|
|
2334
2335
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
2335
2336
|
fontSize: 10.5,
|
|
2336
2337
|
fontWeight: t ? 700 : 500,
|
|
@@ -2340,23 +2341,23 @@ function J({ label: e, active: t = !1, disabled: n = !1, accent: r = wt, onClick
|
|
|
2340
2341
|
children: e
|
|
2341
2342
|
});
|
|
2342
2343
|
}
|
|
2343
|
-
var
|
|
2344
|
+
var jt = {
|
|
2344
2345
|
display: "flex",
|
|
2345
2346
|
flexWrap: "wrap",
|
|
2346
2347
|
justifyContent: "space-between",
|
|
2347
2348
|
alignItems: "center",
|
|
2348
2349
|
gap: 8,
|
|
2349
2350
|
padding: "8px 12px",
|
|
2350
|
-
background:
|
|
2351
|
-
borderBottom: `1px solid ${
|
|
2351
|
+
background: wt,
|
|
2352
|
+
borderBottom: `1px solid ${Tt}`,
|
|
2352
2353
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
2353
2354
|
zIndex: 20
|
|
2354
2355
|
};
|
|
2355
|
-
function
|
|
2356
|
-
let t =
|
|
2357
|
-
|
|
2356
|
+
function Mt(e) {
|
|
2357
|
+
let t = J(), n = Ct(t.calibration, t.domain, t.vehicleArchetype, t.usePaperShellProxy), r = f(null);
|
|
2358
|
+
u(() => {
|
|
2358
2359
|
let n = 0, i = "", a = () => {
|
|
2359
|
-
let o =
|
|
2360
|
+
let o = q.massKg.toFixed(0), s = q.com.map((e) => e.toFixed(2)).join(","), c = q.speedKmh.toFixed(0), l = q.rpm.toFixed(0), u = t.domain === "vehicle" ? `MASS=${o}KG COM=[${s}] HINGED=${e.choppedCount} ${l} RPM ${c} KM/H` : `MASS=${o}KG COM=[${s}] PATCHES=${e.patchCount} ${c} KM/H`;
|
|
2360
2361
|
u !== i && r.current && (r.current.textContent = u, i = u), n = requestAnimationFrame(a);
|
|
2361
2362
|
};
|
|
2362
2363
|
return n = requestAnimationFrame(a), () => cancelAnimationFrame(n);
|
|
@@ -2366,9 +2367,9 @@ function kt(e) {
|
|
|
2366
2367
|
e.choppedCount
|
|
2367
2368
|
]);
|
|
2368
2369
|
let i = t.calibration, a = t.domain === "c12" ? `C12=[${i.c12Ticks.join("x")}]TICKS (${i.c12Aligned ? "ALIGNED" : "OFF-GRID"}) MIN_Y=${i.minY.toFixed(4)}M AABB=[${i.aabbSize.join("x")}]M` : t.domain === "launcher" ? `ANCHORS=${i.detectedAnchors.length || 1} MIN_Y=${i.minY.toFixed(4)}M AABB=[${i.aabbSize.join("x")}]M` : `WB=${i.wheelbase.toFixed(2)}M MIN_Y=${i.minY.toFixed(4)}M AABB=[${i.aabbSize.join("x")}]M`;
|
|
2369
|
-
return /* @__PURE__ */ O
|
|
2370
|
-
style:
|
|
2371
|
-
children: [/* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ A("div", {
|
|
2371
|
+
style: jt,
|
|
2372
|
+
children: [/* @__PURE__ */ A("div", {
|
|
2372
2373
|
style: {
|
|
2373
2374
|
display: "flex",
|
|
2374
2375
|
flexWrap: "wrap",
|
|
@@ -2376,10 +2377,10 @@ function kt(e) {
|
|
|
2376
2377
|
alignItems: "center"
|
|
2377
2378
|
},
|
|
2378
2379
|
children: [
|
|
2379
|
-
/* @__PURE__ */
|
|
2380
|
+
/* @__PURE__ */ k("span", {
|
|
2380
2381
|
style: {
|
|
2381
2382
|
fontSize: 11,
|
|
2382
|
-
color:
|
|
2383
|
+
color: Et,
|
|
2383
2384
|
fontWeight: 700
|
|
2384
2385
|
},
|
|
2385
2386
|
children: `KOLMO :: CAR CHOP-SHOP & GLB GATE · ${e.assetName.toUpperCase()}`
|
|
@@ -2391,36 +2392,36 @@ function kt(e) {
|
|
|
2391
2392
|
"person",
|
|
2392
2393
|
"prop",
|
|
2393
2394
|
"junk"
|
|
2394
|
-
].map((n) => /* @__PURE__ */
|
|
2395
|
+
].map((n) => /* @__PURE__ */ k(Y, {
|
|
2395
2396
|
label: `[ ${n.toUpperCase()} ]`,
|
|
2396
2397
|
active: t.domain === n,
|
|
2397
2398
|
onClick: () => e.onSelectDomain(n)
|
|
2398
2399
|
}, n)),
|
|
2399
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ k(Y, {
|
|
2400
2401
|
label: e.hasCustomFile ? "[ REPLACE .GLB · .USD… ]" : "[ DROP / OPEN .GLB · .USD ]",
|
|
2401
|
-
accent:
|
|
2402
|
+
accent: Dt,
|
|
2402
2403
|
onClick: e.onChooseFile
|
|
2403
2404
|
}),
|
|
2404
|
-
!e.hasCustomFile && t.domain === "vehicle" && /* @__PURE__ */ O
|
|
2405
|
+
!e.hasCustomFile && t.domain === "vehicle" && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(Y, {
|
|
2405
2406
|
label: "BLANK: SOLID PICKUP",
|
|
2406
2407
|
active: e.assetName === "pickup_truck",
|
|
2407
|
-
accent:
|
|
2408
|
+
accent: kt,
|
|
2408
2409
|
onClick: () => e.onLoadStarterCar("/models/pickup-truck.glb", "pickup_truck")
|
|
2409
|
-
}), /* @__PURE__ */
|
|
2410
|
+
}), /* @__PURE__ */ k(Y, {
|
|
2410
2411
|
label: "BLANK: HATCHBACK",
|
|
2411
2412
|
active: e.assetName === "hatchback_86",
|
|
2412
|
-
accent:
|
|
2413
|
+
accent: kt,
|
|
2413
2414
|
onClick: () => e.onLoadStarterCar("/models/Hatchback-segmented.glb", "hatchback_86")
|
|
2414
2415
|
})] }),
|
|
2415
|
-
e.usdInfo && /* @__PURE__ */
|
|
2416
|
+
e.usdInfo && /* @__PURE__ */ k("span", {
|
|
2416
2417
|
style: {
|
|
2417
2418
|
fontSize: 10,
|
|
2418
|
-
color:
|
|
2419
|
+
color: kt
|
|
2419
2420
|
},
|
|
2420
2421
|
children: e.usdInfo
|
|
2421
2422
|
})
|
|
2422
2423
|
]
|
|
2423
|
-
}), /* @__PURE__ */
|
|
2424
|
+
}), /* @__PURE__ */ A("div", {
|
|
2424
2425
|
style: {
|
|
2425
2426
|
display: "flex",
|
|
2426
2427
|
flexWrap: "wrap",
|
|
@@ -2428,37 +2429,37 @@ function kt(e) {
|
|
|
2428
2429
|
alignItems: "center"
|
|
2429
2430
|
},
|
|
2430
2431
|
children: [
|
|
2431
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ k(Y, {
|
|
2432
2433
|
label: t.eraMode === "dreamcast-60" ? "[ ERA: DREAMCAST 60FPS ]" : "[ ERA: PSX 1/3 ]",
|
|
2433
2434
|
active: t.eraMode === "psx-1-3",
|
|
2434
|
-
accent:
|
|
2435
|
+
accent: Dt,
|
|
2435
2436
|
onClick: () => t.setField("eraMode", t.eraMode === "dreamcast-60" ? "psx-1-3" : "dreamcast-60")
|
|
2436
2437
|
}),
|
|
2437
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ k(Y, {
|
|
2438
2439
|
label: "[ STEP 1: CHOP & CALIBRATE ]",
|
|
2439
2440
|
active: t.step === 1,
|
|
2440
2441
|
onClick: () => t.setField("step", 1)
|
|
2441
2442
|
}),
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ k(Y, {
|
|
2443
2444
|
label: "[ -> STEP 2: LIVE DRIVE TRACK (WASD) ]",
|
|
2444
2445
|
active: t.step === 2,
|
|
2445
2446
|
disabled: !n,
|
|
2446
|
-
accent: n ?
|
|
2447
|
+
accent: n ? Et : Ot,
|
|
2447
2448
|
onClick: () => t.setField("step", 2)
|
|
2448
2449
|
})
|
|
2449
2450
|
]
|
|
2450
2451
|
})]
|
|
2451
|
-
}), /* @__PURE__ */
|
|
2452
|
+
}), /* @__PURE__ */ A("div", {
|
|
2452
2453
|
style: {
|
|
2453
|
-
...
|
|
2454
|
+
...jt,
|
|
2454
2455
|
position: "absolute",
|
|
2455
2456
|
left: 0,
|
|
2456
2457
|
right: 0,
|
|
2457
2458
|
bottom: 0,
|
|
2458
2459
|
borderBottom: "none",
|
|
2459
|
-
borderTop: `1px solid ${
|
|
2460
|
+
borderTop: `1px solid ${Tt}`
|
|
2460
2461
|
},
|
|
2461
|
-
children: [t.step === 1 ? /* @__PURE__ */
|
|
2462
|
+
children: [t.step === 1 ? /* @__PURE__ */ A("div", {
|
|
2462
2463
|
style: {
|
|
2463
2464
|
display: "flex",
|
|
2464
2465
|
flexWrap: "wrap",
|
|
@@ -2466,65 +2467,65 @@ function kt(e) {
|
|
|
2466
2467
|
alignItems: "center"
|
|
2467
2468
|
},
|
|
2468
2469
|
children: [
|
|
2469
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ k(Y, {
|
|
2470
2471
|
label: "[ ROT X +90° ]",
|
|
2471
2472
|
onClick: () => e.onBumpTurn(0)
|
|
2472
2473
|
}),
|
|
2473
|
-
/* @__PURE__ */
|
|
2474
|
+
/* @__PURE__ */ k(Y, {
|
|
2474
2475
|
label: "[ ROT Y +90° ]",
|
|
2475
2476
|
onClick: () => e.onBumpTurn(1)
|
|
2476
2477
|
}),
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ k(Y, {
|
|
2478
2479
|
label: "[ ROT Z +90° ]",
|
|
2479
2480
|
onClick: () => e.onBumpTurn(2)
|
|
2480
2481
|
}),
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
+
/* @__PURE__ */ k(Y, {
|
|
2482
2483
|
label: "[ AUTO-SCALE SI ]",
|
|
2483
2484
|
onClick: e.onAutoScaleSi
|
|
2484
2485
|
}),
|
|
2485
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ k(Y, {
|
|
2486
2487
|
label: "[ SNAP TIRES Y=0 ]",
|
|
2487
2488
|
onClick: e.onSnapYZero
|
|
2488
2489
|
}),
|
|
2489
|
-
t.domain === "c12" && /* @__PURE__ */
|
|
2490
|
+
t.domain === "c12" && /* @__PURE__ */ k(Y, {
|
|
2490
2491
|
label: "[ SNAP 1/12M C12 ]",
|
|
2491
|
-
accent:
|
|
2492
|
+
accent: kt,
|
|
2492
2493
|
onClick: e.onSnapC12
|
|
2493
2494
|
}),
|
|
2494
|
-
t.domain === "vehicle" && /* @__PURE__ */ O
|
|
2495
|
+
t.domain === "vehicle" && /* @__PURE__ */ A(O, { children: [
|
|
2495
2496
|
[
|
|
2496
2497
|
"car",
|
|
2497
2498
|
"motorcycle",
|
|
2498
2499
|
"starcraft"
|
|
2499
|
-
].map((n) => /* @__PURE__ */
|
|
2500
|
+
].map((n) => /* @__PURE__ */ k(Y, {
|
|
2500
2501
|
label: n.toUpperCase(),
|
|
2501
2502
|
active: !t.usePaperShellProxy && t.vehicleArchetype === n,
|
|
2502
2503
|
onClick: () => e.onSelectVehicleSub(n)
|
|
2503
2504
|
}, n)),
|
|
2504
|
-
!t.usePaperShellProxy && t.vehicleArchetype !== "starcraft" && /* @__PURE__ */
|
|
2505
|
+
!t.usePaperShellProxy && t.vehicleArchetype !== "starcraft" && /* @__PURE__ */ k(Y, {
|
|
2505
2506
|
label: `[ AUTO-POP TIRES (${e.wheelCount}W) ]`,
|
|
2506
2507
|
onClick: e.onAutoPopWheels
|
|
2507
2508
|
}),
|
|
2508
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ k(Y, {
|
|
2509
2510
|
label: "[ C0 CRASH PROXY ]",
|
|
2510
2511
|
active: t.usePaperShellProxy,
|
|
2511
2512
|
onClick: e.onWrapProxy
|
|
2512
2513
|
})
|
|
2513
2514
|
] }),
|
|
2514
|
-
t.domain === "prop" && /* @__PURE__ */
|
|
2515
|
+
t.domain === "prop" && /* @__PURE__ */ k(Y, {
|
|
2515
2516
|
label: t.staticProp ? "[ STATIC HULL ]" : "[ DYNAMIC HULL ]",
|
|
2516
2517
|
active: t.staticProp,
|
|
2517
2518
|
onClick: () => t.setField("staticProp", !t.staticProp)
|
|
2518
2519
|
}),
|
|
2519
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ k("span", {
|
|
2520
2521
|
style: {
|
|
2521
2522
|
fontSize: 10.5,
|
|
2522
|
-
color: n ?
|
|
2523
|
+
color: n ? Dt : Ot
|
|
2523
2524
|
},
|
|
2524
2525
|
children: a
|
|
2525
2526
|
})
|
|
2526
2527
|
]
|
|
2527
|
-
}) : /* @__PURE__ */
|
|
2528
|
+
}) : /* @__PURE__ */ A("div", {
|
|
2528
2529
|
style: {
|
|
2529
2530
|
display: "flex",
|
|
2530
2531
|
flexWrap: "wrap",
|
|
@@ -2532,29 +2533,29 @@ function kt(e) {
|
|
|
2532
2533
|
alignItems: "center"
|
|
2533
2534
|
},
|
|
2534
2535
|
children: [
|
|
2535
|
-
/* @__PURE__ */
|
|
2536
|
+
/* @__PURE__ */ k(Y, {
|
|
2536
2537
|
label: "[ RESET / DROP ]",
|
|
2537
|
-
accent:
|
|
2538
|
+
accent: Et,
|
|
2538
2539
|
onClick: () => t.triggerDrop()
|
|
2539
2540
|
}),
|
|
2540
|
-
t.domain === "vehicle" && /* @__PURE__ */
|
|
2541
|
+
t.domain === "vehicle" && /* @__PURE__ */ k(Y, {
|
|
2541
2542
|
label: t.chaseCam ? "[ CAM: CHASE (WASD) ]" : "[ CAM: ORBIT ]",
|
|
2542
2543
|
active: t.chaseCam,
|
|
2543
|
-
accent:
|
|
2544
|
+
accent: kt,
|
|
2544
2545
|
onClick: () => t.setField("chaseCam", !t.chaseCam)
|
|
2545
2546
|
}),
|
|
2546
|
-
t.domain === "vehicle" && t.usePaperShellProxy ? /* @__PURE__ */ O
|
|
2547
|
-
/* @__PURE__ */
|
|
2547
|
+
t.domain === "vehicle" && t.usePaperShellProxy ? /* @__PURE__ */ A(O, { children: [
|
|
2548
|
+
/* @__PURE__ */ k(Y, {
|
|
2548
2549
|
label: t.wrenchMode === "UNLATCH_200" ? "[ WRENCH: 200 N·S UNLATCH ]" : "[ WRENCH: 1800 N·S RIP OFF ]",
|
|
2549
2550
|
active: t.wrenchMode === "RIP_1800",
|
|
2550
|
-
accent:
|
|
2551
|
+
accent: Ot,
|
|
2551
2552
|
onClick: () => t.setField("wrenchMode", t.wrenchMode === "UNLATCH_200" ? "RIP_1800" : "UNLATCH_200")
|
|
2552
2553
|
}),
|
|
2553
2554
|
[
|
|
2554
2555
|
"TRUCK",
|
|
2555
2556
|
"STREET",
|
|
2556
2557
|
"SPORT"
|
|
2557
|
-
].map((e) => /* @__PURE__ */
|
|
2558
|
+
].map((e) => /* @__PURE__ */ k(Y, {
|
|
2558
2559
|
label: e,
|
|
2559
2560
|
active: t.freqBucket === e,
|
|
2560
2561
|
onClick: () => t.setField("freqBucket", e)
|
|
@@ -2563,31 +2564,31 @@ function kt(e) {
|
|
|
2563
2564
|
"PLUSH",
|
|
2564
2565
|
"BALANCED",
|
|
2565
2566
|
"STIFF"
|
|
2566
|
-
].map((e) => /* @__PURE__ */
|
|
2567
|
+
].map((e) => /* @__PURE__ */ k(Y, {
|
|
2567
2568
|
label: e,
|
|
2568
2569
|
active: t.dampBucket === e,
|
|
2569
|
-
accent:
|
|
2570
|
+
accent: Dt,
|
|
2570
2571
|
onClick: () => t.setField("dampBucket", e)
|
|
2571
2572
|
}, e)),
|
|
2572
|
-
/* @__PURE__ */
|
|
2573
|
+
/* @__PURE__ */ k(Y, {
|
|
2573
2574
|
label: "[ RESET PANELS ]",
|
|
2574
2575
|
onClick: () => t.resetAllPanels()
|
|
2575
2576
|
})
|
|
2576
|
-
] }) : /* @__PURE__ */ O
|
|
2577
|
-
t.domain === "vehicle" && e.choppedCount > 0 && /* @__PURE__ */ O
|
|
2578
|
-
/* @__PURE__ */
|
|
2577
|
+
] }) : /* @__PURE__ */ A(O, { children: [
|
|
2578
|
+
t.domain === "vehicle" && e.choppedCount > 0 && /* @__PURE__ */ A(O, { children: [
|
|
2579
|
+
/* @__PURE__ */ k(Y, {
|
|
2579
2580
|
label: "[ SWING DOORS ]",
|
|
2580
|
-
accent:
|
|
2581
|
+
accent: Et,
|
|
2581
2582
|
onClick: () => e.onSwingPanelRole("door")
|
|
2582
2583
|
}),
|
|
2583
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ k(Y, {
|
|
2584
2585
|
label: "[ POP HOOD ]",
|
|
2585
|
-
accent:
|
|
2586
|
+
accent: kt,
|
|
2586
2587
|
onClick: () => e.onSwingPanelRole("hood")
|
|
2587
2588
|
}),
|
|
2588
|
-
/* @__PURE__ */
|
|
2589
|
+
/* @__PURE__ */ k(Y, {
|
|
2589
2590
|
label: "[ POP TRUNK ]",
|
|
2590
|
-
accent:
|
|
2591
|
+
accent: Dt,
|
|
2591
2592
|
onClick: () => e.onSwingPanelRole("trunk")
|
|
2592
2593
|
})
|
|
2593
2594
|
] }),
|
|
@@ -2598,46 +2599,46 @@ function kt(e) {
|
|
|
2598
2599
|
"brake_flare",
|
|
2599
2600
|
"headlight",
|
|
2600
2601
|
"seat"
|
|
2601
|
-
].map((t) => /* @__PURE__ */
|
|
2602
|
+
].map((t) => /* @__PURE__ */ k(Y, {
|
|
2602
2603
|
label: `STAMP:${t.toUpperCase()}`,
|
|
2603
2604
|
active: e.stampTool === t,
|
|
2604
2605
|
onClick: () => e.onSelectStampTool(t)
|
|
2605
2606
|
}, t)),
|
|
2606
|
-
e.patchCount > 0 && /* @__PURE__ */
|
|
2607
|
+
e.patchCount > 0 && /* @__PURE__ */ k(Y, {
|
|
2607
2608
|
label: `[ UNDO (${e.patchCount}) ]`,
|
|
2608
2609
|
onClick: e.onUndoPatch
|
|
2609
2610
|
})
|
|
2610
2611
|
] }),
|
|
2611
|
-
/* @__PURE__ */
|
|
2612
|
+
/* @__PURE__ */ k(Y, {
|
|
2612
2613
|
label: "[ DOWNLOAD KHR3 .GLB ]",
|
|
2613
2614
|
disabled: e.busy,
|
|
2614
|
-
accent:
|
|
2615
|
+
accent: Dt,
|
|
2615
2616
|
onClick: e.onDownloadGlb
|
|
2616
2617
|
}),
|
|
2617
|
-
e.onSpawnWorld && /* @__PURE__ */
|
|
2618
|
+
e.onSpawnWorld && /* @__PURE__ */ k(Y, {
|
|
2618
2619
|
label: e.busy ? "[ SEALING… ]" : "[ DRIVE ON LONG DRIVE -> ]",
|
|
2619
2620
|
disabled: e.busy,
|
|
2620
|
-
accent:
|
|
2621
|
+
accent: kt,
|
|
2621
2622
|
onClick: e.onSpawnWorld
|
|
2622
2623
|
})
|
|
2623
2624
|
]
|
|
2624
|
-
}), /* @__PURE__ */
|
|
2625
|
+
}), /* @__PURE__ */ k("span", {
|
|
2625
2626
|
ref: r,
|
|
2626
2627
|
style: {
|
|
2627
2628
|
fontSize: 10.5,
|
|
2628
|
-
color:
|
|
2629
|
+
color: Dt
|
|
2629
2630
|
}
|
|
2630
2631
|
})]
|
|
2631
2632
|
})] });
|
|
2632
2633
|
}
|
|
2633
2634
|
// src/importer/importerWebMcp.ts
|
|
2634
|
-
function
|
|
2635
|
+
function Nt() {
|
|
2635
2636
|
if (typeof navigator > "u") return null;
|
|
2636
2637
|
let e = navigator.modelContext;
|
|
2637
2638
|
return e && typeof e.registerTool == "function" ? e : null;
|
|
2638
2639
|
}
|
|
2639
|
-
function
|
|
2640
|
-
let t =
|
|
2640
|
+
function Pt(e) {
|
|
2641
|
+
let t = F();
|
|
2641
2642
|
return [
|
|
2642
2643
|
{
|
|
2643
2644
|
name: "importer_state",
|
|
@@ -2648,7 +2649,7 @@ function jt(e) {
|
|
|
2648
2649
|
},
|
|
2649
2650
|
annotations: { readOnlyHint: !0 },
|
|
2650
2651
|
execute: () => {
|
|
2651
|
-
let t =
|
|
2652
|
+
let t = J.getState();
|
|
2652
2653
|
return {
|
|
2653
2654
|
assetName: e.assetName,
|
|
2654
2655
|
domain: t.domain,
|
|
@@ -2685,12 +2686,12 @@ function jt(e) {
|
|
|
2685
2686
|
try {
|
|
2686
2687
|
let e = await t.listPrefix(n);
|
|
2687
2688
|
return {
|
|
2688
|
-
catalog:
|
|
2689
|
+
catalog: P,
|
|
2689
2690
|
liveVault: e
|
|
2690
2691
|
};
|
|
2691
2692
|
} catch {
|
|
2692
2693
|
return {
|
|
2693
|
-
catalog:
|
|
2694
|
+
catalog: P,
|
|
2694
2695
|
liveVault: null
|
|
2695
2696
|
};
|
|
2696
2697
|
}
|
|
@@ -2709,7 +2710,7 @@ function jt(e) {
|
|
|
2709
2710
|
},
|
|
2710
2711
|
execute: (e) => {
|
|
2711
2712
|
let t = e.step === 2 ? 2 : 1;
|
|
2712
|
-
return
|
|
2713
|
+
return J.getState().setField("step", t), {
|
|
2713
2714
|
ok: !0,
|
|
2714
2715
|
step: t
|
|
2715
2716
|
};
|
|
@@ -2860,11 +2861,11 @@ function jt(e) {
|
|
|
2860
2861
|
}
|
|
2861
2862
|
];
|
|
2862
2863
|
}
|
|
2863
|
-
function
|
|
2864
|
-
let n =
|
|
2865
|
-
return
|
|
2864
|
+
function Ft(e, t = !0) {
|
|
2865
|
+
let n = Nt();
|
|
2866
|
+
return u(() => {
|
|
2866
2867
|
if (!t || !n) return;
|
|
2867
|
-
let r = new AbortController(), i =
|
|
2868
|
+
let r = new AbortController(), i = Pt(e);
|
|
2868
2869
|
for (let e of i) n.registerTool(e, { signal: r.signal });
|
|
2869
2870
|
return () => {
|
|
2870
2871
|
r.abort();
|
|
@@ -2876,240 +2877,347 @@ function Mt(e, t = !0) {
|
|
|
2876
2877
|
e
|
|
2877
2878
|
]), !!(t && n);
|
|
2878
2879
|
}
|
|
2879
|
-
// src/importer/
|
|
2880
|
-
function
|
|
2881
|
-
let
|
|
2882
|
-
return n.setAttribute("position", new p.BufferAttribute(e, 3)), n.setAttribute("normal", new p.BufferAttribute(t, 3)), n;
|
|
2883
|
-
}
|
|
2884
|
-
function Pt(e) {
|
|
2885
|
-
let t = new p.Group();
|
|
2880
|
+
// src/importer/ImporterPlinthUikitTags.tsx
|
|
2881
|
+
function It(e) {
|
|
2882
|
+
let t = new m.Group();
|
|
2886
2883
|
t.name = `Starter_${e}`;
|
|
2887
|
-
let n = e === "c12" ? new
|
|
2884
|
+
let n = e === "c12" ? new m.BoxGeometry(3, 3, 3) : e === "person" ? new m.CapsuleGeometry(.3, 1, 6, 12) : e === "launcher" ? new m.BoxGeometry(.14, .24, .92) : e === "junk" ? new m.CylinderGeometry(.32, .34, .85, 12) : new m.BoxGeometry(1.72, 1.25, 4.25), r = new m.Mesh(n, new m.MeshStandardMaterial({
|
|
2888
2885
|
color: "#38bdf8",
|
|
2889
2886
|
roughness: .55,
|
|
2890
2887
|
flatShading: !0
|
|
2891
2888
|
}));
|
|
2892
2889
|
return r.position.y = e === "c12" ? 1.5 : e === "person" ? .88 : .65, t.add(r), t;
|
|
2893
2890
|
}
|
|
2894
|
-
|
|
2895
|
-
function
|
|
2896
|
-
let
|
|
2897
|
-
|
|
2891
|
+
new m.Vector3();
|
|
2892
|
+
function Lt({ position: e, label: t, sub: n, accent: r, onClick: i }) {
|
|
2893
|
+
let a = f(null), { camera: o } = _();
|
|
2894
|
+
return g(() => {
|
|
2895
|
+
a.current && a.current.quaternion.copy(o.quaternion);
|
|
2896
|
+
}), /* @__PURE__ */ k("group", {
|
|
2897
|
+
ref: a,
|
|
2898
|
+
position: [
|
|
2899
|
+
e[0],
|
|
2900
|
+
e[1],
|
|
2901
|
+
e[2]
|
|
2902
|
+
],
|
|
2903
|
+
children: /* @__PURE__ */ k(xe, {
|
|
2904
|
+
pixelSize: .0022,
|
|
2905
|
+
children: /* @__PURE__ */ A(be, {
|
|
2906
|
+
paddingX: 10,
|
|
2907
|
+
paddingY: 4,
|
|
2908
|
+
borderRadius: 999,
|
|
2909
|
+
backgroundColor: "rgba(9, 13, 24, 0.88)",
|
|
2910
|
+
borderWidth: 1.5,
|
|
2911
|
+
borderColor: r,
|
|
2912
|
+
flexDirection: "row",
|
|
2913
|
+
alignItems: "center",
|
|
2914
|
+
gap: 6,
|
|
2915
|
+
hover: { backgroundColor: "#1e293b" },
|
|
2916
|
+
onClick: i ? (e) => {
|
|
2917
|
+
e.stopPropagation(), i();
|
|
2918
|
+
} : void 0,
|
|
2919
|
+
children: [/* @__PURE__ */ k(Se, {
|
|
2920
|
+
fontSize: 12,
|
|
2921
|
+
fontWeight: "bold",
|
|
2922
|
+
color: r,
|
|
2923
|
+
children: t
|
|
2924
|
+
}), /* @__PURE__ */ k(Se, {
|
|
2925
|
+
fontSize: 11,
|
|
2926
|
+
color: "#cbd5e1",
|
|
2927
|
+
children: n
|
|
2928
|
+
})]
|
|
2929
|
+
})
|
|
2930
|
+
})
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
function Rt({ cal: e, islands: t, wheelColors: n, partPicks: r, explodeAmount: i, onClickIsland: a }) {
|
|
2934
|
+
let o = d(() => `${e.aabbSize[0].toFixed(2)}m W × ${e.aabbSize[1].toFixed(2)}m H × ${e.aabbSize[2].toFixed(2)}m L`, [e.aabbSize]), s = d(() => `Ymin ${e.minY >= 0 ? "+" : ""}${e.minY.toFixed(3)}m`, [e.minY]), c = d(() => {
|
|
2935
|
+
let e = [];
|
|
2936
|
+
for (let a of t) {
|
|
2937
|
+
let t = n.get(a.id), o = r[a.id];
|
|
2938
|
+
if (!t && !o) continue;
|
|
2939
|
+
let s = Math.sign(a.center[0] || 1) * i * .65, c = [
|
|
2940
|
+
a.center[0] + s,
|
|
2941
|
+
a.center[1] + a.size[1] * .5 + .16,
|
|
2942
|
+
a.center[2]
|
|
2943
|
+
];
|
|
2944
|
+
if (t) {
|
|
2945
|
+
let n = a.center[0] >= 0 ? "L" : "R", r = a.center[2] >= 0 ? "F" : "R";
|
|
2946
|
+
e.push({
|
|
2947
|
+
id: a.id,
|
|
2948
|
+
pos: c,
|
|
2949
|
+
label: `WHEEL ${r}${n}`,
|
|
2950
|
+
sub: `R ${(a.size[1] * .5).toFixed(2)}m`,
|
|
2951
|
+
accent: t
|
|
2952
|
+
});
|
|
2953
|
+
} else o && e.push({
|
|
2954
|
+
id: a.id,
|
|
2955
|
+
pos: c,
|
|
2956
|
+
label: o.toUpperCase(),
|
|
2957
|
+
sub: `${a.triangleIndices.length} tris`,
|
|
2958
|
+
accent: "#38bdf8"
|
|
2959
|
+
});
|
|
2960
|
+
if (e.length >= 12) break;
|
|
2961
|
+
}
|
|
2962
|
+
return e;
|
|
2963
|
+
}, [
|
|
2964
|
+
t,
|
|
2965
|
+
n,
|
|
2966
|
+
r,
|
|
2967
|
+
i
|
|
2968
|
+
]);
|
|
2969
|
+
return /* @__PURE__ */ A("group", { children: [/* @__PURE__ */ k(Lt, {
|
|
2970
|
+
position: [
|
|
2971
|
+
0,
|
|
2972
|
+
e.aabbSize[1] + e.minY + .34,
|
|
2973
|
+
0
|
|
2974
|
+
],
|
|
2975
|
+
label: "SI BOUNDS",
|
|
2976
|
+
sub: `${o} · ${s}`,
|
|
2977
|
+
accent: "#00e5ff"
|
|
2978
|
+
}), c.map((e) => /* @__PURE__ */ k(Lt, {
|
|
2979
|
+
position: e.pos,
|
|
2980
|
+
label: e.label,
|
|
2981
|
+
sub: e.sub,
|
|
2982
|
+
accent: e.accent,
|
|
2983
|
+
onClick: () => a(e.id)
|
|
2984
|
+
}, `pill_${e.id}`))] });
|
|
2985
|
+
}
|
|
2986
|
+
// src/importer/Step1CalibrationPlinth.tsx
|
|
2987
|
+
function zt(e, t) {
|
|
2988
|
+
let n = new m.BufferGeometry();
|
|
2989
|
+
return n.setAttribute("position", new m.BufferAttribute(e, 3)), n.setAttribute("normal", new m.BufferAttribute(t, 3)), n;
|
|
2990
|
+
}
|
|
2991
|
+
var Bt = Object.fromEntries(Pe.filter((e) => e.role !== "wheel").map((e) => [e.role, e.color]));
|
|
2992
|
+
function Vt(e) {
|
|
2993
|
+
let n = J((e) => e.calibration), r = f(!1), i = d(() => e.assembly.panels.map((e) => zt(e.localPositions, e.localNormals)), [e.assembly]), a = d(() => zt(e.assembly.wheels[0].positions, e.assembly.wheels[0].normals), [e.assembly]);
|
|
2994
|
+
u(() => {
|
|
2898
2995
|
let e = () => {
|
|
2899
2996
|
r.current = !1;
|
|
2900
2997
|
};
|
|
2901
2998
|
return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
|
|
2902
2999
|
}, []);
|
|
2903
|
-
let o =
|
|
2904
|
-
|
|
3000
|
+
let o = d(() => e.faceSelection ? e.islands.find((t) => t.id === e.faceSelection.islandId) ?? null : null, [e.faceSelection, e.islands]), s = d(() => o && e.faceSelection && e.faceSelection.triangles.length > 0 ? it(o.geometry, e.faceSelection.triangles, .0045) : null, [o, e.faceSelection]), c = d(() => o && e.faceSelection && e.faceSelection.mirrored.length > 0 ? it(o.geometry, e.faceSelection.mirrored, .0045) : null, [o, e.faceSelection]);
|
|
3001
|
+
u(() => () => {
|
|
2905
3002
|
s?.dispose();
|
|
2906
|
-
}, [s]),
|
|
3003
|
+
}, [s]), u(() => () => {
|
|
2907
3004
|
c?.dispose();
|
|
2908
3005
|
}, [c]);
|
|
2909
|
-
let
|
|
2910
|
-
if (!
|
|
2911
|
-
let
|
|
2912
|
-
return
|
|
2913
|
-
}, [
|
|
2914
|
-
if (
|
|
2915
|
-
let
|
|
2916
|
-
return
|
|
3006
|
+
let l = d(() => {
|
|
3007
|
+
if (!e.loopDots || e.loopDots.points.length < 2) return null;
|
|
3008
|
+
let t = e.islands.find((t) => t.id === e.loopDots.islandId);
|
|
3009
|
+
return t ? Qe(t, e.loopDots.points) : null;
|
|
3010
|
+
}, [e.loopDots, e.islands]), p = d(() => {
|
|
3011
|
+
if (e.wheelSource !== "fleet12" || e.islands.length === 0) return [];
|
|
3012
|
+
let t = [];
|
|
3013
|
+
return e.axles.forEach((n, r) => {
|
|
2917
3014
|
for (let [i, a] of [["L", n.left], ["R", n.right]]) {
|
|
2918
3015
|
if (a.length === 0) continue;
|
|
2919
|
-
let n =
|
|
2920
|
-
|
|
3016
|
+
let n = R(e.islands, a), o = Math.max(.14, n.radius), s = Math.max(.1, n.halfWidth * 2);
|
|
3017
|
+
t.push({
|
|
2921
3018
|
key: `f12_${r}_${i}`,
|
|
2922
3019
|
pos: n.center,
|
|
2923
|
-
group:
|
|
3020
|
+
group: at(o, s)
|
|
2924
3021
|
});
|
|
2925
3022
|
}
|
|
2926
|
-
}),
|
|
3023
|
+
}), t;
|
|
2927
3024
|
}, [
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
]), h = (
|
|
2932
|
-
|
|
3025
|
+
e.wheelSource,
|
|
3026
|
+
e.axles,
|
|
3027
|
+
e.islands
|
|
3028
|
+
]), h = (t, n, r) => {
|
|
3029
|
+
t.faceIndex != null && (t.stopPropagation(), e.onPickFace({
|
|
2933
3030
|
islandId: n,
|
|
2934
|
-
faceIndex:
|
|
3031
|
+
faceIndex: t.faceIndex,
|
|
2935
3032
|
point: [
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
3033
|
+
t.point.x,
|
|
3034
|
+
t.point.y,
|
|
3035
|
+
t.point.z
|
|
2939
3036
|
],
|
|
2940
|
-
erase: !!(
|
|
3037
|
+
erase: !!(t.altKey || t.button === 2),
|
|
2941
3038
|
isDrag: r
|
|
2942
3039
|
}));
|
|
2943
3040
|
};
|
|
2944
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ k(v, {
|
|
2945
3042
|
fit: !0,
|
|
2946
3043
|
clip: !0,
|
|
2947
3044
|
margin: 1.38,
|
|
2948
|
-
children: /* @__PURE__ */
|
|
3045
|
+
children: /* @__PURE__ */ A(y, {
|
|
2949
3046
|
firstHitOnly: !0,
|
|
2950
|
-
children: [/* @__PURE__ */
|
|
2951
|
-
ref:
|
|
2952
|
-
children: [
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
}, e.partId)),
|
|
2966
|
-
t.assembly.wheels.map((e) => /* @__PURE__ */ D("group", {
|
|
2967
|
-
position: e.position,
|
|
2968
|
-
children: /* @__PURE__ */ D("mesh", {
|
|
2969
|
-
geometry: a,
|
|
2970
|
-
children: /* @__PURE__ */ D("meshStandardMaterial", {
|
|
2971
|
-
color: 1843753,
|
|
2972
|
-
roughness: .9,
|
|
2973
|
-
flatShading: !0
|
|
3047
|
+
children: [/* @__PURE__ */ A("group", {
|
|
3048
|
+
ref: e.rootObjRef,
|
|
3049
|
+
children: [
|
|
3050
|
+
e.useProxy ? /* @__PURE__ */ A(O, { children: [
|
|
3051
|
+
e.previewScene && /* @__PURE__ */ k("primitive", { object: e.previewScene }),
|
|
3052
|
+
e.assembly.panels.map((t, n) => /* @__PURE__ */ k("mesh", {
|
|
3053
|
+
position: t.anchorChassis,
|
|
3054
|
+
geometry: i[n],
|
|
3055
|
+
children: /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3056
|
+
color: t.colorHex,
|
|
3057
|
+
roughness: t.isGlass ? .15 : .88,
|
|
3058
|
+
transparent: t.isGlass || !!e.previewScene,
|
|
3059
|
+
opacity: e.previewScene ? .28 : t.isGlass ? .32 : 1,
|
|
3060
|
+
wireframe: !!e.previewScene,
|
|
3061
|
+
flatShading: e.assembly.shadingMode === "psx-flat"
|
|
2974
3062
|
})
|
|
2975
|
-
})
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
let
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
3063
|
+
}, t.partId)),
|
|
3064
|
+
e.assembly.wheels.map((e) => /* @__PURE__ */ k("group", {
|
|
3065
|
+
position: e.position,
|
|
3066
|
+
children: /* @__PURE__ */ k("mesh", {
|
|
3067
|
+
geometry: a,
|
|
3068
|
+
children: /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3069
|
+
color: 1843753,
|
|
3070
|
+
roughness: .9,
|
|
3071
|
+
flatShading: !0
|
|
3072
|
+
})
|
|
3073
|
+
})
|
|
3074
|
+
}, e.slotId))
|
|
3075
|
+
] }) : e.islands.length > 0 ? /* @__PURE__ */ A(O, { children: [
|
|
3076
|
+
e.islands.map((n) => {
|
|
3077
|
+
let i = e.wheelColors.get(n.id), a = i ? void 0 : e.partPicks[n.id], o = i ?? (a ? Bt[a] : void 0);
|
|
3078
|
+
if (i && e.wheelSource === "fleet12") return null;
|
|
3079
|
+
let s = [
|
|
3080
|
+
0,
|
|
3081
|
+
0,
|
|
3082
|
+
0
|
|
3083
|
+
], c = [
|
|
3084
|
+
0,
|
|
3085
|
+
0,
|
|
3086
|
+
0
|
|
3087
|
+
], l = new m.Quaternion();
|
|
3088
|
+
if (a && (e.hingeScrub > 0 || e.explodeAmount > 0)) {
|
|
3089
|
+
let r = t(n, a);
|
|
3090
|
+
c = r.anchor, e.hingeScrub > 0 && l.setFromAxisAngle(new m.Vector3(...r.axis).normalize(), r.openAngle * e.hingeScrub), e.explodeAmount > 0 && (s = [
|
|
3091
|
+
r.explodeDir[0] * e.explodeAmount,
|
|
3092
|
+
r.explodeDir[1] * e.explodeAmount,
|
|
3093
|
+
r.explodeDir[2] * e.explodeAmount
|
|
3094
|
+
]);
|
|
3095
|
+
} else i && e.explodeAmount > 0 && (s = [
|
|
3096
|
+
Math.sign(n.center[0] || 1) * e.explodeAmount * .65,
|
|
3097
|
+
0,
|
|
3098
|
+
0
|
|
2996
3099
|
]);
|
|
2997
|
-
|
|
2998
|
-
Math.sign(n.center[0] || 1) * t.explodeAmount * .65,
|
|
2999
|
-
0,
|
|
3000
|
-
0
|
|
3001
|
-
]);
|
|
3002
|
-
return /* @__PURE__ */ D("group", {
|
|
3003
|
-
position: [
|
|
3004
|
-
c[0] + s[0],
|
|
3005
|
-
c[1] + s[1],
|
|
3006
|
-
c[2] + s[2]
|
|
3007
|
-
],
|
|
3008
|
-
quaternion: l,
|
|
3009
|
-
children: /* @__PURE__ */ O("group", {
|
|
3100
|
+
return /* @__PURE__ */ k("group", {
|
|
3010
3101
|
position: [
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3102
|
+
c[0] + s[0],
|
|
3103
|
+
c[1] + s[1],
|
|
3104
|
+
c[2] + s[2]
|
|
3014
3105
|
],
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3106
|
+
quaternion: l,
|
|
3107
|
+
children: /* @__PURE__ */ A("group", {
|
|
3108
|
+
position: [
|
|
3109
|
+
-c[0],
|
|
3110
|
+
-c[1],
|
|
3111
|
+
-c[2]
|
|
3112
|
+
],
|
|
3113
|
+
children: [/* @__PURE__ */ k("mesh", {
|
|
3114
|
+
geometry: n.geometry,
|
|
3115
|
+
material: n.material,
|
|
3116
|
+
onClick: (t) => {
|
|
3117
|
+
t.delta > 5 || (e.surfaceMode === "island" ? (t.stopPropagation(), e.onClickIsland(n.id)) : e.surfaceMode !== "triangle" && h(t, n.id, !1));
|
|
3118
|
+
},
|
|
3119
|
+
onContextMenu: (t) => {
|
|
3120
|
+
e.surfaceMode !== "island" && h(t, n.id, !1);
|
|
3121
|
+
},
|
|
3122
|
+
onPointerDown: (t) => {
|
|
3123
|
+
e.surfaceMode === "triangle" && (t.button === 0 || t.button === 2) && (r.current = !0, h(t, n.id, !1));
|
|
3124
|
+
},
|
|
3125
|
+
onPointerMove: (t) => {
|
|
3126
|
+
e.surfaceMode === "triangle" && r.current && h(t, n.id, !0);
|
|
3127
|
+
}
|
|
3128
|
+
}), o && /* @__PURE__ */ k("mesh", {
|
|
3129
|
+
geometry: n.geometry,
|
|
3130
|
+
raycast: () => null,
|
|
3131
|
+
children: /* @__PURE__ */ k("meshBasicMaterial", {
|
|
3132
|
+
color: o,
|
|
3133
|
+
transparent: !0,
|
|
3134
|
+
opacity: .38,
|
|
3135
|
+
depthWrite: !1
|
|
3136
|
+
})
|
|
3137
|
+
})]
|
|
3138
|
+
})
|
|
3139
|
+
}, n.id);
|
|
3140
|
+
}),
|
|
3141
|
+
p.map((t) => /* @__PURE__ */ k("primitive", {
|
|
3142
|
+
object: t.group,
|
|
3143
|
+
position: [
|
|
3144
|
+
t.pos[0] + Math.sign(t.pos[0] || 1) * e.explodeAmount * .65,
|
|
3145
|
+
t.pos[1],
|
|
3146
|
+
t.pos[2]
|
|
3147
|
+
]
|
|
3148
|
+
}, t.key)),
|
|
3149
|
+
s && /* @__PURE__ */ k("mesh", {
|
|
3150
|
+
geometry: s,
|
|
3151
|
+
raycast: () => null,
|
|
3152
|
+
children: /* @__PURE__ */ k("meshBasicMaterial", {
|
|
3153
|
+
color: e.activeRoleColor,
|
|
3154
|
+
transparent: !0,
|
|
3155
|
+
opacity: .62,
|
|
3156
|
+
side: m.DoubleSide,
|
|
3157
|
+
depthWrite: !1
|
|
3040
3158
|
})
|
|
3041
|
-
},
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3159
|
+
}),
|
|
3160
|
+
c && /* @__PURE__ */ k("mesh", {
|
|
3161
|
+
geometry: c,
|
|
3162
|
+
raycast: () => null,
|
|
3163
|
+
children: /* @__PURE__ */ k("meshBasicMaterial", {
|
|
3164
|
+
color: "#00E5FF",
|
|
3165
|
+
transparent: !0,
|
|
3166
|
+
opacity: .48,
|
|
3167
|
+
side: m.DoubleSide,
|
|
3168
|
+
depthWrite: !1
|
|
3169
|
+
})
|
|
3170
|
+
}),
|
|
3171
|
+
e.loopDots?.points.map((e, t) => /* @__PURE__ */ A("mesh", {
|
|
3172
|
+
position: [
|
|
3173
|
+
e[0],
|
|
3174
|
+
e[1],
|
|
3175
|
+
e[2]
|
|
3176
|
+
],
|
|
3177
|
+
raycast: () => null,
|
|
3178
|
+
children: [/* @__PURE__ */ k("sphereGeometry", { args: [
|
|
3179
|
+
.032,
|
|
3180
|
+
10,
|
|
3181
|
+
10
|
|
3182
|
+
] }), /* @__PURE__ */ k("meshBasicMaterial", {
|
|
3183
|
+
color: t === 0 ? "#10B981" : "#FFB000",
|
|
3184
|
+
depthTest: !1
|
|
3185
|
+
})]
|
|
3186
|
+
}, `dot_${t}`)),
|
|
3187
|
+
l && l.length >= 2 && /* @__PURE__ */ k(x, {
|
|
3188
|
+
points: l,
|
|
3189
|
+
color: "#FFB000",
|
|
3190
|
+
lineWidth: 2.5
|
|
3071
3191
|
})
|
|
3072
|
-
}),
|
|
3073
|
-
|
|
3192
|
+
] }) : e.previewScene && /* @__PURE__ */ k("primitive", { object: e.previewScene }),
|
|
3193
|
+
/* @__PURE__ */ A("mesh", {
|
|
3074
3194
|
position: [
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3195
|
+
0,
|
|
3196
|
+
n.aabbSize[1] * .5 + n.minY,
|
|
3197
|
+
0
|
|
3078
3198
|
],
|
|
3079
3199
|
raycast: () => null,
|
|
3080
|
-
children: [/* @__PURE__ */
|
|
3081
|
-
.
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
] }), /* @__PURE__ */
|
|
3085
|
-
color:
|
|
3086
|
-
|
|
3200
|
+
children: [/* @__PURE__ */ k("boxGeometry", { args: [
|
|
3201
|
+
n.aabbSize[0],
|
|
3202
|
+
n.aabbSize[1],
|
|
3203
|
+
n.aabbSize[2]
|
|
3204
|
+
] }), /* @__PURE__ */ k("meshBasicMaterial", {
|
|
3205
|
+
color: 58879,
|
|
3206
|
+
wireframe: !0,
|
|
3207
|
+
transparent: !0,
|
|
3208
|
+
opacity: .28
|
|
3087
3209
|
})]
|
|
3088
|
-
}
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3210
|
+
}),
|
|
3211
|
+
/* @__PURE__ */ k(Rt, {
|
|
3212
|
+
cal: n,
|
|
3213
|
+
islands: e.islands,
|
|
3214
|
+
wheelColors: e.wheelColors,
|
|
3215
|
+
partPicks: e.partPicks,
|
|
3216
|
+
explodeAmount: e.explodeAmount,
|
|
3217
|
+
onClickIsland: e.onClickIsland
|
|
3093
3218
|
})
|
|
3094
|
-
]
|
|
3095
|
-
|
|
3096
|
-
0,
|
|
3097
|
-
n.aabbSize[1] * .5 + n.minY,
|
|
3098
|
-
0
|
|
3099
|
-
],
|
|
3100
|
-
raycast: () => null,
|
|
3101
|
-
children: [/* @__PURE__ */ D("boxGeometry", { args: [
|
|
3102
|
-
n.aabbSize[0],
|
|
3103
|
-
n.aabbSize[1],
|
|
3104
|
-
n.aabbSize[2]
|
|
3105
|
-
] }), /* @__PURE__ */ D("meshBasicMaterial", {
|
|
3106
|
-
color: 58879,
|
|
3107
|
-
wireframe: !0,
|
|
3108
|
-
transparent: !0,
|
|
3109
|
-
opacity: .28
|
|
3110
|
-
})]
|
|
3111
|
-
})]
|
|
3112
|
-
}), /* @__PURE__ */ O("mesh", {
|
|
3219
|
+
]
|
|
3220
|
+
}), /* @__PURE__ */ A("mesh", {
|
|
3113
3221
|
position: [
|
|
3114
3222
|
0,
|
|
3115
3223
|
.01,
|
|
@@ -3121,11 +3229,11 @@ function It(t) {
|
|
|
3121
3229
|
0
|
|
3122
3230
|
],
|
|
3123
3231
|
raycast: () => null,
|
|
3124
|
-
children: [/* @__PURE__ */
|
|
3232
|
+
children: [/* @__PURE__ */ k("coneGeometry", { args: [
|
|
3125
3233
|
.25,
|
|
3126
3234
|
.6,
|
|
3127
3235
|
3
|
|
3128
|
-
] }), /* @__PURE__ */
|
|
3236
|
+
] }), /* @__PURE__ */ k("meshBasicMaterial", {
|
|
3129
3237
|
color: 58879,
|
|
3130
3238
|
wireframe: !0
|
|
3131
3239
|
})]
|
|
@@ -3134,7 +3242,7 @@ function It(t) {
|
|
|
3134
3242
|
});
|
|
3135
3243
|
}
|
|
3136
3244
|
// src/importer/glbNormalizer.ts
|
|
3137
|
-
var
|
|
3245
|
+
var Ht = 1 / 12, Ut = Object.freeze([
|
|
3138
3246
|
"IK_Palm_Primary",
|
|
3139
3247
|
"IK_Index_Trigger",
|
|
3140
3248
|
"IK_Thumb_Safety",
|
|
@@ -3147,18 +3255,18 @@ var Lt = 1 / 12, Rt = Object.freeze([
|
|
|
3147
3255
|
"Socket_Holster",
|
|
3148
3256
|
"Socket_Seat",
|
|
3149
3257
|
"Socket_Optic"
|
|
3150
|
-
]),
|
|
3151
|
-
function
|
|
3258
|
+
]), Wt = new m.Box3(), X = new m.Vector3();
|
|
3259
|
+
function Gt(e) {
|
|
3152
3260
|
return [
|
|
3153
3261
|
e[0] * .5,
|
|
3154
3262
|
e[1] * .5,
|
|
3155
3263
|
e[2] * .5
|
|
3156
3264
|
];
|
|
3157
3265
|
}
|
|
3158
|
-
function
|
|
3266
|
+
function Kt(e) {
|
|
3159
3267
|
return Number((Math.max(1, Math.round(e * 12)) / 12).toFixed(6));
|
|
3160
3268
|
}
|
|
3161
|
-
function
|
|
3269
|
+
function qt(e) {
|
|
3162
3270
|
let t = [
|
|
3163
3271
|
Math.round(e[0] * 12),
|
|
3164
3272
|
Math.round(e[1] * 12),
|
|
@@ -3169,14 +3277,14 @@ function Vt(e) {
|
|
|
3169
3277
|
c12Aligned: t.every((e) => e >= 1) && Math.abs(e[0] * 12 - t[0]) <= .06 && Math.abs(e[1] * 12 - t[1]) <= .06 && Math.abs(e[2] * 12 - t[2]) <= .06
|
|
3170
3278
|
};
|
|
3171
3279
|
}
|
|
3172
|
-
function
|
|
3280
|
+
function Jt(e) {
|
|
3173
3281
|
if (!e) return [];
|
|
3174
3282
|
let t = /* @__PURE__ */ new Set();
|
|
3175
3283
|
return e.traverse((e) => {
|
|
3176
|
-
e.name && (
|
|
3284
|
+
e.name && (Ut.includes(e.name) || e.name.startsWith("IK_") || e.name.startsWith("Socket_") || e.name.startsWith("Kolmo_")) && t.add(e.name);
|
|
3177
3285
|
}), [...t];
|
|
3178
3286
|
}
|
|
3179
|
-
function
|
|
3287
|
+
function Yt(e, t) {
|
|
3180
3288
|
return e === "c12" ? {
|
|
3181
3289
|
len: 3,
|
|
3182
3290
|
massKg: 0,
|
|
@@ -3211,12 +3319,12 @@ function Ut(e, t) {
|
|
|
3211
3319
|
power: 260
|
|
3212
3320
|
};
|
|
3213
3321
|
}
|
|
3214
|
-
function
|
|
3322
|
+
function Xt(e, t = 1, n = 0, r = !1, i = null) {
|
|
3215
3323
|
let a = e.lattice.preset, o = a.wheelbase * t, s = a.trackWidth * t, c = Number((a.wheelRadius * t).toFixed(3)), l = (e.lattice.rings[e.lattice.rings.length - 1].z - e.lattice.rings[0].z) * t, u = [
|
|
3216
3324
|
Number((a.halfWidth * 2 * t).toFixed(3)),
|
|
3217
3325
|
Number((a.roofY * t).toFixed(3)),
|
|
3218
3326
|
Number(l.toFixed(3))
|
|
3219
|
-
], { c12Ticks: d, c12Aligned: f } =
|
|
3327
|
+
], { c12Ticks: d, c12Aligned: f } = qt(u), p = {
|
|
3220
3328
|
wheelbase: Number(o.toFixed(3)),
|
|
3221
3329
|
trackWidth: Number(s.toFixed(3)),
|
|
3222
3330
|
wheelRadii: [
|
|
@@ -3229,18 +3337,18 @@ function Wt(e, t = 1, n = 0, r = !1, i = null) {
|
|
|
3229
3337
|
aabbSize: u,
|
|
3230
3338
|
c12Ticks: d,
|
|
3231
3339
|
c12Aligned: f,
|
|
3232
|
-
detectedAnchors:
|
|
3340
|
+
detectedAnchors: Jt(i),
|
|
3233
3341
|
isSingleMeshProxy: r
|
|
3234
3342
|
};
|
|
3235
|
-
return
|
|
3343
|
+
return J.getState().setCalibration(p), p;
|
|
3236
3344
|
}
|
|
3237
|
-
function
|
|
3238
|
-
e.updateMatrixWorld(!0),
|
|
3345
|
+
function Zt(e, t = 0) {
|
|
3346
|
+
e.updateMatrixWorld(!0), Wt.setFromObject(e), Wt.isEmpty() ? X.set(1, 1, 1) : Wt.getSize(X);
|
|
3239
3347
|
let n = [
|
|
3240
3348
|
Number(X.x.toFixed(3)),
|
|
3241
3349
|
Number(X.y.toFixed(3)),
|
|
3242
3350
|
Number(X.z.toFixed(3))
|
|
3243
|
-
], r = Number(Math.max(1.25, X.z * .62).toFixed(3)), i = Number(Math.max(.4, X.x * .82).toFixed(3)), a = Number(Math.max(.2, Math.min(.45, X.y * .24)).toFixed(3)), { c12Ticks: o, c12Aligned: s } =
|
|
3351
|
+
], r = Number(Math.max(1.25, X.z * .62).toFixed(3)), i = Number(Math.max(.4, X.x * .82).toFixed(3)), a = Number(Math.max(.2, Math.min(.45, X.y * .24)).toFixed(3)), { c12Ticks: o, c12Aligned: s } = qt(n), c = {
|
|
3244
3352
|
wheelbase: r,
|
|
3245
3353
|
trackWidth: i,
|
|
3246
3354
|
wheelRadii: [
|
|
@@ -3249,36 +3357,36 @@ function Gt(e, t = 0) {
|
|
|
3249
3357
|
a,
|
|
3250
3358
|
a
|
|
3251
3359
|
],
|
|
3252
|
-
minY: Number(((
|
|
3360
|
+
minY: Number(((Wt.isEmpty() ? 0 : Wt.min.y) + t).toFixed(4)),
|
|
3253
3361
|
aabbSize: n,
|
|
3254
3362
|
c12Ticks: o,
|
|
3255
3363
|
c12Aligned: s,
|
|
3256
|
-
detectedAnchors:
|
|
3364
|
+
detectedAnchors: Jt(e),
|
|
3257
3365
|
isSingleMeshProxy: !1
|
|
3258
3366
|
};
|
|
3259
|
-
return
|
|
3367
|
+
return J.getState().setCalibration(c), c;
|
|
3260
3368
|
}
|
|
3261
|
-
function
|
|
3369
|
+
function Qt(e, t = "coupe_86", n = "psx-flat") {
|
|
3262
3370
|
let r = ve(t, n);
|
|
3263
|
-
if (!e) return
|
|
3264
|
-
if (
|
|
3265
|
-
|
|
3371
|
+
if (!e) return Xt(r, 1, 0, !0, null), r;
|
|
3372
|
+
if (Wt.setFromObject(e), Wt.isEmpty()) return Xt(r, 1, 0, !0, e), r;
|
|
3373
|
+
Wt.getSize(X);
|
|
3266
3374
|
let i = r.lattice.rings[r.lattice.rings.length - 1].z - r.lattice.rings[0].z;
|
|
3267
|
-
return
|
|
3375
|
+
return Xt(r, X.z > .2 ? Math.max(.5, Math.min(2, X.z / i)) : 1, 0, !0, e), r;
|
|
3268
3376
|
}
|
|
3269
3377
|
// src/importer/ImperativeVehicleRig.tsx
|
|
3270
|
-
var
|
|
3271
|
-
function
|
|
3272
|
-
let n = new
|
|
3273
|
-
return n.setAttribute("position", new
|
|
3378
|
+
var $t = new m.Vector3(), en = new m.Vector3(), tn = new m.Vector3(), nn = new m.Quaternion();
|
|
3379
|
+
function rn(e, t) {
|
|
3380
|
+
let n = new m.BufferGeometry();
|
|
3381
|
+
return n.setAttribute("position", new m.BufferAttribute(e, 3)), n.setAttribute("normal", new m.BufferAttribute(t, 3)), n;
|
|
3274
3382
|
}
|
|
3275
|
-
function
|
|
3276
|
-
let a =
|
|
3383
|
+
function an({ chassisBodyRef: e, panel: t, massKg: n, geometry: r, onWrenchHit: i }) {
|
|
3384
|
+
let a = f(null), o = t.breakaway.hingeAxisLocal ?? [
|
|
3277
3385
|
1,
|
|
3278
3386
|
0,
|
|
3279
3387
|
0
|
|
3280
3388
|
], s = t.breakaway.swingMinMaxRad ?? [-1.1, 1.1];
|
|
3281
|
-
return
|
|
3389
|
+
return ne(e, a, [
|
|
3282
3390
|
t.anchorChassis,
|
|
3283
3391
|
[
|
|
3284
3392
|
0,
|
|
@@ -3287,18 +3395,18 @@ function Qt({ chassisBodyRef: e, panel: t, massKg: n, geometry: r, onWrenchHit:
|
|
|
3287
3395
|
],
|
|
3288
3396
|
o,
|
|
3289
3397
|
s
|
|
3290
|
-
]), /* @__PURE__ */
|
|
3398
|
+
]), /* @__PURE__ */ A(M, {
|
|
3291
3399
|
ref: a,
|
|
3292
3400
|
position: t.anchorChassis,
|
|
3293
3401
|
mass: n,
|
|
3294
3402
|
colliders: !1,
|
|
3295
3403
|
canSleep: !1,
|
|
3296
|
-
children: [/* @__PURE__ */
|
|
3404
|
+
children: [/* @__PURE__ */ k(j, { args: Gt(t.aabbSize) }), /* @__PURE__ */ k("mesh", {
|
|
3297
3405
|
geometry: r,
|
|
3298
3406
|
onClick: (e) => {
|
|
3299
3407
|
e.stopPropagation(), i(t);
|
|
3300
3408
|
},
|
|
3301
|
-
children: /* @__PURE__ */
|
|
3409
|
+
children: /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3302
3410
|
color: t.colorHex,
|
|
3303
3411
|
roughness: .85,
|
|
3304
3412
|
flatShading: !0
|
|
@@ -3306,16 +3414,16 @@ function Qt({ chassisBodyRef: e, panel: t, massKg: n, geometry: r, onWrenchHit:
|
|
|
3306
3414
|
})]
|
|
3307
3415
|
});
|
|
3308
3416
|
}
|
|
3309
|
-
function
|
|
3310
|
-
let r =
|
|
3417
|
+
function on({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
3418
|
+
let r = f(null), i = f(null), a = f(J.getState().dropTrigger), o = f({
|
|
3311
3419
|
w: !1,
|
|
3312
3420
|
s: !1,
|
|
3313
3421
|
a: !1,
|
|
3314
3422
|
d: !1,
|
|
3315
3423
|
space: !1
|
|
3316
|
-
}), s =
|
|
3317
|
-
|
|
3318
|
-
|
|
3424
|
+
}), s = J((e) => e.attachedMask), c = J((e) => e.unlatchedMask), l = J((e) => e.fuelLiters), p = J((e) => e.freqBucket), m = J((e) => e.dampBucket), h = J((e) => e.detachedDebris), _ = d(() => new _e(e), [e]), v = d(() => _.getPanelIntrinsics(), [_]), y = d(() => e.panels.map((e) => rn(e.localPositions, e.localNormals)), [e]), b = d(() => rn(e.skateboardPositions, e.skateboardNormals), [e]), x = d(() => rn(e.wheels[0].positions, e.wheels[0].normals), [e]), S = d(() => t ? t.clone(!0) : null, [t]);
|
|
3425
|
+
u(() => {
|
|
3426
|
+
q.massDirty = !0;
|
|
3319
3427
|
let e = (e) => (t) => {
|
|
3320
3428
|
(t.code === "KeyW" || t.code === "ArrowUp") && (o.current.w = e), (t.code === "KeyS" || t.code === "ArrowDown") && (o.current.s = e), (t.code === "KeyA" || t.code === "ArrowLeft") && (o.current.a = e), (t.code === "KeyD" || t.code === "ArrowRight") && (o.current.d = e), t.code === "Space" && (o.current.space = e);
|
|
3321
3429
|
}, t = e(!0), n = e(!1);
|
|
@@ -3327,11 +3435,11 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3327
3435
|
p,
|
|
3328
3436
|
m
|
|
3329
3437
|
]);
|
|
3330
|
-
let C = _.evaluate(s,
|
|
3331
|
-
|
|
3438
|
+
let C = _.evaluate(s, l), w = 2 * Math.PI * xt[p], T = St[m], E = C.totalMassKg * .5 * C.frontAxleRatio, D = C.totalMassKg * .5 - E, ee = E * w * w, ne = D * w * w, re = 2 * T * Math.sqrt(ee * E), ie = 2 * T * Math.sqrt(ne * D);
|
|
3439
|
+
te(() => {
|
|
3332
3440
|
let e = r.current?.body ?? null;
|
|
3333
3441
|
if (i.current = e, !e) return;
|
|
3334
|
-
let t =
|
|
3442
|
+
let t = J.getState().dropTrigger;
|
|
3335
3443
|
if (t !== a.current && (a.current = t, e.setTranslation({
|
|
3336
3444
|
x: 0,
|
|
3337
3445
|
y: 1.2,
|
|
@@ -3344,9 +3452,9 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3344
3452
|
x: 0,
|
|
3345
3453
|
y: 0,
|
|
3346
3454
|
z: 0
|
|
3347
|
-
}, !0)),
|
|
3348
|
-
|
|
3349
|
-
let t =
|
|
3455
|
+
}, !0)), q.massDirty) {
|
|
3456
|
+
q.massDirty = !1;
|
|
3457
|
+
let t = J.getState(), n = _.evaluate(t.attachedMask, t.fuelLiters);
|
|
3350
3458
|
e.setAdditionalMassProperties(n.totalMassKg, {
|
|
3351
3459
|
x: n.centerOfMass[0],
|
|
3352
3460
|
y: n.centerOfMass[1],
|
|
@@ -3360,9 +3468,9 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3360
3468
|
y: n.inertiaOrientation[1],
|
|
3361
3469
|
z: n.inertiaOrientation[2],
|
|
3362
3470
|
w: n.inertiaOrientation[3]
|
|
3363
|
-
}, !0),
|
|
3471
|
+
}, !0), q.massKg = n.totalMassKg, q.com = [...n.centerOfMass], q.frontSplit = n.frontAxleRatio, q.cornerK = [ee, ne];
|
|
3364
3472
|
}
|
|
3365
|
-
}),
|
|
3473
|
+
}), g(() => {
|
|
3366
3474
|
let e = r.current;
|
|
3367
3475
|
if (!e) return;
|
|
3368
3476
|
let t = o.current;
|
|
@@ -3372,13 +3480,13 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3372
3480
|
steerLeft: t.a,
|
|
3373
3481
|
steerRight: t.d,
|
|
3374
3482
|
brake: t.space
|
|
3375
|
-
}),
|
|
3483
|
+
}), q.speedKmh = e.currLinVel.length() * 3.6, q.rpm = Math.max(850, e.engineRPM);
|
|
3376
3484
|
});
|
|
3377
3485
|
let ae = (e) => {
|
|
3378
|
-
let t =
|
|
3486
|
+
let t = J.getState(), n = 1 << e.bitIndex, i = t.wrenchMode === "UNLATCH_200" ? 200 : 1800, a = r.current?.body, o = v[e.bitIndex];
|
|
3379
3487
|
if (a) {
|
|
3380
3488
|
let t = a.translation();
|
|
3381
|
-
|
|
3489
|
+
q.sparkBurst = [
|
|
3382
3490
|
t.x + e.anchorChassis[0],
|
|
3383
3491
|
t.y + e.anchorChassis[1],
|
|
3384
3492
|
t.z + e.anchorChassis[2]
|
|
@@ -3388,18 +3496,18 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3388
3496
|
t.setField("unlatchedMask", t.unlatchedMask | n);
|
|
3389
3497
|
return;
|
|
3390
3498
|
}
|
|
3391
|
-
if (t.setField("attachedMask", t.attachedMask & ~n), t.setField("unlatchedMask", t.unlatchedMask & ~n),
|
|
3499
|
+
if (t.setField("attachedMask", t.attachedMask & ~n), t.setField("unlatchedMask", t.unlatchedMask & ~n), q.massDirty = !0, !a) return;
|
|
3392
3500
|
let s = a.translation(), c = a.rotation(), l = a.linvel(), u = a.angvel(), d = a.worldCom();
|
|
3393
|
-
|
|
3501
|
+
nn.set(c.x, c.y, c.z, c.w), $t.set(e.anchorChassis[0], e.anchorChassis[1], e.anchorChassis[2]).applyQuaternion(nn).add(s), en.set($t.x - d.x, $t.y - d.y, $t.z - d.z), tn.set(u.x, u.y, u.z).cross(en);
|
|
3394
3502
|
let f = Math.min(8, i / Math.max(15, o.massKg * 18));
|
|
3395
3503
|
t.setField("detachedDebris", [...t.detachedDebris, {
|
|
3396
3504
|
id: `${e.partId}_${Date.now()}`,
|
|
3397
3505
|
partId: e.partId,
|
|
3398
3506
|
massKg: o.massKg,
|
|
3399
3507
|
position: [
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3508
|
+
$t.x,
|
|
3509
|
+
$t.y,
|
|
3510
|
+
$t.z
|
|
3403
3511
|
],
|
|
3404
3512
|
quaternion: [
|
|
3405
3513
|
c.x,
|
|
@@ -3408,9 +3516,9 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3408
3516
|
c.w
|
|
3409
3517
|
],
|
|
3410
3518
|
linvel: [
|
|
3411
|
-
l.x +
|
|
3412
|
-
l.y +
|
|
3413
|
-
l.z +
|
|
3519
|
+
l.x + tn.x + (e.anchorChassis[0] >= 0 ? 1 : -1) * f,
|
|
3520
|
+
l.y + tn.y + .65 * f,
|
|
3521
|
+
l.z + tn.z + (e.anchorChassis[2] >= 0 ? .5 : -.5) * f
|
|
3414
3522
|
],
|
|
3415
3523
|
angvel: [
|
|
3416
3524
|
u.x,
|
|
@@ -3420,7 +3528,7 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3420
3528
|
aabbSize: e.aabbSize,
|
|
3421
3529
|
colorHex: e.colorHex
|
|
3422
3530
|
}]);
|
|
3423
|
-
}, oe =
|
|
3531
|
+
}, oe = d(() => ({
|
|
3424
3532
|
engineHorsepower: 190,
|
|
3425
3533
|
gearRatios: [
|
|
3426
3534
|
3.5,
|
|
@@ -3432,8 +3540,8 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3432
3540
|
rollCenterHeight: .24,
|
|
3433
3541
|
antiRollStiffness: 2400
|
|
3434
3542
|
}), []);
|
|
3435
|
-
return /* @__PURE__ */ O
|
|
3436
|
-
/* @__PURE__ */
|
|
3543
|
+
return /* @__PURE__ */ A(O, { children: [
|
|
3544
|
+
/* @__PURE__ */ A(Ce, {
|
|
3437
3545
|
ref: r,
|
|
3438
3546
|
position: [
|
|
3439
3547
|
0,
|
|
@@ -3444,17 +3552,17 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3444
3552
|
carConfig: oe,
|
|
3445
3553
|
canSleep: !1,
|
|
3446
3554
|
children: [
|
|
3447
|
-
/* @__PURE__ */
|
|
3448
|
-
args:
|
|
3555
|
+
/* @__PURE__ */ k(j, {
|
|
3556
|
+
args: Gt(e.skateboardBoxSize),
|
|
3449
3557
|
position: e.skateboardBoxCenter
|
|
3450
3558
|
}),
|
|
3451
|
-
/* @__PURE__ */
|
|
3559
|
+
/* @__PURE__ */ A("group", {
|
|
3452
3560
|
ref: n,
|
|
3453
3561
|
children: [
|
|
3454
|
-
S && /* @__PURE__ */
|
|
3455
|
-
/* @__PURE__ */
|
|
3562
|
+
S && /* @__PURE__ */ k("primitive", { object: S }),
|
|
3563
|
+
/* @__PURE__ */ k("mesh", {
|
|
3456
3564
|
geometry: b,
|
|
3457
|
-
children: /* @__PURE__ */
|
|
3565
|
+
children: /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3458
3566
|
color: 2304045,
|
|
3459
3567
|
roughness: .9,
|
|
3460
3568
|
flatShading: !0
|
|
@@ -3462,13 +3570,13 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3462
3570
|
}),
|
|
3463
3571
|
e.panels.map((t, n) => {
|
|
3464
3572
|
let r = 1 << t.bitIndex;
|
|
3465
|
-
return (s & r) === 0 || (c & r) !== 0 ? null : /* @__PURE__ */
|
|
3573
|
+
return (s & r) === 0 || (c & r) !== 0 ? null : /* @__PURE__ */ k("mesh", {
|
|
3466
3574
|
position: t.anchorChassis,
|
|
3467
3575
|
geometry: y[n],
|
|
3468
3576
|
onClick: (e) => {
|
|
3469
3577
|
e.stopPropagation(), ae(t);
|
|
3470
3578
|
},
|
|
3471
|
-
children: /* @__PURE__ */
|
|
3579
|
+
children: /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3472
3580
|
color: t.colorHex,
|
|
3473
3581
|
roughness: t.isGlass ? .15 : .88,
|
|
3474
3582
|
transparent: t.isGlass || !!S,
|
|
@@ -3482,7 +3590,7 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3482
3590
|
}),
|
|
3483
3591
|
e.wheels.map((e) => {
|
|
3484
3592
|
let t = e.slotId.includes("_f"), n = e.omi.suspensionTravel ?? .2;
|
|
3485
|
-
return /* @__PURE__ */
|
|
3593
|
+
return /* @__PURE__ */ k(we, {
|
|
3486
3594
|
name: e.slotId,
|
|
3487
3595
|
position: [
|
|
3488
3596
|
e.position[0],
|
|
@@ -3493,15 +3601,15 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3493
3601
|
rayShapeH: e.omi.width * .5,
|
|
3494
3602
|
rayLength: n,
|
|
3495
3603
|
wheelModelRadius: e.omi.radius,
|
|
3496
|
-
springK: t ?
|
|
3604
|
+
springK: t ? ee : ne,
|
|
3497
3605
|
dampingC: t ? re : ie,
|
|
3498
3606
|
steerWheel: e.omi.steering,
|
|
3499
3607
|
driveWheel: e.omi.propulsion,
|
|
3500
3608
|
brakeWheel: !0,
|
|
3501
3609
|
maxBrakeTorque: 1600,
|
|
3502
|
-
children: /* @__PURE__ */
|
|
3610
|
+
children: /* @__PURE__ */ k("mesh", {
|
|
3503
3611
|
geometry: x,
|
|
3504
|
-
children: /* @__PURE__ */
|
|
3612
|
+
children: /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3505
3613
|
color: 1843753,
|
|
3506
3614
|
roughness: .9,
|
|
3507
3615
|
flatShading: !0
|
|
@@ -3513,7 +3621,7 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3513
3621
|
}),
|
|
3514
3622
|
e.panels.map((e, t) => {
|
|
3515
3623
|
let n = 1 << e.bitIndex;
|
|
3516
|
-
return (s & n) === 0 || (c & n) === 0 ? null : /* @__PURE__ */
|
|
3624
|
+
return (s & n) === 0 || (c & n) === 0 ? null : /* @__PURE__ */ k(an, {
|
|
3517
3625
|
chassisBodyRef: i,
|
|
3518
3626
|
panel: e,
|
|
3519
3627
|
massKg: v[t].massKg,
|
|
@@ -3521,13 +3629,13 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3521
3629
|
onWrenchHit: ae
|
|
3522
3630
|
}, `unlatched_${e.partId}`);
|
|
3523
3631
|
}),
|
|
3524
|
-
|
|
3632
|
+
h.map((e) => /* @__PURE__ */ A(M, {
|
|
3525
3633
|
position: e.position,
|
|
3526
3634
|
mass: e.massKg,
|
|
3527
3635
|
linearVelocity: e.linvel,
|
|
3528
3636
|
angularVelocity: e.angvel,
|
|
3529
3637
|
colliders: !1,
|
|
3530
|
-
children: [/* @__PURE__ */
|
|
3638
|
+
children: [/* @__PURE__ */ k(j, { args: Gt(e.aabbSize) }), /* @__PURE__ */ A("mesh", { children: [/* @__PURE__ */ k("boxGeometry", { args: e.aabbSize }), /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3531
3639
|
color: e.colorHex,
|
|
3532
3640
|
roughness: .88,
|
|
3533
3641
|
flatShading: !0
|
|
@@ -3536,39 +3644,39 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
|
|
|
3536
3644
|
] });
|
|
3537
3645
|
}
|
|
3538
3646
|
// src/importer/Step2UniversalPad.tsx
|
|
3539
|
-
var
|
|
3540
|
-
function
|
|
3541
|
-
let
|
|
3647
|
+
var sn = new m.Vector3(), cn = new m.Vector3(0, 1, 0), ln = new m.Vector3(), un = new m.Vector3(), dn = new m.Vector3();
|
|
3648
|
+
function fn({ bundle: e, subArchetype: t, patches: n, stampActive: o, panelAnimRef: s, onStampSurface: l }) {
|
|
3649
|
+
let p = f(null), h = J((e) => e.chaseCam), _ = f(J.getState().dropTrigger), v = f({
|
|
3542
3650
|
w: !1,
|
|
3543
3651
|
s: !1,
|
|
3544
3652
|
a: !1,
|
|
3545
3653
|
d: !1,
|
|
3546
3654
|
space: !1,
|
|
3547
3655
|
shift: !1
|
|
3548
|
-
}), y =
|
|
3549
|
-
...
|
|
3656
|
+
}), y = f(new m.Vector3(0, 1, 4)), b = f({
|
|
3657
|
+
...i(),
|
|
3550
3658
|
throttle: 0,
|
|
3551
3659
|
boost: 0,
|
|
3552
3660
|
brake: 0,
|
|
3553
3661
|
headlight: 1,
|
|
3554
3662
|
always: 1
|
|
3555
|
-
}), x =
|
|
3556
|
-
return
|
|
3557
|
-
|
|
3558
|
-
}), [
|
|
3559
|
-
|
|
3663
|
+
}), x = d(() => w(e), [e]), S = d(() => r(n), [n]), C = d(() => a(x), [x]);
|
|
3664
|
+
return u(() => (s.current = C, () => {
|
|
3665
|
+
s.current === C && (s.current = null);
|
|
3666
|
+
}), [C, s]), u(() => {
|
|
3667
|
+
q.massKg = x.totalDynamicMass, q.com = [...x.centerOfMass];
|
|
3560
3668
|
let e = (e) => (t) => {
|
|
3561
3669
|
(t.code === "KeyW" || t.code === "ArrowUp") && (v.current.w = e), (t.code === "KeyS" || t.code === "ArrowDown") && (v.current.s = e), (t.code === "KeyA" || t.code === "ArrowLeft") && (v.current.a = e), (t.code === "KeyD" || t.code === "ArrowRight") && (v.current.d = e), t.code === "Space" && (v.current.space = e), (t.code === "ShiftLeft" || t.code === "ShiftRight") && (v.current.shift = e);
|
|
3562
3670
|
}, t = e(!0), n = e(!1);
|
|
3563
3671
|
return window.addEventListener("keydown", t), window.addEventListener("keyup", n), () => {
|
|
3564
3672
|
window.removeEventListener("keydown", t), window.removeEventListener("keyup", n);
|
|
3565
3673
|
};
|
|
3566
|
-
}, [x]),
|
|
3674
|
+
}, [x]), g((e, n) => {
|
|
3567
3675
|
let r = Math.min(Math.max(n, 1e-4), .05);
|
|
3568
|
-
|
|
3569
|
-
let i =
|
|
3676
|
+
C.step(r);
|
|
3677
|
+
let i = p.current;
|
|
3570
3678
|
if (!i?.body) return;
|
|
3571
|
-
let a =
|
|
3679
|
+
let a = J.getState().dropTrigger;
|
|
3572
3680
|
a !== _.current && (_.current = a, i.body.setTranslation({
|
|
3573
3681
|
x: 0,
|
|
3574
3682
|
y: 1.35,
|
|
@@ -3600,15 +3708,15 @@ function on({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimR
|
|
|
3600
3708
|
steerLeft: s.a,
|
|
3601
3709
|
steerRight: s.d,
|
|
3602
3710
|
brake: s.space
|
|
3603
|
-
}), s.shift && s.w && i.body.applyImpulse(
|
|
3711
|
+
}), s.shift && s.w && i.body.applyImpulse(dn.copy(i.bodyZAxis).multiplyScalar(i.body.mass() * 6.2 * r), !0));
|
|
3604
3712
|
let c = b.current;
|
|
3605
|
-
c.throttle = +!!s.w, c.boost = s.w && s.shift ? 1 : 0, c.brake = s.space || s.s ? 1 : 0,
|
|
3606
|
-
}), /* @__PURE__ */
|
|
3713
|
+
c.throttle = +!!s.w, c.boost = s.w && s.shift ? 1 : 0, c.brake = s.space || s.s ? 1 : 0, q.speedKmh = i.currLinVel.length() * 3.6, q.rpm = Math.max(850, i.engineRPM), h && !o && (sn.copy(i.bodyZAxis).projectOnPlane(cn), sn.lengthSq() < 1e-6 ? sn.set(0, 0, 1) : sn.normalize(), ln.copy(i.currPos).addScaledVector(sn, -6.8).addScaledVector(cn, 2.25), un.copy(i.currPos).addScaledVector(sn, 3.5).addScaledVector(cn, .65), re.damp3(e.camera.position, ln, .14, r), re.damp3(y.current, un, .08, r), e.camera.lookAt(y.current));
|
|
3714
|
+
}), /* @__PURE__ */ k("group", {
|
|
3607
3715
|
onClick: (e) => {
|
|
3608
|
-
o ?
|
|
3716
|
+
o ? l(e) : e.delta <= 5 && C.toggleHitObject(e.object) && e.stopPropagation();
|
|
3609
3717
|
},
|
|
3610
|
-
children: /* @__PURE__ */
|
|
3611
|
-
ref:
|
|
3718
|
+
children: /* @__PURE__ */ k(ie, {
|
|
3719
|
+
ref: p,
|
|
3612
3720
|
bundle: x,
|
|
3613
3721
|
position: [
|
|
3614
3722
|
0,
|
|
@@ -3619,31 +3727,31 @@ function on({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimR
|
|
|
3619
3727
|
twoWheelBalance: !0,
|
|
3620
3728
|
maxLeanAngle: .78
|
|
3621
3729
|
} : void 0,
|
|
3622
|
-
children: /* @__PURE__ */
|
|
3623
|
-
emitters:
|
|
3730
|
+
children: /* @__PURE__ */ k(c, {
|
|
3731
|
+
emitters: S,
|
|
3624
3732
|
signalsRef: b
|
|
3625
3733
|
})
|
|
3626
3734
|
})
|
|
3627
3735
|
});
|
|
3628
3736
|
}
|
|
3629
|
-
function
|
|
3630
|
-
let
|
|
3631
|
-
...
|
|
3737
|
+
function pn({ bundle: e, domain: t, staticProp: n, patches: a, onStampSurface: s }) {
|
|
3738
|
+
let l = f(null), p = f(!1), m = J((e) => e.dropTrigger), h = f({
|
|
3739
|
+
...i(),
|
|
3632
3740
|
throttle: .9,
|
|
3633
3741
|
boost: 1,
|
|
3634
3742
|
brake: 1,
|
|
3635
3743
|
headlight: 1,
|
|
3636
3744
|
fire: 1,
|
|
3637
3745
|
always: 1
|
|
3638
|
-
}), g =
|
|
3639
|
-
return
|
|
3640
|
-
|
|
3641
|
-
}, [g]), /* @__PURE__ */
|
|
3746
|
+
}), g = d(() => w(e), [e, m]), _ = d(() => r(a), [a]), v = t === "c12" || t === "prop" && n;
|
|
3747
|
+
return u(() => {
|
|
3748
|
+
q.massKg = g.totalDynamicMass, q.com = [...g.centerOfMass], q.speedKmh = 0;
|
|
3749
|
+
}, [g]), /* @__PURE__ */ A("group", {
|
|
3642
3750
|
onClick: (e) => {
|
|
3643
|
-
|
|
3751
|
+
s(e), p.current = o(l.current, g, p.current);
|
|
3644
3752
|
},
|
|
3645
|
-
children: [/* @__PURE__ */
|
|
3646
|
-
ref:
|
|
3753
|
+
children: [/* @__PURE__ */ k(C, {
|
|
3754
|
+
ref: l,
|
|
3647
3755
|
bundle: g,
|
|
3648
3756
|
position: [
|
|
3649
3757
|
0,
|
|
@@ -3651,19 +3759,19 @@ function sn({ bundle: e, domain: t, staticProp: i, patches: o, onStampSurface: c
|
|
|
3651
3759
|
0
|
|
3652
3760
|
],
|
|
3653
3761
|
fixedRoot: v
|
|
3654
|
-
}, `asm_${m}`), /* @__PURE__ */
|
|
3762
|
+
}, `asm_${m}`), /* @__PURE__ */ k(c, {
|
|
3655
3763
|
emitters: _,
|
|
3656
3764
|
signalsRef: h
|
|
3657
3765
|
})]
|
|
3658
3766
|
});
|
|
3659
3767
|
}
|
|
3660
|
-
function
|
|
3661
|
-
let c =
|
|
3662
|
-
return /* @__PURE__ */
|
|
3768
|
+
function mn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches: i, stampActive: a, panelAnimRef: o, onStampSurface: s }) {
|
|
3769
|
+
let c = J((e) => e.domain), l = J((e) => e.vehicleArchetype), u = J((e) => e.usePaperShellProxy), d = J((e) => e.staticProp);
|
|
3770
|
+
return /* @__PURE__ */ A(ee, {
|
|
3663
3771
|
interpolate: !0,
|
|
3664
3772
|
timeStep: 1 / 60,
|
|
3665
3773
|
children: [
|
|
3666
|
-
/* @__PURE__ */
|
|
3774
|
+
/* @__PURE__ */ k(M, {
|
|
3667
3775
|
type: "fixed",
|
|
3668
3776
|
position: [
|
|
3669
3777
|
0,
|
|
@@ -3671,7 +3779,7 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
|
|
|
3671
3779
|
0
|
|
3672
3780
|
],
|
|
3673
3781
|
colliders: !1,
|
|
3674
|
-
children: /* @__PURE__ */
|
|
3782
|
+
children: /* @__PURE__ */ k(j, {
|
|
3675
3783
|
args: [
|
|
3676
3784
|
180,
|
|
3677
3785
|
.25,
|
|
@@ -3680,7 +3788,7 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
|
|
|
3680
3788
|
friction: .92
|
|
3681
3789
|
})
|
|
3682
3790
|
}),
|
|
3683
|
-
/* @__PURE__ */
|
|
3791
|
+
/* @__PURE__ */ A("mesh", {
|
|
3684
3792
|
rotation: [
|
|
3685
3793
|
-Math.PI * .5,
|
|
3686
3794
|
0,
|
|
@@ -3692,12 +3800,12 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
|
|
|
3692
3800
|
0
|
|
3693
3801
|
],
|
|
3694
3802
|
receiveShadow: !0,
|
|
3695
|
-
children: [/* @__PURE__ */
|
|
3803
|
+
children: [/* @__PURE__ */ k("planeGeometry", { args: [360, 360] }), /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3696
3804
|
color: "#11161d",
|
|
3697
3805
|
roughness: .95
|
|
3698
3806
|
})]
|
|
3699
3807
|
}),
|
|
3700
|
-
/* @__PURE__ */
|
|
3808
|
+
/* @__PURE__ */ k(M, {
|
|
3701
3809
|
type: "fixed",
|
|
3702
3810
|
position: [
|
|
3703
3811
|
0,
|
|
@@ -3710,11 +3818,11 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
|
|
|
3710
3818
|
0
|
|
3711
3819
|
],
|
|
3712
3820
|
colliders: "cuboid",
|
|
3713
|
-
children: /* @__PURE__ */
|
|
3821
|
+
children: /* @__PURE__ */ A("mesh", { children: [/* @__PURE__ */ k("boxGeometry", { args: [
|
|
3714
3822
|
4.4,
|
|
3715
3823
|
.22,
|
|
3716
3824
|
6.2
|
|
3717
|
-
] }), /* @__PURE__ */
|
|
3825
|
+
] }), /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3718
3826
|
color: "#f59e0b",
|
|
3719
3827
|
roughness: .75,
|
|
3720
3828
|
flatShading: !0
|
|
@@ -3728,34 +3836,34 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
|
|
|
3728
3836
|
24,
|
|
3729
3837
|
36,
|
|
3730
3838
|
48
|
|
3731
|
-
].map((t) => /* @__PURE__ */
|
|
3839
|
+
].map((t) => /* @__PURE__ */ A("mesh", {
|
|
3732
3840
|
position: [
|
|
3733
3841
|
e,
|
|
3734
3842
|
.35,
|
|
3735
3843
|
t
|
|
3736
3844
|
],
|
|
3737
|
-
children: [/* @__PURE__ */
|
|
3845
|
+
children: [/* @__PURE__ */ k("coneGeometry", { args: [
|
|
3738
3846
|
.28,
|
|
3739
3847
|
.7,
|
|
3740
3848
|
8
|
|
3741
|
-
] }), /* @__PURE__ */
|
|
3849
|
+
] }), /* @__PURE__ */ k("meshStandardMaterial", {
|
|
3742
3850
|
color: "#ff5a1f",
|
|
3743
3851
|
roughness: .6,
|
|
3744
3852
|
flatShading: !0
|
|
3745
3853
|
})]
|
|
3746
3854
|
}, `cone_${e}_${t}`))),
|
|
3747
|
-
c === "vehicle" && u ? /* @__PURE__ */
|
|
3855
|
+
c === "vehicle" && u ? /* @__PURE__ */ k(on, {
|
|
3748
3856
|
assembly: e,
|
|
3749
3857
|
importedRoot: t,
|
|
3750
3858
|
chassisGroupRef: n
|
|
3751
|
-
}) : r ? c === "vehicle" ? /* @__PURE__ */
|
|
3859
|
+
}) : r ? c === "vehicle" ? /* @__PURE__ */ k(fn, {
|
|
3752
3860
|
bundle: r,
|
|
3753
3861
|
subArchetype: l,
|
|
3754
3862
|
patches: i,
|
|
3755
3863
|
stampActive: a,
|
|
3756
3864
|
panelAnimRef: o,
|
|
3757
3865
|
onStampSurface: s
|
|
3758
|
-
}) : /* @__PURE__ */
|
|
3866
|
+
}) : /* @__PURE__ */ k(pn, {
|
|
3759
3867
|
bundle: r,
|
|
3760
3868
|
domain: c,
|
|
3761
3869
|
staticProp: d,
|
|
@@ -3766,9 +3874,9 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
|
|
|
3766
3874
|
});
|
|
3767
3875
|
}
|
|
3768
3876
|
// src/importer/VfxEmitterPool.tsx
|
|
3769
|
-
var Z = 256,
|
|
3770
|
-
function
|
|
3771
|
-
let n =
|
|
3877
|
+
var Z = 256, hn = new m.Vector3(), gn = new m.Vector3(), Q = new m.Vector3(), _n = new m.Quaternion(), vn = new m.Matrix4(), yn = new m.Color();
|
|
3878
|
+
function bn({ chassisObjRef: e, emitters: t }) {
|
|
3879
|
+
let n = f(null), r = f(0), i = f(0), a = d(() => {
|
|
3772
3880
|
let e = new Float32Array(Z * 3), t = new Float32Array(Z * 3), n = new Float32Array(Z), r = new Float32Array(Z), i = new Float32Array(Z * 2), a = new Float32Array(Z * 3), o = new Float32Array(Z * 3);
|
|
3773
3881
|
return n.fill(999), r.fill(1), {
|
|
3774
3882
|
pos: e,
|
|
@@ -3779,18 +3887,18 @@ function mn({ chassisObjRef: e, emitters: t }) {
|
|
|
3779
3887
|
colorStart: a,
|
|
3780
3888
|
colorEnd: o
|
|
3781
3889
|
};
|
|
3782
|
-
}, []), o =
|
|
3890
|
+
}, []), o = d(() => new m.PlaneGeometry(1, 1), []), s = d(() => new m.MeshBasicMaterial({
|
|
3783
3891
|
color: 16777215,
|
|
3784
|
-
side:
|
|
3892
|
+
side: m.DoubleSide,
|
|
3785
3893
|
transparent: !0,
|
|
3786
3894
|
opacity: .85,
|
|
3787
3895
|
depthWrite: !1
|
|
3788
3896
|
}), []);
|
|
3789
|
-
|
|
3897
|
+
u(() => {
|
|
3790
3898
|
let e = n.current;
|
|
3791
3899
|
if (e) {
|
|
3792
|
-
|
|
3793
|
-
for (let t = 0; t < Z; t++) e.setMatrixAt(t,
|
|
3900
|
+
vn.makeScale(0, 0, 0), yn.setRGB(1, 1, 1);
|
|
3901
|
+
for (let t = 0; t < Z; t++) e.setMatrixAt(t, vn), e.setColorAt(t, yn);
|
|
3794
3902
|
e.instanceMatrix.needsUpdate = !0, e.instanceColor && (e.instanceColor.needsUpdate = !0);
|
|
3795
3903
|
}
|
|
3796
3904
|
}, []);
|
|
@@ -3802,32 +3910,32 @@ function mn({ chassisObjRef: e, emitters: t }) {
|
|
|
3802
3910
|
let y = c + Math.random() * (l - c);
|
|
3803
3911
|
a.vel[_] = (i + (Math.random() - .5) * u) * y, a.vel[_ + 1] = (o + (Math.random() - .5) * u) * y + .35, a.vel[_ + 2] = (s + (Math.random() - .5) * u) * y, a.age[g] = 0, a.life[g] = Math.max(.05, p), a.sizeStartEnd[v] = d, a.sizeStartEnd[v + 1] = f, a.colorStart[_] = m[0], a.colorStart[_ + 1] = m[1], a.colorStart[_ + 2] = m[2], a.colorEnd[_] = h[0], a.colorEnd[_ + 1] = h[1], a.colorEnd[_ + 2] = h[2];
|
|
3804
3912
|
};
|
|
3805
|
-
return
|
|
3913
|
+
return g((r, o) => {
|
|
3806
3914
|
let s = n.current;
|
|
3807
3915
|
if (!s) return;
|
|
3808
3916
|
let l = Math.min(.05, o), u = e.current;
|
|
3809
|
-
u ? (u.getWorldPosition(
|
|
3917
|
+
u ? (u.getWorldPosition(hn), u.getWorldQuaternion(_n)) : (hn.set(0, 0, 0), _n.identity());
|
|
3810
3918
|
let d = t[0];
|
|
3811
3919
|
if (d) {
|
|
3812
|
-
let e = Math.max(.15, Math.min(1,
|
|
3920
|
+
let e = Math.max(.15, Math.min(1, q.rpm / 6500));
|
|
3813
3921
|
for (i.current += d.desc.rateHz * e * l; i.current >= 1;) {
|
|
3814
|
-
--i.current,
|
|
3922
|
+
--i.current, gn.set(d.position[0], d.position[1], d.position[2]).applyQuaternion(_n).add(hn), Q.set(0, 0, -1).applyQuaternion(_n);
|
|
3815
3923
|
let e = d.desc;
|
|
3816
|
-
c(
|
|
3924
|
+
c(gn.x, gn.y, gn.z, Q.x, Q.y, Q.z, e.speedMinMax[0], e.speedMinMax[1], e.coneOuterAngle, e.sizeStartEnd[0], e.sizeStartEnd[1], e.lifetimeSec, e.colorStart, e.colorEnd);
|
|
3817
3925
|
}
|
|
3818
3926
|
}
|
|
3819
|
-
let f =
|
|
3927
|
+
let f = q.sparkBurst;
|
|
3820
3928
|
if (f && t[1]) {
|
|
3821
|
-
|
|
3929
|
+
q.sparkBurst = null;
|
|
3822
3930
|
let e = t[1].desc;
|
|
3823
|
-
Q.set(0, 0, -1).applyQuaternion(
|
|
3931
|
+
Q.set(0, 0, -1).applyQuaternion(_n);
|
|
3824
3932
|
for (let t = 0; t < 18; t++) c(f[0], f[1], f[2], Q.x, Q.y + .4, Q.z, e.speedMinMax[0], e.speedMinMax[1], e.coneOuterAngle, e.sizeStartEnd[0], e.sizeStartEnd[1], e.lifetimeSec, e.colorStart, e.colorEnd);
|
|
3825
3933
|
}
|
|
3826
3934
|
let p = r.camera.quaternion;
|
|
3827
3935
|
for (let e = 0; e < Z; e++) {
|
|
3828
3936
|
let t = a.age[e], n = a.life[e];
|
|
3829
3937
|
if (t >= n) {
|
|
3830
|
-
|
|
3938
|
+
vn.makeScale(0, 0, 0), s.setMatrixAt(e, vn);
|
|
3831
3939
|
continue;
|
|
3832
3940
|
}
|
|
3833
3941
|
let r = t + l;
|
|
@@ -3835,10 +3943,10 @@ function mn({ chassisObjRef: e, emitters: t }) {
|
|
|
3835
3943
|
let i = Math.min(1, r / n), o = e * 3, c = e * 2;
|
|
3836
3944
|
a.pos[o] += a.vel[o] * l, a.pos[o + 1] += a.vel[o + 1] * l, a.pos[o + 2] += a.vel[o + 2] * l;
|
|
3837
3945
|
let u = a.sizeStartEnd[c] + (a.sizeStartEnd[c + 1] - a.sizeStartEnd[c]) * i;
|
|
3838
|
-
|
|
3946
|
+
gn.set(a.pos[o], a.pos[o + 1], a.pos[o + 2]), Q.set(u, u, u), vn.compose(gn, p, Q), s.setMatrixAt(e, vn), yn.setRGB(a.colorStart[o] + (a.colorEnd[o] - a.colorStart[o]) * i, a.colorStart[o + 1] + (a.colorEnd[o + 1] - a.colorStart[o + 1]) * i, a.colorStart[o + 2] + (a.colorEnd[o + 2] - a.colorStart[o + 2]) * i), s.setColorAt(e, yn);
|
|
3839
3947
|
}
|
|
3840
3948
|
s.instanceMatrix.needsUpdate = !0, s.instanceColor && (s.instanceColor.needsUpdate = !0);
|
|
3841
|
-
}), /* @__PURE__ */
|
|
3949
|
+
}), /* @__PURE__ */ k("instancedMesh", {
|
|
3842
3950
|
ref: n,
|
|
3843
3951
|
args: [
|
|
3844
3952
|
o,
|
|
@@ -3849,7 +3957,7 @@ function mn({ chassisObjRef: e, emitters: t }) {
|
|
|
3849
3957
|
});
|
|
3850
3958
|
}
|
|
3851
3959
|
// src/importer/usdToGlb.ts
|
|
3852
|
-
var
|
|
3960
|
+
var xn = [
|
|
3853
3961
|
80,
|
|
3854
3962
|
88,
|
|
3855
3963
|
82,
|
|
@@ -3858,24 +3966,24 @@ var hn = [
|
|
|
3858
3966
|
83,
|
|
3859
3967
|
68,
|
|
3860
3968
|
67
|
|
3861
|
-
],
|
|
3969
|
+
], Sn = [
|
|
3862
3970
|
"map",
|
|
3863
3971
|
"normalMap",
|
|
3864
3972
|
"roughnessMap",
|
|
3865
3973
|
"metalnessMap",
|
|
3866
3974
|
"aoMap",
|
|
3867
3975
|
"emissiveMap"
|
|
3868
|
-
],
|
|
3869
|
-
function
|
|
3976
|
+
], Cn = (e) => e.byteLength >= 8 && xn.every((t, n) => e[n] === t), wn = (e) => /\.(usd|usda|usdc|usdz)$/i.test(e.trim());
|
|
3977
|
+
function Tn(e) {
|
|
3870
3978
|
let t = /* @__PURE__ */ new Map(), n = (e, r, i, a) => {
|
|
3871
3979
|
let o = r * e.scale.x, s = i * e.scale.y, c = a * e.scale.z;
|
|
3872
3980
|
if (e.name && t.set(e.name, [
|
|
3873
3981
|
Math.abs(o),
|
|
3874
3982
|
Math.abs(s),
|
|
3875
3983
|
Math.abs(c)
|
|
3876
|
-
]), e.position.set(e.position.x * r, e.position.y * i, e.position.z * a), e.scale.set(1, 1, 1), e instanceof
|
|
3984
|
+
]), e.position.set(e.position.x * r, e.position.y * i, e.position.z * a), e.scale.set(1, 1, 1), e instanceof m.Mesh && e.geometry && (Math.abs(o - 1) > 1e-5 || Math.abs(s - 1) > 1e-5 || Math.abs(c - 1) > 1e-5)) {
|
|
3877
3985
|
let t = e.geometry.clone();
|
|
3878
|
-
t.applyMatrix4(new
|
|
3986
|
+
t.applyMatrix4(new m.Matrix4().makeScale(o, s, c));
|
|
3879
3987
|
let n = o * s * c < 0 ? t.getIndex() : null;
|
|
3880
3988
|
if (n) {
|
|
3881
3989
|
let e = n.array;
|
|
@@ -3891,12 +3999,12 @@ function yn(e) {
|
|
|
3891
3999
|
};
|
|
3892
4000
|
return n(e, 1, 1, 1), e.updateMatrixWorld(!0), t;
|
|
3893
4001
|
}
|
|
3894
|
-
function
|
|
4002
|
+
function En(e) {
|
|
3895
4003
|
if (typeof e == "string") return [e];
|
|
3896
4004
|
let t = e instanceof Uint8Array ? e : new Uint8Array(e), n = new TextDecoder();
|
|
3897
|
-
return
|
|
4005
|
+
return Cn(t) ? [] : t.byteLength >= 2 && t[0] === 80 && t[1] === 75 ? Object.entries(L(t)).filter(([e, t]) => /\.(usd|usda)$/i.test(e) && !Cn(t)).map(([, e]) => n.decode(e)) : [n.decode(t)];
|
|
3898
4006
|
}
|
|
3899
|
-
function
|
|
4007
|
+
function Dn(e, t) {
|
|
3900
4008
|
for (let n of e.split(/\r?\n/)) {
|
|
3901
4009
|
let e = n.indexOf("=");
|
|
3902
4010
|
if (e >= 0) {
|
|
@@ -3905,13 +4013,13 @@ function xn(e, t) {
|
|
|
3905
4013
|
}
|
|
3906
4014
|
}
|
|
3907
4015
|
}
|
|
3908
|
-
function
|
|
4016
|
+
function On(e) {
|
|
3909
4017
|
let t = e.replace(/#[^\n]*/g, ""), n = [], r = [], i = /\b(?:def|over|class)\s+(?:([A-Za-z0-9_]+)\s+)?"([^"]+)"\s*(?:\(([\s\S]*?)\))?\s*\{/g, a = 0;
|
|
3910
4018
|
for (; a < t.length;) {
|
|
3911
4019
|
let e = t.indexOf("{", a), o = t.indexOf("}", a);
|
|
3912
4020
|
if (o !== -1 && (e === -1 || o < e)) {
|
|
3913
4021
|
let e = r.pop();
|
|
3914
|
-
e &&
|
|
4022
|
+
e && Dn(t.slice(a, o), e.attrs), a = o + 1;
|
|
3915
4023
|
continue;
|
|
3916
4024
|
}
|
|
3917
4025
|
if (e === -1) break;
|
|
@@ -3920,7 +4028,7 @@ function Sn(e) {
|
|
|
3920
4028
|
let c = i.exec(s);
|
|
3921
4029
|
if (c) {
|
|
3922
4030
|
let e = r[r.length - 1];
|
|
3923
|
-
e &&
|
|
4031
|
+
e && Dn(s.slice(0, c.index), e.attrs);
|
|
3924
4032
|
let t = [...r].reverse().find((e) => e !== null)?.path ?? "", i = (c[3] ?? "").match(/apiSchemas\s*=\s*\[([^\]]*)\]/), a = i ? Array.from(i[1].matchAll(/"([^"]+)"/g), (e) => e[1]) : [], o = {
|
|
3925
4033
|
path: `${t}/${c[2]}`,
|
|
3926
4034
|
name: c[2],
|
|
@@ -3934,18 +4042,18 @@ function Sn(e) {
|
|
|
3934
4042
|
}
|
|
3935
4043
|
return n;
|
|
3936
4044
|
}
|
|
3937
|
-
var
|
|
4045
|
+
var kn = (e) => e === void 0 ? void 0 : /^(true|1)$/i.test(e.trim()) ? !0 : !/^(false|0)$/i.test(e.trim()) && void 0, $ = (e) => {
|
|
3938
4046
|
let t = e === void 0 ? NaN : Number(e.replace(/[()"]/g, "").trim());
|
|
3939
4047
|
return Number.isFinite(t) ? t : void 0;
|
|
3940
|
-
},
|
|
4048
|
+
}, An = (e) => {
|
|
3941
4049
|
let t = e?.match(/\(\s*([^\s,)]+)\s*,\s*([^\s,)]+)\s*,\s*([^\s,)]+)\s*\)/), n = t ? [
|
|
3942
4050
|
Number(t[1]),
|
|
3943
4051
|
Number(t[2]),
|
|
3944
4052
|
Number(t[3])
|
|
3945
4053
|
] : null;
|
|
3946
4054
|
return n?.every(Number.isFinite) ? n : void 0;
|
|
3947
|
-
},
|
|
3948
|
-
function
|
|
4055
|
+
}, jn = (e) => e?.match(/<([^>]+)>/)?.[1]?.split("/").filter(Boolean).pop();
|
|
4056
|
+
function Mn(e, t) {
|
|
3949
4057
|
if (e.typeName === "Cube") {
|
|
3950
4058
|
let n = Math.max(.001, $(e.attrs.size) ?? 2);
|
|
3951
4059
|
return {
|
|
@@ -3972,7 +4080,7 @@ function En(e, t) {
|
|
|
3972
4080
|
}
|
|
3973
4081
|
return null;
|
|
3974
4082
|
}
|
|
3975
|
-
function
|
|
4083
|
+
function Nn(e, t, n, r) {
|
|
3976
4084
|
let i = /* @__PURE__ */ new Set();
|
|
3977
4085
|
for (let t of Object.keys(e)) {
|
|
3978
4086
|
let e = t.match(/^drive:([^:]+):physics:/);
|
|
@@ -3993,8 +4101,8 @@ function Dn(e, t, n, r) {
|
|
|
3993
4101
|
};
|
|
3994
4102
|
});
|
|
3995
4103
|
}
|
|
3996
|
-
function
|
|
3997
|
-
let r = e.flatMap(
|
|
4104
|
+
function Pn(e, t, n) {
|
|
4105
|
+
let r = e.flatMap(On);
|
|
3998
4106
|
if (r.length === 0) return [];
|
|
3999
4107
|
let i = /* @__PURE__ */ new Map();
|
|
4000
4108
|
t.traverse((e) => {
|
|
@@ -4015,9 +4123,9 @@ function On(e, t, n) {
|
|
|
4015
4123
|
for (let e of r) {
|
|
4016
4124
|
let t = i.get(e.name);
|
|
4017
4125
|
if (!t) continue;
|
|
4018
|
-
let r = (e.apiSchemas.includes("PhysicsRigidBodyAPI") ||
|
|
4126
|
+
let r = (e.apiSchemas.includes("PhysicsRigidBodyAPI") || kn(e.attrs["physics:rigidBodyEnabled"]) === !0) && kn(e.attrs["physics:rigidBodyEnabled"]) !== !1, o = (e.apiSchemas.includes("PhysicsCollisionAPI") || e.apiSchemas.includes("PhysicsMeshCollisionAPI") || kn(e.attrs["physics:collisionEnabled"]) === !0) && kn(e.attrs["physics:collisionEnabled"]) !== !1;
|
|
4019
4127
|
if (r) {
|
|
4020
|
-
let n =
|
|
4128
|
+
let n = kn(e.attrs["physics:kinematicEnabled"]) === !0, r = $(e.attrs["physics:mass"]), i = n ? r !== void 0 && r >= 0 ? r : void 0 : r !== void 0 && r > 0 ? r : 1, a = An(e.attrs["physics:centerOfMass"]), o = An(e.attrs["physics:diagonalInertia"]);
|
|
4021
4129
|
s(t.name).motion = {
|
|
4022
4130
|
isKinematic: n,
|
|
4023
4131
|
...i === void 0 ? {} : { mass: i },
|
|
@@ -4026,7 +4134,7 @@ function On(e, t, n) {
|
|
|
4026
4134
|
};
|
|
4027
4135
|
}
|
|
4028
4136
|
if (o) {
|
|
4029
|
-
let r = e.attrs["material:binding:physics"]?.match(/<([^>]+)>/)?.[1], i = (r ? a.get(r) : void 0) ?? a.get(e.path) ?? {}, o =
|
|
4137
|
+
let r = e.attrs["material:binding:physics"]?.match(/<([^>]+)>/)?.[1], i = (r ? a.get(r) : void 0) ?? a.get(e.path) ?? {}, o = Mn(e, n?.get(t.name) ?? [
|
|
4030
4138
|
1,
|
|
4031
4139
|
1,
|
|
4032
4140
|
1
|
|
@@ -4036,9 +4144,9 @@ function On(e, t, n) {
|
|
|
4036
4144
|
...i
|
|
4037
4145
|
};
|
|
4038
4146
|
else {
|
|
4039
|
-
let n = t instanceof
|
|
4147
|
+
let n = t instanceof m.Mesh ? t : void 0;
|
|
4040
4148
|
if (n || t.traverse((e) => {
|
|
4041
|
-
!n && e instanceof
|
|
4149
|
+
!n && e instanceof m.Mesh && (n = e);
|
|
4042
4150
|
}), n) {
|
|
4043
4151
|
n.name || (n.name = `${t.name}_Mesh`);
|
|
4044
4152
|
let r = (e.attrs["physics:approximation"] ?? "").replace(/"/g, "").trim();
|
|
@@ -4052,15 +4160,15 @@ function On(e, t, n) {
|
|
|
4052
4160
|
}
|
|
4053
4161
|
}
|
|
4054
4162
|
for (let e of r) {
|
|
4055
|
-
let n = e.typeName === "PhysicsRevoluteJoint" ? "revolute" : e.typeName === "PhysicsPrismaticJoint" ? "prismatic" : e.typeName === "PhysicsFixedJoint" ? "fixed" : null, r = n ?
|
|
4163
|
+
let n = e.typeName === "PhysicsRevoluteJoint" ? "revolute" : e.typeName === "PhysicsPrismaticJoint" ? "prismatic" : e.typeName === "PhysicsFixedJoint" ? "fixed" : null, r = n ? jn(e.attrs["physics:body1"]) : void 0, a = r ? i.get(r) : void 0;
|
|
4056
4164
|
if (!n || !a) continue;
|
|
4057
|
-
let o =
|
|
4165
|
+
let o = jn(e.attrs["physics:body0"]);
|
|
4058
4166
|
if (!o || !i.has(o)) {
|
|
4059
4167
|
if (o = `${e.name}_WorldAnchor`, !i.has(o)) {
|
|
4060
|
-
let n = new
|
|
4168
|
+
let n = new m.Object3D();
|
|
4061
4169
|
n.name = o;
|
|
4062
4170
|
let r = i.get(e.name);
|
|
4063
|
-
r && n.position.copy(r.getWorldPosition(new
|
|
4171
|
+
r && n.position.copy(r.getWorldPosition(new m.Vector3())), t.add(n), i.set(o, n);
|
|
4064
4172
|
}
|
|
4065
4173
|
s(o).motion = { isKinematic: !0 };
|
|
4066
4174
|
}
|
|
@@ -4081,19 +4189,19 @@ function On(e, t, n) {
|
|
|
4081
4189
|
1,
|
|
4082
4190
|
0,
|
|
4083
4191
|
0
|
|
4084
|
-
], d = n === "revolute" ? Math.PI / 180 : 1, f = $(e.attrs["physics:lowerLimit"]),
|
|
4192
|
+
], d = n === "revolute" ? Math.PI / 180 : 1, f = $(e.attrs["physics:lowerLimit"]), p = $(e.attrs["physics:upperLimit"]), h = n === "fixed" ? [] : Nn(e.attrs, n, u, d);
|
|
4085
4193
|
c.joint = {
|
|
4086
4194
|
connectedNodeName: o,
|
|
4087
4195
|
kind: n,
|
|
4088
4196
|
...n === "fixed" ? {} : { axis: u },
|
|
4089
|
-
...f !== void 0 &&
|
|
4090
|
-
enableCollision:
|
|
4197
|
+
...f !== void 0 && p !== void 0 && f <= p ? { limits: [f * d, p * d] } : {},
|
|
4198
|
+
enableCollision: kn(e.attrs["physics:collisionEnabled"]) === !0,
|
|
4091
4199
|
...h.length > 0 ? { drives: h } : {}
|
|
4092
4200
|
};
|
|
4093
4201
|
}
|
|
4094
4202
|
return [...o.values()];
|
|
4095
4203
|
}
|
|
4096
|
-
function
|
|
4204
|
+
function Fn(e) {
|
|
4097
4205
|
let t = "", n = !1, r = !1, i = 0, a = 0, o = !1;
|
|
4098
4206
|
for (let s = 0; s < e.length; s++) {
|
|
4099
4207
|
let c = e[s];
|
|
@@ -4101,24 +4209,24 @@ function kn(e) {
|
|
|
4101
4209
|
}
|
|
4102
4210
|
return t;
|
|
4103
4211
|
}
|
|
4104
|
-
async function
|
|
4105
|
-
let n = new
|
|
4106
|
-
if (typeof e == "string") a = n.parse(
|
|
4212
|
+
async function In(e, t) {
|
|
4213
|
+
let n = new Ee(), r = new TextEncoder(), i = new TextDecoder(), a;
|
|
4214
|
+
if (typeof e == "string") a = n.parse(Fn(e));
|
|
4107
4215
|
else {
|
|
4108
4216
|
let t = e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
4109
|
-
if (
|
|
4217
|
+
if (Cn(t)) a = n.parse(t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength));
|
|
4110
4218
|
else if (t.byteLength >= 2 && t[0] === 80 && t[1] === 75) {
|
|
4111
|
-
let e =
|
|
4112
|
-
for (let [t, n] of Object.entries(e)) /\.(usd|usda)$/i.test(t) && !
|
|
4113
|
-
let o =
|
|
4219
|
+
let e = L(t);
|
|
4220
|
+
for (let [t, n] of Object.entries(e)) /\.(usd|usda)$/i.test(t) && !Cn(n) && (e[t] = r.encode(Fn(i.decode(n))));
|
|
4221
|
+
let o = Te(e, { level: 0 });
|
|
4114
4222
|
a = n.parse(o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength));
|
|
4115
|
-
} else a = n.parse(
|
|
4223
|
+
} else a = n.parse(Fn(i.decode(t)));
|
|
4116
4224
|
}
|
|
4117
|
-
let o =
|
|
4225
|
+
let o = Pn(En(e), a, Tn(a)), s = [];
|
|
4118
4226
|
a.traverse((e) => {
|
|
4119
|
-
if (!(e instanceof
|
|
4227
|
+
if (!(e instanceof m.Mesh) || !e.material) return;
|
|
4120
4228
|
let t = e.material;
|
|
4121
|
-
for (let e of
|
|
4229
|
+
for (let e of Sn) {
|
|
4122
4230
|
let n = t[e];
|
|
4123
4231
|
n && !n.image && (s.push({
|
|
4124
4232
|
rec: t,
|
|
@@ -4129,7 +4237,7 @@ async function An(e, t) {
|
|
|
4129
4237
|
});
|
|
4130
4238
|
try {
|
|
4131
4239
|
return {
|
|
4132
|
-
glb: new Uint8Array(await
|
|
4240
|
+
glb: new Uint8Array(await T(a, o, t)),
|
|
4133
4241
|
scene: a,
|
|
4134
4242
|
specs: o
|
|
4135
4243
|
};
|
|
@@ -4138,14 +4246,14 @@ async function An(e, t) {
|
|
|
4138
4246
|
}
|
|
4139
4247
|
}
|
|
4140
4248
|
// src/importer/chopShopActions.ts
|
|
4141
|
-
function
|
|
4249
|
+
function Ln(e) {
|
|
4142
4250
|
let t = e.islands.find((t) => t.id === e.loopDots.islandId);
|
|
4143
4251
|
if (!t) throw Error("Loop island no longer exists.");
|
|
4144
4252
|
let n, r;
|
|
4145
4253
|
if (e.splitCoarse) {
|
|
4146
4254
|
let i = t.mesh, a = i.geometry;
|
|
4147
|
-
i.geometry =
|
|
4148
|
-
let o =
|
|
4255
|
+
i.geometry = et(a, e.loopDots.points).geometry;
|
|
4256
|
+
let o = Me(e.workingScene), s = nt(e.islands, o);
|
|
4149
4257
|
n = () => {
|
|
4150
4258
|
i.geometry = a;
|
|
4151
4259
|
}, r = e.axles.map((e) => ({
|
|
@@ -4159,7 +4267,7 @@ function jn(e) {
|
|
|
4159
4267
|
if (t = o.find((e) => e.mesh === i && c.every((t, n) => t >= e.min[n] - .01 && t <= e.max[n] + .01)) ?? o[0], !t) throw Error("Refined surface lost seam anchor.");
|
|
4160
4268
|
}
|
|
4161
4269
|
return {
|
|
4162
|
-
selection:
|
|
4270
|
+
selection: $e(t, e.loopDots.points, {
|
|
4163
4271
|
mirrorX: e.mirrorX,
|
|
4164
4272
|
exact: e.splitCoarse
|
|
4165
4273
|
}),
|
|
@@ -4167,10 +4275,10 @@ function jn(e) {
|
|
|
4167
4275
|
nextAxles: r
|
|
4168
4276
|
};
|
|
4169
4277
|
}
|
|
4170
|
-
function
|
|
4278
|
+
function Rn(e) {
|
|
4171
4279
|
let t = e.islands.find((t) => t.id === e.faceSelection.islandId);
|
|
4172
4280
|
if (!t) throw Error("Selected surface island no longer exists.");
|
|
4173
|
-
let { mintedMeshes: n, undo: r } =
|
|
4281
|
+
let { mintedMeshes: n, undo: r } = tt(t, e.faceSelection, e.cutName), i = Me(e.workingScene), a = nt(e.islands, i), o = (e) => e.flatMap((e) => a.get(e) ?? []), s = e.prevAxles.map((e) => ({
|
|
4174
4282
|
...e,
|
|
4175
4283
|
left: o(e.left),
|
|
4176
4284
|
right: o(e.right)
|
|
@@ -4181,7 +4289,7 @@ function Mn(e) {
|
|
|
4181
4289
|
}
|
|
4182
4290
|
let l = new Set(n), u = i.filter((e) => l.has(e.mesh)).map((e) => e.id), d, f = !1;
|
|
4183
4291
|
if (e.activeRole === "wheel") {
|
|
4184
|
-
for (let t of u) s.some((e) => e.left.includes(t) || e.right.includes(t)) || (s =
|
|
4292
|
+
for (let t of u) s.some((e) => e.left.includes(t) || e.right.includes(t)) || (s = Ae(i, s, t, e.mode));
|
|
4185
4293
|
d = `Peeled ${u.length} wheel mesh(es) and paired axle!`;
|
|
4186
4294
|
} else {
|
|
4187
4295
|
for (let t of u) c[t] = e.activeRole;
|
|
@@ -4196,18 +4304,18 @@ function Mn(e) {
|
|
|
4196
4304
|
bumpHinge: f
|
|
4197
4305
|
};
|
|
4198
4306
|
}
|
|
4199
|
-
function
|
|
4307
|
+
function zn(e, t, n) {
|
|
4200
4308
|
if (t === "none" || e.delta > 5) return null;
|
|
4201
4309
|
e.stopPropagation();
|
|
4202
|
-
let r = e.face ? e.face.normal.clone().transformDirection(e.object.matrixWorld).normalize() : new
|
|
4310
|
+
let r = e.face ? e.face.normal.clone().transformDirection(e.object.matrixWorld).normalize() : new m.Vector3(0, 1, 0), i = e.point.clone().addScaledVector(r, .015), a = [
|
|
4203
4311
|
Number(i.x.toFixed(4)),
|
|
4204
4312
|
Number(i.y.toFixed(4)),
|
|
4205
4313
|
Number(i.z.toFixed(4))
|
|
4206
|
-
],
|
|
4314
|
+
], o = s(r), c = `${t}_${n}`;
|
|
4207
4315
|
return t === "plume" ? {
|
|
4208
4316
|
nodeName: `Kolmo_${c}`,
|
|
4209
4317
|
translation: a,
|
|
4210
|
-
rotation:
|
|
4318
|
+
rotation: o,
|
|
4211
4319
|
extension: {
|
|
4212
4320
|
kind: "plume",
|
|
4213
4321
|
drive: "boost",
|
|
@@ -4216,7 +4324,7 @@ function Nn(e, t, n) {
|
|
|
4216
4324
|
} : t === "sparkle" ? {
|
|
4217
4325
|
nodeName: `Kolmo_${c}`,
|
|
4218
4326
|
translation: a,
|
|
4219
|
-
rotation:
|
|
4327
|
+
rotation: o,
|
|
4220
4328
|
extension: {
|
|
4221
4329
|
kind: "sparkle",
|
|
4222
4330
|
drive: "throttle",
|
|
@@ -4225,7 +4333,7 @@ function Nn(e, t, n) {
|
|
|
4225
4333
|
} : t === "brake_flare" ? {
|
|
4226
4334
|
nodeName: `Kolmo_${c}`,
|
|
4227
4335
|
translation: a,
|
|
4228
|
-
rotation:
|
|
4336
|
+
rotation: o,
|
|
4229
4337
|
extension: {
|
|
4230
4338
|
kind: "flare",
|
|
4231
4339
|
drive: "brake",
|
|
@@ -4239,7 +4347,7 @@ function Nn(e, t, n) {
|
|
|
4239
4347
|
} : t === "headlight" ? {
|
|
4240
4348
|
nodeName: `Kolmo_${c}`,
|
|
4241
4349
|
translation: a,
|
|
4242
|
-
rotation:
|
|
4350
|
+
rotation: o,
|
|
4243
4351
|
extension: {
|
|
4244
4352
|
kind: "flare",
|
|
4245
4353
|
drive: "headlight",
|
|
@@ -4262,14 +4370,14 @@ function Nn(e, t, n) {
|
|
|
4262
4370
|
} : {
|
|
4263
4371
|
nodeName: `Socket_${c}`,
|
|
4264
4372
|
translation: a,
|
|
4265
|
-
rotation:
|
|
4373
|
+
rotation: o,
|
|
4266
4374
|
extension: { socket: t }
|
|
4267
4375
|
};
|
|
4268
4376
|
}
|
|
4269
|
-
async function
|
|
4377
|
+
async function Bn(e) {
|
|
4270
4378
|
let t = await e.arrayBuffer(), n = e.name.replace(/\.[^.]+$/, "") || "ImportedCar";
|
|
4271
|
-
if (
|
|
4272
|
-
let e = await
|
|
4379
|
+
if (wn(e.name)) {
|
|
4380
|
+
let e = await In(t);
|
|
4273
4381
|
return {
|
|
4274
4382
|
baseName: n,
|
|
4275
4383
|
scene: e.scene,
|
|
@@ -4278,12 +4386,12 @@ async function Pn(e) {
|
|
|
4278
4386
|
}
|
|
4279
4387
|
return {
|
|
4280
4388
|
baseName: n,
|
|
4281
|
-
scene: await new Promise((e, n) => new
|
|
4389
|
+
scene: await new Promise((e, n) => new le().parse(t, "", (t) => e(t.scene), n)),
|
|
4282
4390
|
usdInfo: null
|
|
4283
4391
|
};
|
|
4284
4392
|
}
|
|
4285
4393
|
// src/importer/universalGateBake.ts
|
|
4286
|
-
var
|
|
4394
|
+
var Vn = [
|
|
4287
4395
|
"map",
|
|
4288
4396
|
"normalMap",
|
|
4289
4397
|
"roughnessMap",
|
|
@@ -4291,19 +4399,19 @@ var Fn = [
|
|
|
4291
4399
|
"aoMap",
|
|
4292
4400
|
"emissiveMap"
|
|
4293
4401
|
];
|
|
4294
|
-
function
|
|
4402
|
+
function Hn(e, t, n, r) {
|
|
4295
4403
|
return [
|
|
4296
4404
|
Number((e / 12 * (n * n + r * r)).toFixed(4)),
|
|
4297
4405
|
Number((e / 12 * (t * t + r * r)).toFixed(4)),
|
|
4298
4406
|
Number((e / 12 * (t * t + n * n)).toFixed(4))
|
|
4299
4407
|
];
|
|
4300
4408
|
}
|
|
4301
|
-
async function
|
|
4409
|
+
async function Un(e, t, r, i) {
|
|
4302
4410
|
let a = [];
|
|
4303
4411
|
e.traverse((e) => {
|
|
4304
|
-
if (!(e instanceof
|
|
4412
|
+
if (!(e instanceof m.Mesh) || !e.material) return;
|
|
4305
4413
|
let t = e.material;
|
|
4306
|
-
for (let e of
|
|
4414
|
+
for (let e of Vn) {
|
|
4307
4415
|
let n = t[e];
|
|
4308
4416
|
n && !n.image && (a.push({
|
|
4309
4417
|
rec: t,
|
|
@@ -4314,16 +4422,16 @@ async function Ln(e, n, r, i) {
|
|
|
4314
4422
|
});
|
|
4315
4423
|
let o;
|
|
4316
4424
|
try {
|
|
4317
|
-
o = new Uint8Array(await
|
|
4425
|
+
o = new Uint8Array(await T(e, t, r));
|
|
4318
4426
|
} finally {
|
|
4319
4427
|
for (let e of a) e.rec[e.slot] = e.tex;
|
|
4320
4428
|
}
|
|
4321
|
-
let s =
|
|
4429
|
+
let s = n(o, i);
|
|
4322
4430
|
return s instanceof Uint8Array ? s : new Uint8Array(s);
|
|
4323
4431
|
}
|
|
4324
|
-
async function
|
|
4432
|
+
async function Wn(e) {
|
|
4325
4433
|
if (e.domain === "vehicle" && e.usePaperShellProxy) {
|
|
4326
|
-
let { glb:
|
|
4434
|
+
let { glb: t } = await ye(e.assembly, e.attachedMask, e.fuelLiters), r = new Uint8Array(D(t, (e) => {
|
|
4327
4435
|
let t = e.scenes?.[0];
|
|
4328
4436
|
t && (t.extras = {
|
|
4329
4437
|
...t.extras ?? {},
|
|
@@ -4340,7 +4448,7 @@ async function Rn(e) {
|
|
|
4340
4448
|
antiRollStiffness: 2400
|
|
4341
4449
|
}
|
|
4342
4450
|
});
|
|
4343
|
-
})), i = new Uint8Array(
|
|
4451
|
+
})), i = new Uint8Array(n(r, [{
|
|
4344
4452
|
nodeName: "Socket_seat_gate",
|
|
4345
4453
|
translation: [
|
|
4346
4454
|
.34,
|
|
@@ -4351,13 +4459,13 @@ async function Rn(e) {
|
|
|
4351
4459
|
}, ...e.patches])), a = i.buffer.slice(i.byteOffset, i.byteOffset + i.byteLength);
|
|
4352
4460
|
return {
|
|
4353
4461
|
glbBytes: i,
|
|
4354
|
-
bundle: await
|
|
4462
|
+
bundle: await E(a),
|
|
4355
4463
|
worldKind: "car"
|
|
4356
4464
|
};
|
|
4357
4465
|
}
|
|
4358
|
-
let
|
|
4466
|
+
let t = e.normalizedScene ?? new m.Group();
|
|
4359
4467
|
if (e.domain === "vehicle") {
|
|
4360
|
-
let
|
|
4468
|
+
let n = await ut(t, {
|
|
4361
4469
|
archetype: e.vehicleArchetype,
|
|
4362
4470
|
massKg: e.massKg,
|
|
4363
4471
|
powerOrThrust: e.powerOrThrust,
|
|
@@ -4368,42 +4476,42 @@ async function Rn(e) {
|
|
|
4368
4476
|
partPicks: e.partPicks,
|
|
4369
4477
|
patches: e.patches,
|
|
4370
4478
|
name: e.name
|
|
4371
|
-
}), r =
|
|
4479
|
+
}), r = n.buffer.slice(n.byteOffset, n.byteOffset + n.byteLength);
|
|
4372
4480
|
return {
|
|
4373
|
-
glbBytes:
|
|
4374
|
-
bundle: await
|
|
4481
|
+
glbBytes: n,
|
|
4482
|
+
bundle: await E(r),
|
|
4375
4483
|
worldKind: e.vehicleArchetype
|
|
4376
4484
|
};
|
|
4377
4485
|
}
|
|
4378
4486
|
if (e.domain === "launcher") {
|
|
4379
|
-
let
|
|
4487
|
+
let n = e.name.toLowerCase(), { glbBytes: r, bundle: i } = await _t(n.includes("pistol") ? de : n.includes("shotgun") ? fe : ue, e.normalizedScene && !e.normalizedScene.name.startsWith("Starter_") ? t : null, e.patches);
|
|
4380
4488
|
return {
|
|
4381
4489
|
glbBytes: r,
|
|
4382
4490
|
bundle: i,
|
|
4383
4491
|
worldKind: "prop"
|
|
4384
4492
|
};
|
|
4385
4493
|
}
|
|
4386
|
-
|
|
4387
|
-
let r = new
|
|
4494
|
+
t.updateMatrixWorld(!0);
|
|
4495
|
+
let r = new m.Box3().setFromObject(t), i = r.isEmpty() ? new m.Vector3(1, 1, 1) : r.getSize(new m.Vector3()), a = r.isEmpty() ? new m.Vector3(0, .5, 0) : r.getCenter(new m.Vector3()), o = Math.max(.08, i.x), s = Math.max(.08, i.y), c = Math.max(.08, i.z), l = new m.Group();
|
|
4388
4496
|
l.name = e.name;
|
|
4389
|
-
let u = new
|
|
4497
|
+
let u = new m.Group();
|
|
4390
4498
|
u.name = e.domain === "c12" ? "C12Shell" : e.domain === "person" ? "PersonRig" : e.domain === "junk" ? "JunkTarget" : "PropBody";
|
|
4391
4499
|
let d = !1;
|
|
4392
|
-
for (let e of
|
|
4393
|
-
e instanceof
|
|
4500
|
+
for (let e of t.clone(!0).children) u.add(e), e.traverse((e) => {
|
|
4501
|
+
e instanceof m.Mesh && (e.geometry?.getAttribute("position")?.count ?? 0) >= 3 && (d = !0);
|
|
4394
4502
|
});
|
|
4395
4503
|
l.add(u);
|
|
4396
|
-
let f = e.domain === "c12" || e.domain === "prop" && e.staticProp,
|
|
4504
|
+
let f = e.domain === "c12" || e.domain === "prop" && e.staticProp, p = Math.max(.5, e.massKg || (e.domain === "person" ? 72 : e.domain === "junk" ? 18 : 65)), h = [
|
|
4397
4505
|
Number(a.x.toFixed(4)),
|
|
4398
4506
|
Number(a.y.toFixed(4)),
|
|
4399
4507
|
Number(a.z.toFixed(4))
|
|
4400
|
-
], g = await
|
|
4508
|
+
], g = await Un(l, [{
|
|
4401
4509
|
nodeName: u.name,
|
|
4402
4510
|
motion: f ? { isKinematic: !0 } : {
|
|
4403
4511
|
isKinematic: !1,
|
|
4404
|
-
mass:
|
|
4512
|
+
mass: p,
|
|
4405
4513
|
centerOfMass: h,
|
|
4406
|
-
inertiaDiagonal:
|
|
4514
|
+
inertiaDiagonal: Hn(p, o, s, c)
|
|
4407
4515
|
},
|
|
4408
4516
|
collider: d && !f ? {
|
|
4409
4517
|
meshNodeName: u.name,
|
|
@@ -4433,33 +4541,33 @@ async function Rn(e) {
|
|
|
4433
4541
|
}], { gateDomain: e.domain }, e.patches), _ = g.buffer.slice(g.byteOffset, g.byteOffset + g.byteLength);
|
|
4434
4542
|
return {
|
|
4435
4543
|
glbBytes: g,
|
|
4436
|
-
bundle: await
|
|
4544
|
+
bundle: await E(_),
|
|
4437
4545
|
worldKind: "prop"
|
|
4438
4546
|
};
|
|
4439
4547
|
}
|
|
4440
4548
|
// src/importer/useChopShopController.ts
|
|
4441
|
-
function
|
|
4442
|
-
let t =
|
|
4549
|
+
function Gn(e) {
|
|
4550
|
+
let t = J(), [n, r] = p("pickup_truck"), [i, a] = p(!1), [o, s] = p(null), [c, m] = p(null), [h, g] = p([
|
|
4443
4551
|
0,
|
|
4444
4552
|
0,
|
|
4445
4553
|
0
|
|
4446
|
-
]), [_, v] =
|
|
4447
|
-
L(!0), new
|
|
4554
|
+
]), [_, v] = p(4.65), [y, b] = p(0), [x, S] = p(null), [C, w] = p(0), [T, E] = p([]), [D, O] = p({}), [k, A] = p("imported"), [j, ee] = p("door"), [M, te] = p("crease"), [ne, re] = p(32), [ie, ae] = p(!0), [oe, se] = p(!1), [ce, N] = p(null), [P, F] = p(null), [ue, de] = p(0), [fe, pe] = p(0), [me, he] = p([]), [ge, I] = p("Click a door/hood face with Crease Flood or Tape Lasso, then Peel!"), [_e, ye] = p("none"), [be, xe] = p([]), [Se, Ce] = p(null), [we, L] = p(!1), Te = f(null), Ee = f(null), R = f(null), De = f(0), z = l((e, t) => {
|
|
4555
|
+
L(!0), new le().load(e, (e) => {
|
|
4448
4556
|
r(t), m(e.scene), g([
|
|
4449
4557
|
0,
|
|
4450
4558
|
0,
|
|
4451
4559
|
0
|
|
4452
|
-
]), v(t.includes("pickup") ? 4.65 : 4.2), O({}), N(null),
|
|
4560
|
+
]), v(t.includes("pickup") ? 4.65 : 4.2), O({}), N(null), F(null), he([]), de(0), I(`Loaded ${t} — chop doors/hood/trunk or pop tires!`), L(!1);
|
|
4453
4561
|
}, void 0, () => L(!1));
|
|
4454
4562
|
}, []);
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
}, [
|
|
4458
|
-
let
|
|
4459
|
-
let e =
|
|
4563
|
+
u(() => {
|
|
4564
|
+
z("/models/pickup-truck.glb", "pickup_truck");
|
|
4565
|
+
}, [z]);
|
|
4566
|
+
let B = d(() => {
|
|
4567
|
+
let e = c ?? (t.domain === "vehicle" && t.usePaperShellProxy ? null : It(t.domain));
|
|
4460
4568
|
if (!e) return null;
|
|
4461
4569
|
try {
|
|
4462
|
-
return
|
|
4570
|
+
return je(e, {
|
|
4463
4571
|
turns: h,
|
|
4464
4572
|
targetMeters: Math.max(.05, _),
|
|
4465
4573
|
axis: "lengthZ"
|
|
@@ -4468,74 +4576,74 @@ function zn(e) {
|
|
|
4468
4576
|
return null;
|
|
4469
4577
|
}
|
|
4470
4578
|
}, [
|
|
4471
|
-
|
|
4579
|
+
c,
|
|
4472
4580
|
t.domain,
|
|
4473
4581
|
t.usePaperShellProxy,
|
|
4474
4582
|
h,
|
|
4475
4583
|
_
|
|
4476
|
-
]),
|
|
4584
|
+
]), V = d(() => x ?? ve(t.presetId, t.shadingMode), [
|
|
4477
4585
|
x,
|
|
4478
4586
|
t.presetId,
|
|
4479
4587
|
t.shadingMode
|
|
4480
4588
|
]);
|
|
4481
|
-
|
|
4482
|
-
t.domain === "vehicle" && t.usePaperShellProxy ?
|
|
4589
|
+
u(() => {
|
|
4590
|
+
t.domain === "vehicle" && t.usePaperShellProxy ? Xt(V, 1, y, !!c, B) : B && Zt(B, y);
|
|
4483
4591
|
}, [
|
|
4484
4592
|
t.domain,
|
|
4485
4593
|
t.usePaperShellProxy,
|
|
4594
|
+
V,
|
|
4486
4595
|
B,
|
|
4487
|
-
z,
|
|
4488
4596
|
y,
|
|
4489
|
-
|
|
4597
|
+
c,
|
|
4490
4598
|
C
|
|
4491
4599
|
]);
|
|
4492
|
-
let
|
|
4493
|
-
|
|
4600
|
+
let H = d(() => B && t.domain === "vehicle" && !t.usePaperShellProxy && t.vehicleArchetype !== "starcraft" ? Me(B) : [], [
|
|
4601
|
+
B,
|
|
4494
4602
|
t.domain,
|
|
4495
4603
|
t.usePaperShellProxy,
|
|
4496
4604
|
t.vehicleArchetype,
|
|
4497
4605
|
C
|
|
4498
4606
|
]);
|
|
4499
|
-
|
|
4500
|
-
for (let e of
|
|
4501
|
-
}, [
|
|
4502
|
-
if (!
|
|
4503
|
-
let e =
|
|
4504
|
-
E(t.vehicleArchetype === "car" ?
|
|
4607
|
+
u(() => () => {
|
|
4608
|
+
for (let e of H) e.geometry.dispose();
|
|
4609
|
+
}, [H]), u(() => {
|
|
4610
|
+
if (!B) return;
|
|
4611
|
+
let e = Me(B);
|
|
4612
|
+
E(t.vehicleArchetype === "car" ? Oe(e) : t.vehicleArchetype === "motorcycle" ? ke(e) : []);
|
|
4505
4613
|
for (let t of e) t.geometry.dispose();
|
|
4506
|
-
O({}), N(null),
|
|
4507
|
-
}, [
|
|
4508
|
-
let
|
|
4614
|
+
O({}), N(null), F(null), he([]);
|
|
4615
|
+
}, [B, t.vehicleArchetype]);
|
|
4616
|
+
let U = d(() => new Set(T.flatMap((e) => [...e.left, ...e.right])), [T]), Ne = d(() => {
|
|
4509
4617
|
let e = /* @__PURE__ */ new Map();
|
|
4510
4618
|
return T.forEach((t, n) => {
|
|
4511
4619
|
for (let r of [...t.left, ...t.right]) e.set(r, n === 0 ? "#00E5FF" : "#10B981");
|
|
4512
4620
|
}), e;
|
|
4513
4621
|
}, [T]);
|
|
4514
|
-
return
|
|
4622
|
+
return u(() => {
|
|
4515
4623
|
if (t.step !== 2 || t.domain === "vehicle" && t.usePaperShellProxy) return;
|
|
4516
4624
|
let e = !0;
|
|
4517
|
-
return
|
|
4625
|
+
return Wn({
|
|
4518
4626
|
name: n,
|
|
4519
4627
|
domain: t.domain,
|
|
4520
4628
|
vehicleArchetype: t.vehicleArchetype,
|
|
4521
4629
|
usePaperShellProxy: !1,
|
|
4522
|
-
assembly:
|
|
4630
|
+
assembly: V,
|
|
4523
4631
|
attachedMask: t.attachedMask,
|
|
4524
4632
|
fuelLiters: t.fuelLiters,
|
|
4525
|
-
normalizedScene:
|
|
4633
|
+
normalizedScene: B,
|
|
4526
4634
|
massKg: t.massKg,
|
|
4527
4635
|
powerOrThrust: t.powerOrThrust,
|
|
4528
4636
|
driveType: t.driveType,
|
|
4529
4637
|
staticProp: t.staticProp,
|
|
4530
4638
|
axles: T,
|
|
4531
|
-
islands:
|
|
4639
|
+
islands: H,
|
|
4532
4640
|
partPicks: D,
|
|
4533
4641
|
wheelSource: k,
|
|
4534
|
-
patches:
|
|
4642
|
+
patches: be
|
|
4535
4643
|
}).then((t) => {
|
|
4536
|
-
e &&
|
|
4644
|
+
e && Ce(t.bundle);
|
|
4537
4645
|
}).catch(() => {
|
|
4538
|
-
e &&
|
|
4646
|
+
e && Ce(null);
|
|
4539
4647
|
}), () => {
|
|
4540
4648
|
e = !1;
|
|
4541
4649
|
};
|
|
@@ -4549,13 +4657,13 @@ function zn(e) {
|
|
|
4549
4657
|
t.driveType,
|
|
4550
4658
|
t.staticProp,
|
|
4551
4659
|
n,
|
|
4660
|
+
V,
|
|
4552
4661
|
B,
|
|
4553
|
-
z,
|
|
4554
4662
|
T,
|
|
4555
|
-
|
|
4663
|
+
H,
|
|
4556
4664
|
D,
|
|
4557
4665
|
k,
|
|
4558
|
-
|
|
4666
|
+
be
|
|
4559
4667
|
]), {
|
|
4560
4668
|
st: t,
|
|
4561
4669
|
assetName: n,
|
|
@@ -4581,73 +4689,73 @@ function zn(e) {
|
|
|
4581
4689
|
setMirrorX: ae,
|
|
4582
4690
|
splitCoarse: oe,
|
|
4583
4691
|
setSplitCoarse: se,
|
|
4584
|
-
faceSelection:
|
|
4692
|
+
faceSelection: ce,
|
|
4585
4693
|
setFaceSelection: N,
|
|
4586
|
-
loopDots:
|
|
4587
|
-
setLoopDots:
|
|
4588
|
-
hingeScrub:
|
|
4589
|
-
setHingeScrub:
|
|
4590
|
-
explodeAmount:
|
|
4591
|
-
setExplodeAmount:
|
|
4592
|
-
undoStack:
|
|
4593
|
-
statusNote:
|
|
4594
|
-
stampTool:
|
|
4595
|
-
setStampTool:
|
|
4596
|
-
patches:
|
|
4597
|
-
setPatches:
|
|
4598
|
-
liveBundle:
|
|
4599
|
-
busy:
|
|
4694
|
+
loopDots: P,
|
|
4695
|
+
setLoopDots: F,
|
|
4696
|
+
hingeScrub: ue,
|
|
4697
|
+
setHingeScrub: de,
|
|
4698
|
+
explodeAmount: fe,
|
|
4699
|
+
setExplodeAmount: pe,
|
|
4700
|
+
undoStack: me,
|
|
4701
|
+
statusNote: ge,
|
|
4702
|
+
stampTool: _e,
|
|
4703
|
+
setStampTool: ye,
|
|
4704
|
+
patches: be,
|
|
4705
|
+
setPatches: xe,
|
|
4706
|
+
liveBundle: Se,
|
|
4707
|
+
busy: we,
|
|
4600
4708
|
fileRef: Te,
|
|
4601
|
-
rootObjRef:
|
|
4602
|
-
panelAnimRef:
|
|
4603
|
-
workingScene:
|
|
4604
|
-
assembly:
|
|
4709
|
+
rootObjRef: Ee,
|
|
4710
|
+
panelAnimRef: R,
|
|
4711
|
+
workingScene: B,
|
|
4712
|
+
assembly: V,
|
|
4605
4713
|
setProxyAssembly: S,
|
|
4606
|
-
islands:
|
|
4607
|
-
wheelColors:
|
|
4608
|
-
loadStarterCar:
|
|
4714
|
+
islands: H,
|
|
4715
|
+
wheelColors: Ne,
|
|
4716
|
+
loadStarterCar: z,
|
|
4609
4717
|
ingestFile: async (e) => {
|
|
4610
4718
|
L(!0);
|
|
4611
4719
|
try {
|
|
4612
|
-
let { baseName: n, scene: i, usdInfo: o } = await
|
|
4720
|
+
let { baseName: n, scene: i, usdInfo: o } = await Bn(e);
|
|
4613
4721
|
r(n), a(!0), g([
|
|
4614
4722
|
0,
|
|
4615
4723
|
0,
|
|
4616
4724
|
0
|
|
4617
|
-
]), b(0),
|
|
4725
|
+
]), b(0), xe([]), t.setField("step", 1), m(i), s(o), o ? t.setField("usePaperShellProxy", !1) : t.domain === "vehicle" && t.usePaperShellProxy && S(Qt(i, t.presetId, t.shadingMode)), I(`Imported "${n}" — orient/scale, pop wheels, and chop doors/hood!`);
|
|
4618
4726
|
} finally {
|
|
4619
4727
|
L(!1);
|
|
4620
4728
|
}
|
|
4621
4729
|
},
|
|
4622
4730
|
applyDomainDefaults: (e, n, r) => {
|
|
4623
|
-
let i =
|
|
4624
|
-
t.setField("domain", e), t.setField("vehicleArchetype", n), t.setField("usePaperShellProxy", r), t.setField("massKg", i.massKg), t.setField("powerOrThrust", i.power), t.setField("step", 1), v(e === "c12" ?
|
|
4731
|
+
let i = Yt(e, n);
|
|
4732
|
+
t.setField("domain", e), t.setField("vehicleArchetype", n), t.setField("usePaperShellProxy", r), t.setField("massKg", i.massKg), t.setField("powerOrThrust", i.power), t.setField("step", 1), v(e === "c12" ? Kt(i.len) : i.len);
|
|
4625
4733
|
},
|
|
4626
4734
|
handleBucketIsland: (e) => {
|
|
4627
4735
|
if (t.vehicleArchetype === "starcraft") return;
|
|
4628
4736
|
if (j === "wheel") {
|
|
4629
|
-
E((n) =>
|
|
4737
|
+
E((n) => Ae(H, n, e, t.vehicleArchetype === "motorcycle" ? "motorcycle" : "car"));
|
|
4630
4738
|
return;
|
|
4631
4739
|
}
|
|
4632
|
-
if (
|
|
4633
|
-
|
|
4740
|
+
if (U.has(e)) {
|
|
4741
|
+
I("That island is already paired as a wheel.");
|
|
4634
4742
|
return;
|
|
4635
4743
|
}
|
|
4636
|
-
let n =
|
|
4637
|
-
if (
|
|
4638
|
-
|
|
4744
|
+
let n = H.reduce((e, t) => t.triangleIndices.length > e.triangleIndices.length ? t : e, H[0]);
|
|
4745
|
+
if (H.length > 1 && e === n.id) {
|
|
4746
|
+
I("Main body shell — switch to Crease Flood or Tape Lasso to cut a panel!");
|
|
4639
4747
|
return;
|
|
4640
4748
|
}
|
|
4641
|
-
let r = ie && (j === "door" || j === "fender") ?
|
|
4749
|
+
let r = ie && (j === "door" || j === "fender") ? rt(H, e, U) : null, i = r === null ? [e] : [e, r];
|
|
4642
4750
|
O((t) => {
|
|
4643
4751
|
let n = { ...t }, r = t[e] === j;
|
|
4644
4752
|
for (let e of i) r ? delete n[e] : n[e] = j;
|
|
4645
|
-
return
|
|
4753
|
+
return I(r ? `Cleared ${j} tag.` : `Tagged ${i.length} piece(s) as ${j} — drag Hinges to test!`), n;
|
|
4646
4754
|
});
|
|
4647
4755
|
},
|
|
4648
4756
|
handlePickFace: (e) => {
|
|
4649
|
-
let t =
|
|
4650
|
-
t && (M === "loop" ? (N(null),
|
|
4757
|
+
let t = H.find((t) => t.id === e.islandId);
|
|
4758
|
+
t && (M === "loop" ? (N(null), F((n) => e.erase ? n && n.points.length > 1 ? {
|
|
4651
4759
|
...n,
|
|
4652
4760
|
points: n.points.slice(0, -1)
|
|
4653
4761
|
} : null : n?.islandId === t.id ? {
|
|
@@ -4656,7 +4764,7 @@ function zn(e) {
|
|
|
4656
4764
|
} : {
|
|
4657
4765
|
islandId: t.id,
|
|
4658
4766
|
points: [e.point]
|
|
4659
|
-
})) : (M === "crease" && !e.isDrag || M === "triangle") && N((n) =>
|
|
4767
|
+
})) : (M === "crease" && !e.isDrag || M === "triangle") && N((n) => Ze(t, e.faceIndex, M, {
|
|
4660
4768
|
creaseDeg: ne,
|
|
4661
4769
|
mirrorX: ie,
|
|
4662
4770
|
current: n,
|
|
@@ -4671,74 +4779,74 @@ function zn(e) {
|
|
|
4671
4779
|
]), v(n), a(!0);
|
|
4672
4780
|
},
|
|
4673
4781
|
handleCloseLoop: () => {
|
|
4674
|
-
if (
|
|
4675
|
-
let e =
|
|
4676
|
-
workingScene:
|
|
4677
|
-
islands:
|
|
4678
|
-
loopDots:
|
|
4782
|
+
if (B && P) try {
|
|
4783
|
+
let e = Ln({
|
|
4784
|
+
workingScene: B,
|
|
4785
|
+
islands: H,
|
|
4786
|
+
loopDots: P,
|
|
4679
4787
|
splitCoarse: oe,
|
|
4680
4788
|
mirrorX: ie,
|
|
4681
4789
|
axles: T
|
|
4682
4790
|
});
|
|
4683
|
-
e.refinedUndo && e.nextAxles && (
|
|
4791
|
+
e.refinedUndo && e.nextAxles && (he((t) => [...t, {
|
|
4684
4792
|
undo: e.refinedUndo,
|
|
4685
4793
|
axles: T,
|
|
4686
4794
|
picks: D
|
|
4687
|
-
}]), E(e.nextAxles), w((e) => e + 1)), N(e.selection),
|
|
4795
|
+
}]), E(e.nextAxles), w((e) => e + 1)), N(e.selection), F(null), I("Loop closed — click PEEL to slice those faces into a real part!");
|
|
4688
4796
|
} catch (e) {
|
|
4689
|
-
|
|
4797
|
+
I(e instanceof Error ? e.message : "Could not close loop.");
|
|
4690
4798
|
}
|
|
4691
4799
|
},
|
|
4692
4800
|
handlePeelSelection: () => {
|
|
4693
|
-
if (
|
|
4694
|
-
let e =
|
|
4695
|
-
workingScene:
|
|
4696
|
-
islands:
|
|
4697
|
-
faceSelection:
|
|
4801
|
+
if (B && ce && ce.triangles.length !== 0) try {
|
|
4802
|
+
let e = Rn({
|
|
4803
|
+
workingScene: B,
|
|
4804
|
+
islands: H,
|
|
4805
|
+
faceSelection: ce,
|
|
4698
4806
|
activeRole: j,
|
|
4699
|
-
cutName: `${j}_chop_${++
|
|
4807
|
+
cutName: `${j}_chop_${++De.current}`,
|
|
4700
4808
|
prevAxles: T,
|
|
4701
4809
|
prevPicks: D,
|
|
4702
4810
|
mode: t.vehicleArchetype === "motorcycle" ? "motorcycle" : "car"
|
|
4703
4811
|
});
|
|
4704
|
-
e.bumpHinge &&
|
|
4812
|
+
e.bumpHinge && ue === 0 && de(.48), he((t) => [...t, {
|
|
4705
4813
|
undo: e.undo,
|
|
4706
4814
|
axles: T,
|
|
4707
4815
|
picks: D
|
|
4708
|
-
}]), E(e.nextAxles), O(e.nextPicks), N(null),
|
|
4816
|
+
}]), E(e.nextAxles), O(e.nextPicks), N(null), F(null), w((e) => e + 1), I(e.status);
|
|
4709
4817
|
} catch (e) {
|
|
4710
|
-
|
|
4818
|
+
I(e instanceof Error ? e.message : "Peel failed.");
|
|
4711
4819
|
}
|
|
4712
4820
|
},
|
|
4713
4821
|
handleUndoCut: () => {
|
|
4714
|
-
let e =
|
|
4715
|
-
e && (e.undo(),
|
|
4822
|
+
let e = me[me.length - 1];
|
|
4823
|
+
e && (e.undo(), he((e) => e.slice(0, -1)), E(e.axles), O(e.picks), N(null), F(null), w((e) => e + 1), I("Undid last cut."));
|
|
4716
4824
|
},
|
|
4717
4825
|
handleStampSurface: (e) => {
|
|
4718
|
-
let t =
|
|
4719
|
-
t &&
|
|
4826
|
+
let t = zn(e, _e, be.length + 1);
|
|
4827
|
+
t && xe((e) => [...e, t]);
|
|
4720
4828
|
},
|
|
4721
4829
|
sealAndExport: async (r) => {
|
|
4722
4830
|
L(!0);
|
|
4723
4831
|
try {
|
|
4724
|
-
let i = await
|
|
4832
|
+
let i = await Wn({
|
|
4725
4833
|
name: n,
|
|
4726
4834
|
domain: t.domain,
|
|
4727
4835
|
vehicleArchetype: t.vehicleArchetype,
|
|
4728
4836
|
usePaperShellProxy: t.usePaperShellProxy,
|
|
4729
|
-
assembly:
|
|
4837
|
+
assembly: V,
|
|
4730
4838
|
attachedMask: t.attachedMask,
|
|
4731
4839
|
fuelLiters: t.fuelLiters,
|
|
4732
|
-
normalizedScene:
|
|
4840
|
+
normalizedScene: B,
|
|
4733
4841
|
massKg: t.massKg,
|
|
4734
4842
|
powerOrThrust: t.powerOrThrust,
|
|
4735
4843
|
driveType: t.driveType,
|
|
4736
4844
|
staticProp: t.staticProp,
|
|
4737
4845
|
axles: T,
|
|
4738
|
-
islands:
|
|
4846
|
+
islands: H,
|
|
4739
4847
|
partPicks: D,
|
|
4740
4848
|
wheelSource: k,
|
|
4741
|
-
patches:
|
|
4849
|
+
patches: be
|
|
4742
4850
|
});
|
|
4743
4851
|
if (r && e) e({
|
|
4744
4852
|
id: `${n.toLowerCase().replace(/[^a-z0-9]+/g, "_")}_${Date.now().toString(36)}`,
|
|
@@ -4758,7 +4866,7 @@ function zn(e) {
|
|
|
4758
4866
|
},
|
|
4759
4867
|
wheelCount: T.reduce((e, t) => e + +(t.left.length > 0) + +(t.right.length > 0), 0),
|
|
4760
4868
|
choppedCount: Object.keys(D).length,
|
|
4761
|
-
unlocked:
|
|
4869
|
+
unlocked: Ct(t.calibration, t.domain, t.vehicleArchetype, t.usePaperShellProxy),
|
|
4762
4870
|
activeRoleColor: Pe.find((e) => e.role === j)?.color ?? "#FFB000",
|
|
4763
4871
|
bumpTurn: (e) => g((t) => {
|
|
4764
4872
|
let n = [...t];
|
|
@@ -4766,17 +4874,17 @@ function zn(e) {
|
|
|
4766
4874
|
}),
|
|
4767
4875
|
wrapProxy: () => {
|
|
4768
4876
|
let e = !t.usePaperShellProxy;
|
|
4769
|
-
t.setField("usePaperShellProxy", e), e && S(
|
|
4877
|
+
t.setField("usePaperShellProxy", e), e && S(Qt(B, t.presetId, t.shadingMode));
|
|
4770
4878
|
},
|
|
4771
|
-
autoPopWheels: () => E(t.vehicleArchetype === "car" ?
|
|
4772
|
-
autoScaleSi: () => v(
|
|
4773
|
-
snapC12: () => v((e) =>
|
|
4879
|
+
autoPopWheels: () => E(t.vehicleArchetype === "car" ? Oe(H) : ke(H)),
|
|
4880
|
+
autoScaleSi: () => v(Yt(t.domain, t.vehicleArchetype).len),
|
|
4881
|
+
snapC12: () => v((e) => Kt(e))
|
|
4774
4882
|
};
|
|
4775
4883
|
}
|
|
4776
4884
|
// src/importer/GlbImportGate.tsx
|
|
4777
|
-
function
|
|
4778
|
-
let n =
|
|
4779
|
-
return
|
|
4885
|
+
function Kn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
4886
|
+
let n = Gn(e), { st: r } = n, i = r.step === 1 && r.domain === "vehicle" && !r.usePaperShellProxy && r.vehicleArchetype !== "starcraft", a = !(r.step === 2 && r.domain === "vehicle" && !r.usePaperShellProxy && r.chaseCam && n.stampTool === "none");
|
|
4887
|
+
return Ft(d(() => ({
|
|
4780
4888
|
assetName: n.assetName,
|
|
4781
4889
|
wheelCount: n.wheelCount,
|
|
4782
4890
|
choppedCount: n.choppedCount,
|
|
@@ -4795,7 +4903,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4795
4903
|
}]);
|
|
4796
4904
|
},
|
|
4797
4905
|
sealAndExport: n.sealAndExport
|
|
4798
|
-
}), [n]), t), /* @__PURE__ */
|
|
4906
|
+
}), [n]), t), /* @__PURE__ */ A("div", {
|
|
4799
4907
|
onDragOver: (e) => e.preventDefault(),
|
|
4800
4908
|
onDrop: (e) => {
|
|
4801
4909
|
e.preventDefault();
|
|
@@ -4813,7 +4921,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4813
4921
|
imageRendering: r.eraMode === "psx-1-3" ? "pixelated" : "auto"
|
|
4814
4922
|
},
|
|
4815
4923
|
children: [
|
|
4816
|
-
/* @__PURE__ */
|
|
4924
|
+
/* @__PURE__ */ k("input", {
|
|
4817
4925
|
ref: n.fileRef,
|
|
4818
4926
|
type: "file",
|
|
4819
4927
|
accept: ".glb,.usd,.usda,.usdc,.usdz",
|
|
@@ -4823,7 +4931,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4823
4931
|
t && n.ingestFile(t);
|
|
4824
4932
|
}
|
|
4825
4933
|
}),
|
|
4826
|
-
/* @__PURE__ */
|
|
4934
|
+
/* @__PURE__ */ k(Mt, {
|
|
4827
4935
|
hasCustomFile: n.hasCustomFile,
|
|
4828
4936
|
assetName: n.assetName,
|
|
4829
4937
|
usdInfo: n.usdInfo,
|
|
@@ -4848,7 +4956,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4848
4956
|
onDownloadGlb: () => void n.sealAndExport(!1),
|
|
4849
4957
|
onSpawnWorld: e ? () => void n.sealAndExport(!0) : void 0
|
|
4850
4958
|
}),
|
|
4851
|
-
r.step === 1 && r.domain !== "vehicle" && /* @__PURE__ */
|
|
4959
|
+
r.step === 1 && r.domain !== "vehicle" && /* @__PURE__ */ k(bt, {
|
|
4852
4960
|
domain: r.domain,
|
|
4853
4961
|
targetMeters: n.targetMeters,
|
|
4854
4962
|
onChangeTargetMeters: n.setTargetMeters,
|
|
@@ -4861,9 +4969,9 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4861
4969
|
extension: { socket: "optic" }
|
|
4862
4970
|
}]),
|
|
4863
4971
|
workingScene: n.workingScene,
|
|
4864
|
-
onEnforceCrispyPerson: () =>
|
|
4972
|
+
onEnforceCrispyPerson: () => yt(n.workingScene)
|
|
4865
4973
|
}),
|
|
4866
|
-
i && /* @__PURE__ */
|
|
4974
|
+
i && /* @__PURE__ */ k(mt, {
|
|
4867
4975
|
targetMeters: n.targetMeters,
|
|
4868
4976
|
onChangeTargetMeters: n.setTargetMeters,
|
|
4869
4977
|
activeRole: n.activeRole,
|
|
@@ -4909,12 +5017,12 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4909
5017
|
onGoTestDrive: () => r.setField("step", 2),
|
|
4910
5018
|
onSpawnWorld: e ? () => void n.sealAndExport(!0) : void 0
|
|
4911
5019
|
}),
|
|
4912
|
-
/* @__PURE__ */
|
|
5020
|
+
/* @__PURE__ */ k("div", {
|
|
4913
5021
|
style: {
|
|
4914
5022
|
flex: 1,
|
|
4915
5023
|
minHeight: 0
|
|
4916
5024
|
},
|
|
4917
|
-
children: /* @__PURE__ */
|
|
5025
|
+
children: /* @__PURE__ */ A(h, {
|
|
4918
5026
|
dpr: r.eraMode === "psx-1-3" ? .333 : [1, 1.5],
|
|
4919
5027
|
gl: {
|
|
4920
5028
|
localClippingEnabled: !0,
|
|
@@ -4929,12 +5037,12 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4929
5037
|
fov: 45
|
|
4930
5038
|
},
|
|
4931
5039
|
children: [
|
|
4932
|
-
/* @__PURE__ */
|
|
5040
|
+
/* @__PURE__ */ k("color", {
|
|
4933
5041
|
attach: "background",
|
|
4934
5042
|
args: ["#0A0C0E"]
|
|
4935
5043
|
}),
|
|
4936
|
-
/* @__PURE__ */
|
|
4937
|
-
/* @__PURE__ */
|
|
5044
|
+
/* @__PURE__ */ k("ambientLight", { intensity: .72 }),
|
|
5045
|
+
/* @__PURE__ */ k("directionalLight", {
|
|
4938
5046
|
position: [
|
|
4939
5047
|
6,
|
|
4940
5048
|
10,
|
|
@@ -4942,7 +5050,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4942
5050
|
],
|
|
4943
5051
|
intensity: 1.35
|
|
4944
5052
|
}),
|
|
4945
|
-
/* @__PURE__ */
|
|
5053
|
+
/* @__PURE__ */ k("directionalLight", {
|
|
4946
5054
|
position: [
|
|
4947
5055
|
-6,
|
|
4948
5056
|
4,
|
|
@@ -4951,7 +5059,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4951
5059
|
intensity: .45,
|
|
4952
5060
|
color: "#00E5FF"
|
|
4953
5061
|
}),
|
|
4954
|
-
/* @__PURE__ */
|
|
5062
|
+
/* @__PURE__ */ k(b, {
|
|
4955
5063
|
infiniteGrid: !0,
|
|
4956
5064
|
cellSize: r.domain === "c12" ? 1 / 12 : .5,
|
|
4957
5065
|
sectionSize: 3,
|
|
@@ -4959,12 +5067,12 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4959
5067
|
cellColor: "#12161B",
|
|
4960
5068
|
fadeDistance: 90
|
|
4961
5069
|
}),
|
|
4962
|
-
/* @__PURE__ */
|
|
5070
|
+
/* @__PURE__ */ k(S, {
|
|
4963
5071
|
makeDefault: !0,
|
|
4964
5072
|
enabled: a,
|
|
4965
5073
|
enableDamping: !0
|
|
4966
5074
|
}),
|
|
4967
|
-
r.step === 1 ? /* @__PURE__ */
|
|
5075
|
+
r.step === 1 ? /* @__PURE__ */ k(Vt, {
|
|
4968
5076
|
assembly: n.assembly,
|
|
4969
5077
|
useProxy: r.domain === "vehicle" && r.usePaperShellProxy,
|
|
4970
5078
|
previewScene: n.workingScene,
|
|
@@ -4982,7 +5090,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4982
5090
|
rootObjRef: n.rootObjRef,
|
|
4983
5091
|
onClickIsland: n.handleBucketIsland,
|
|
4984
5092
|
onPickFace: n.handlePickFace
|
|
4985
|
-
}) : /* @__PURE__ */
|
|
5093
|
+
}) : /* @__PURE__ */ k(mn, {
|
|
4986
5094
|
assembly: n.assembly,
|
|
4987
5095
|
importedRoot: n.workingScene,
|
|
4988
5096
|
rootObjRef: n.rootObjRef,
|
|
@@ -4992,7 +5100,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
4992
5100
|
panelAnimRef: n.panelAnimRef,
|
|
4993
5101
|
onStampSurface: n.handleStampSurface
|
|
4994
5102
|
}),
|
|
4995
|
-
r.domain === "vehicle" && r.usePaperShellProxy && /* @__PURE__ */
|
|
5103
|
+
r.domain === "vehicle" && r.usePaperShellProxy && /* @__PURE__ */ k(bn, {
|
|
4996
5104
|
chassisObjRef: n.rootObjRef,
|
|
4997
5105
|
emitters: n.assembly.emitters
|
|
4998
5106
|
})
|
|
@@ -5002,4 +5110,4 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
|
|
|
5002
5110
|
]
|
|
5003
5111
|
});
|
|
5004
5112
|
}
|
|
5005
|
-
export {
|
|
5113
|
+
export { R as $, yt as A, et as B, Mt as C, Ct as D, q as E, it as F, Ve as G, Ze as H, at as I, We as J, Ue as K, rt as L, gt as M, mt as N, J as O, ut as P, U as Q, tt as R, Ft as S, xt as T, $e as U, nt as V, Pe as W, je as X, Me as Y, Ne as Z, Qt as _, bn as a, Pt as b, Ht as c, Yt as d, Oe as et, Jt as f, Kt as g, Zt as h, wn as i, _t as j, bt as k, Ut as l, Xt as m, Wn as n, Ae as nt, mn as o, Gt as p, Be as q, In as r, on as s, Kn as t, ke as tt, qt as u, Vt as v, St as w, Nt as x, It as y, Qe as z };
|