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