@pinkaphant/kolmo 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/kolmo.mjs +1 -1
- package/dist/engine/kolmoActor.js +125 -83
- package/dist/engine/kolmoLongDrive.js +136 -91
- package/dist/engine/kolmoStore.d.ts +6 -5
- package/dist/engine/kolmoStore.js +115 -79
- package/dist/engine/kolmoVehicle.d.ts +1 -1
- package/dist/engine/kolmoVehicle.js +160 -147
- package/dist/engine/kolmoVehicleDriver.d.ts +12 -4
- package/dist/engine/kolmoVehicleDriver.js +40 -20
- package/dist/engine/kolmoWorld.js +55 -35
- package/dist/importer/CabinPreviewRig.d.ts +13 -0
- package/dist/importer/CabinPreviewRig.js +138 -0
- package/dist/importer/CabinStepSection.d.ts +17 -0
- package/dist/importer/CabinStepSection.js +222 -0
- package/dist/importer/ChopShopPanel.d.ts +31 -1
- package/dist/importer/ChopShopPanel.js +474 -380
- package/dist/importer/GateHudBar.d.ts +3 -0
- package/dist/importer/GateHudBar.js +8 -2
- package/dist/importer/GlbImportGate.js +183 -147
- package/dist/importer/ImporterPlinthUikitTags.d.ts +2 -1
- package/dist/importer/ImporterPlinthUikitTags.js +23 -16
- package/dist/importer/Step1CalibrationPlinth.d.ts +10 -0
- package/dist/importer/Step1CalibrationPlinth.js +203 -141
- package/dist/importer/Step2UniversalPad.d.ts +8 -1
- package/dist/importer/Step2UniversalPad.js +112 -90
- package/dist/importer/cabinMeshBuilders.d.ts +13 -0
- package/dist/importer/cabinMeshBuilders.js +104 -0
- package/dist/importer/cabinMixamoRig.d.ts +53 -0
- package/dist/importer/cabinMixamoRig.js +150 -0
- package/dist/importer/chopShopActions.d.ts +6 -0
- package/dist/importer/chopShopActions.js +86 -61
- package/dist/importer/chopShopUiComponents.d.ts +22 -0
- package/dist/importer/chopShopUiComponents.js +91 -0
- package/dist/importer/gateStore.d.ts +5 -2
- package/dist/importer/gateStore.js +13 -10
- package/dist/importer/glbNormalizer.d.ts +10 -1
- package/dist/importer/glbNormalizer.js +114 -49
- package/dist/importer/importerWebMcp.js +4 -1
- package/dist/importer/index.d.ts +4 -2
- package/dist/importer/index.js +24 -21
- package/dist/importer/khrCompiler.d.ts +20 -1
- package/dist/importer/khrCompiler.js +539 -290
- package/dist/importer/launcherBake.js +12 -8
- package/dist/importer/meshIslands.d.ts +4 -0
- package/dist/importer/meshIslands.js +104 -99
- package/dist/importer/surfaceCutter.d.ts +12 -3
- package/dist/importer/surfaceCutter.js +220 -127
- package/dist/importer/surfaceTopology.d.ts +13 -2
- package/dist/importer/surfaceTopology.js +57 -29
- package/dist/importer/universalGateBake.d.ts +7 -1
- package/dist/importer/universalGateBake.js +63 -60
- package/dist/importer/usdToGlb.js +19 -7
- package/dist/importer/useChopShopController.d.ts +27 -1
- package/dist/importer/useChopShopController.js +369 -255
- package/dist/importer/wheelAxlePairing.d.ts +3 -1
- package/dist/importer/wheelAxlePairing.js +82 -33
- package/dist/index.js +31 -28
- package/dist/junk/ShardPieces.js +3 -3
- package/dist/physics/index.d.ts +7 -0
- package/dist/physics/index.js +66 -40
- package/package.json +1 -1
|
@@ -1,101 +1,155 @@
|
|
|
1
1
|
import { stampKolmoNodesIntoGlb as e } from "../schema/kolmoSchema.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
2
|
+
import { computeMeshMassProps as t } from "./glbNormalizer.js";
|
|
3
|
+
import { computeMixamoCabinSockets as n } from "./cabinMixamoRig.js";
|
|
4
|
+
import { CHOP_ROLES as r } from "./surfaceTopology.js";
|
|
5
|
+
import { createFleet12GonWheelGroup as i, measureSelection as a, suggestCarAxles as o } from "./wheelAxlePairing.js";
|
|
6
|
+
import { buildCabinTubGroup as s } from "./cabinMeshBuilders.js";
|
|
7
|
+
import { extractMeshIslands as c, separateVehicleMeshes as l } from "./meshIslands.js";
|
|
8
|
+
import { buildPatchPreviewEmitters as u, computeChopPartHinge as d, createVehiclePanelAnimator as f, normalToMinusZQuaternion as p } from "./vehiclePanelAnim.js";
|
|
9
|
+
import * as m from "three";
|
|
10
|
+
import { exportKhrGlb as h } from "@khr3/core";
|
|
11
|
+
import { ENGINE_TORQUE_CURVES as g, STEER_SPEED_CURVES as _, TIRE_ARCHETYPES as v, tireGripForSurface as y } from "@khr3/core/curves";
|
|
10
12
|
// src/importer/khrCompiler.ts
|
|
11
|
-
var _ = [
|
|
13
|
+
var b = Object.keys(v), x = Object.keys(g), S = Object.keys(_), C = [
|
|
12
14
|
"map",
|
|
13
15
|
"normalMap",
|
|
14
16
|
"roughnessMap",
|
|
15
17
|
"metalnessMap",
|
|
16
18
|
"aoMap",
|
|
17
19
|
"emissiveMap"
|
|
18
|
-
],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
], w = (e) => Number(e.toFixed(4)), T = {
|
|
21
|
+
naScreamer: {
|
|
22
|
+
maxRpm: 7200,
|
|
23
|
+
gears: [
|
|
24
|
+
3.1,
|
|
25
|
+
2.05,
|
|
26
|
+
1.42,
|
|
27
|
+
1,
|
|
28
|
+
.82
|
|
29
|
+
],
|
|
30
|
+
finalDrive: 3.58
|
|
31
|
+
},
|
|
32
|
+
w16QuadTurbo: {
|
|
33
|
+
maxRpm: 6800,
|
|
34
|
+
gears: [
|
|
35
|
+
3.2,
|
|
36
|
+
2.15,
|
|
37
|
+
1.52,
|
|
38
|
+
1.12,
|
|
39
|
+
.86,
|
|
40
|
+
.68
|
|
41
|
+
],
|
|
42
|
+
finalDrive: 3.42
|
|
43
|
+
},
|
|
44
|
+
heavyTurboDiesel: {
|
|
45
|
+
maxRpm: 4400,
|
|
46
|
+
gears: [
|
|
47
|
+
4.2,
|
|
48
|
+
2.6,
|
|
49
|
+
1.75,
|
|
50
|
+
1.22,
|
|
51
|
+
.9,
|
|
52
|
+
.72
|
|
53
|
+
],
|
|
54
|
+
finalDrive: 4.1
|
|
55
|
+
},
|
|
56
|
+
evDirectDrive: {
|
|
57
|
+
maxRpm: 14e3,
|
|
58
|
+
gears: [1],
|
|
59
|
+
finalDrive: 9
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function E(e, t, n) {
|
|
24
63
|
if (!t) return [];
|
|
25
|
-
let i = new Map(e.map((e) => [e.id, e])),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
64
|
+
let i = new Map(e.map((e) => [e.id, e])), o = (e) => Object.entries(t).filter(([t, r]) => r === e && !n.has(Number(t)) && i.has(Number(t))).map(([e]) => Number(e)), s = [], c = (e) => r.find((t) => t.role === e)?.massKg ?? 16, l = (e) => {
|
|
65
|
+
let t = e.map((e) => i.get(e).center[2]), n = Math.max(...t) - Math.min(...t), r = (Math.min(...t) + Math.max(...t)) * .5;
|
|
66
|
+
return (n > .85 ? [e.filter((e) => i.get(e).center[2] >= r), e.filter((e) => i.get(e).center[2] < r)] : [e]).filter((e) => e.length > 0);
|
|
67
|
+
};
|
|
68
|
+
for (let t of ["door", "fender"]) {
|
|
69
|
+
let n = t === "door" ? "Door" : "Fender";
|
|
70
|
+
for (let r of [1, -1]) {
|
|
71
|
+
let u = o(t).filter((e) => (i.get(e).center[0] >= 0 ? 1 : -1) === r);
|
|
72
|
+
if (u.length === 0) continue;
|
|
73
|
+
let f = l(u);
|
|
74
|
+
f.forEach((i, o) => {
|
|
75
|
+
let l = a(e, i), u = `${f.length > 1 ? o === 0 ? "F" : "R" : l.center[2] >= 0 ? "F" : "R"}${r > 0 ? "L" : "R"}`;
|
|
76
|
+
s.push({
|
|
77
|
+
nodeName: `${n}_${u}`,
|
|
78
|
+
role: `${t}_${u.toLowerCase()}`,
|
|
79
|
+
islandIds: i,
|
|
80
|
+
massKg: c(t),
|
|
81
|
+
hinge: d(l, t)
|
|
82
|
+
});
|
|
38
83
|
});
|
|
39
|
-
}
|
|
84
|
+
}
|
|
40
85
|
}
|
|
41
86
|
for (let t of ["hood", "trunk"]) {
|
|
42
|
-
let
|
|
43
|
-
|
|
87
|
+
let n = o(t);
|
|
88
|
+
n.length > 0 && s.push({
|
|
44
89
|
nodeName: t === "hood" ? "Hood" : "Trunk",
|
|
45
90
|
role: t,
|
|
46
|
-
islandIds:
|
|
47
|
-
massKg:
|
|
48
|
-
hinge:
|
|
91
|
+
islandIds: n,
|
|
92
|
+
massKg: c(t),
|
|
93
|
+
hinge: d(a(e, n), t)
|
|
49
94
|
});
|
|
50
95
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
96
|
+
let u = o("bumper");
|
|
97
|
+
if (u.length > 0) {
|
|
98
|
+
let t = l(u);
|
|
99
|
+
t.forEach((n, r) => {
|
|
100
|
+
let i = a(e, n), o = t.length > 1 ? r === 0 ? "F" : "R" : i.center[2] >= 0 ? "F" : "R";
|
|
101
|
+
s.push({
|
|
102
|
+
nodeName: `Bumper_${o}`,
|
|
103
|
+
role: `bumper_${o.toLowerCase()}`,
|
|
104
|
+
islandIds: n,
|
|
105
|
+
massKg: c("bumper"),
|
|
106
|
+
hinge: d(i, "bumper")
|
|
107
|
+
});
|
|
58
108
|
});
|
|
59
|
-
}
|
|
109
|
+
}
|
|
60
110
|
return s;
|
|
61
111
|
}
|
|
62
|
-
function
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
65
|
-
let t =
|
|
112
|
+
function D(e, t, n, r) {
|
|
113
|
+
let i = t.filter((e) => e.left.length > 0 || e.right.length > 0);
|
|
114
|
+
if (i.length > 0) {
|
|
115
|
+
let t = i.map((t) => ({
|
|
66
116
|
a: t,
|
|
67
|
-
z:
|
|
68
|
-
})).sort((e, t) => t.z - e.z),
|
|
69
|
-
return t.forEach(({ a: t },
|
|
70
|
-
let s =
|
|
71
|
-
|
|
72
|
-
nodeName: `Wheel_${
|
|
117
|
+
z: a(e, [...t.left, ...t.right]).center[2]
|
|
118
|
+
})).sort((e, t) => t.z - e.z), r = t.length, o = [];
|
|
119
|
+
return t.forEach(({ a: t }, i) => {
|
|
120
|
+
let s = t.left.length > 0, c = t.right.length > 0, l = s ? a(e, t.left) : a(e, t.right), u = c ? a(e, t.right) : l, d = Math.max(.08, l.radius, u.radius), f = Math.max(.06, Math.max(l.halfWidth, u.halfWidth) * 2), p = n === "AWD" || r === 1 ? !0 : n === "FWD" ? i === 0 : i > 0, m = t.steered ?? i === 0, h = t.driven ?? p, g = t.brake ?? !0, _ = r === 2 ? i === 0 ? "F" : "R" : `A${i}`;
|
|
121
|
+
if (s && c) o.push({
|
|
122
|
+
nodeName: `Wheel_${_}L`,
|
|
73
123
|
islandIds: [...t.left],
|
|
74
|
-
radius:
|
|
75
|
-
width:
|
|
76
|
-
steered:
|
|
77
|
-
driven:
|
|
78
|
-
brake:
|
|
79
|
-
}) : (o.push({
|
|
80
|
-
nodeName: `Wheel_${h}L`,
|
|
81
|
-
islandIds: [...t.left],
|
|
82
|
-
radius: l,
|
|
83
|
-
width: u,
|
|
84
|
-
steered: f,
|
|
85
|
-
driven: p,
|
|
86
|
-
brake: m
|
|
124
|
+
radius: d,
|
|
125
|
+
width: f,
|
|
126
|
+
steered: m,
|
|
127
|
+
driven: h,
|
|
128
|
+
brake: g
|
|
87
129
|
}), o.push({
|
|
88
|
-
nodeName: `Wheel_${
|
|
130
|
+
nodeName: `Wheel_${_}R`,
|
|
89
131
|
islandIds: [...t.right],
|
|
90
|
-
radius:
|
|
91
|
-
width:
|
|
92
|
-
steered:
|
|
93
|
-
driven:
|
|
94
|
-
brake:
|
|
95
|
-
})
|
|
132
|
+
radius: d,
|
|
133
|
+
width: f,
|
|
134
|
+
steered: m,
|
|
135
|
+
driven: h,
|
|
136
|
+
brake: g
|
|
137
|
+
});
|
|
138
|
+
else {
|
|
139
|
+
let e = s ? [...t.left] : [...t.right], n = l.center[0], r = Math.abs(n) <= .1 ? "C" : n > 0 ? "L" : "R";
|
|
140
|
+
o.push({
|
|
141
|
+
nodeName: `Wheel_${_}${r}`,
|
|
142
|
+
islandIds: e,
|
|
143
|
+
radius: d,
|
|
144
|
+
width: f,
|
|
145
|
+
steered: m,
|
|
146
|
+
driven: h,
|
|
147
|
+
brake: g
|
|
148
|
+
});
|
|
149
|
+
}
|
|
96
150
|
}), o;
|
|
97
151
|
}
|
|
98
|
-
let [o, s, c] =
|
|
152
|
+
let [o, s, c] = r, l = Math.max(.24, Math.min(.45, s * .24)), u = Math.max(.16, o * .14), d = o * .41, f = c * .32, p = n === "AWD" || n === "FWD", m = n === "AWD" || n === "RWD";
|
|
99
153
|
return [
|
|
100
154
|
{
|
|
101
155
|
nodeName: "Wheel_FL",
|
|
@@ -155,213 +209,402 @@ function x(e, t, r, i) {
|
|
|
155
209
|
}
|
|
156
210
|
];
|
|
157
211
|
}
|
|
158
|
-
|
|
159
|
-
n
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
function O(e, t) {
|
|
213
|
+
let n = [];
|
|
214
|
+
return e.traverse((r) => {
|
|
215
|
+
r !== e && r.userData && typeof r.userData[t] == "object" && r.userData[t] !== null && n.push(r);
|
|
216
|
+
}), n;
|
|
217
|
+
}
|
|
218
|
+
function k(e, t, n, r) {
|
|
219
|
+
e.updateMatrixWorld(!0), t.updateMatrixWorld(!0);
|
|
220
|
+
let i = /* @__PURE__ */ new Set();
|
|
221
|
+
for (let t of r) for (let n of O(e, t)) i.add(n);
|
|
222
|
+
let a = [...i].filter((t) => {
|
|
223
|
+
for (let n = t.parent; n && n !== e; n = n.parent) if (i.has(n)) return !1;
|
|
224
|
+
return !0;
|
|
225
|
+
});
|
|
226
|
+
for (let e of a) t.attach(e);
|
|
227
|
+
for (let t of [...e.children]) n.add(t);
|
|
228
|
+
}
|
|
229
|
+
async function A(r, a) {
|
|
230
|
+
r.updateMatrixWorld(!0);
|
|
231
|
+
let u = new m.Box3().setFromObject(r), d = u.isEmpty() ? new m.Vector3(1.8, 1.3, 4.2) : u.getSize(new m.Vector3()), f = u.isEmpty() ? new m.Vector3(0, .65, 0) : u.getCenter(new m.Vector3()), p = Math.max(.2, d.x), b = Math.max(.2, d.y), x = Math.max(.2, d.z), S = Math.max(5, a.massKg || 1e3), A = new m.Group();
|
|
232
|
+
A.name = a.name || r.name || `Kolmo_${a.archetype}`;
|
|
233
|
+
let j = [], M, N = a.tirePreset && v[a.tirePreset] ? a.tirePreset : "streetDrift90s", P = a.torqueCurve && g[a.torqueCurve] ? a.torqueCurve : "naScreamer", F = a.steerCurve && _[a.steerCurve] ? a.steerCurve : "driftCountersteer", I = v[N], L = y(I.muPeakLng, .82), R = T[P], z = [...new Set(a.propellerIslandIds ?? [])], B = {
|
|
234
|
+
tireGripFactor: L,
|
|
235
|
+
latFrictionEllipseScale: I.latFrictionEllipseScale,
|
|
236
|
+
relaxLngRate: I.relaxLngRate,
|
|
237
|
+
relaxLatRate: I.relaxLatRate,
|
|
238
|
+
lngSlipRatioCurveData: I.lng,
|
|
239
|
+
latSlipRatioCurveData: I.lat
|
|
240
|
+
}, V = [];
|
|
241
|
+
if (a.archetype === "car") {
|
|
242
|
+
let e = a.islands ?? c(r), d = a.axles?.length ? [] : O(r, "ecctrlWheel"), h = z.length === 0 ? O(r, "ecctrlPropeller") : [], v = d.length > 0 && Object.keys(a.partPicks ?? {}).length === 0 && z.length === 0, y = a.driveType ?? "AWD", C = Math.max(25, a.powerOrThrust || 280), T = [
|
|
243
|
+
u.min.x,
|
|
244
|
+
u.min.y,
|
|
245
|
+
u.min.z
|
|
246
|
+
], N = [
|
|
247
|
+
u.max.x,
|
|
248
|
+
u.max.y,
|
|
249
|
+
u.max.z
|
|
250
|
+
];
|
|
251
|
+
if (v) {
|
|
252
|
+
let e = r.clone(!0), n = new m.Group();
|
|
253
|
+
n.name = "Chassis", k(e, A, n, ["ecctrlWheel", "ecctrlPropeller"]), a.cabin?.enabled && a.cabin.includeInteriorTub && n.add(s(a.cabin, T, N)), A.add(n);
|
|
254
|
+
let i = t(n, S, [
|
|
255
|
+
f.x,
|
|
256
|
+
f.y,
|
|
257
|
+
f.z
|
|
258
|
+
], [
|
|
259
|
+
p,
|
|
260
|
+
b,
|
|
261
|
+
x
|
|
262
|
+
]), o = new m.Box3().setFromObject(n), c = o.isEmpty() ? u.min : o.min, l = o.isEmpty() ? u.max : o.max, d = O(A, "ecctrlWheel"), h = Math.max(.18, ...d.map((e) => Number(e.userData.ecctrlWheel.radius) || .3)), g = Math.max(.08, Math.min(.32, h * .68)), _ = g * .4, v = Math.min(l.y - .18, Math.max(c.y, g - _ + .12)), y = Math.max(v + .22, l.y), C = new m.Object3D();
|
|
263
|
+
C.name = "Chassis_Hull", C.position.set(w((c.x + l.x) * .5), w((v + y) * .5), w((c.z + l.z) * .5)), n.add(C), j = [{
|
|
264
|
+
nodeName: "Chassis",
|
|
265
|
+
motion: {
|
|
266
|
+
isKinematic: !1,
|
|
267
|
+
mass: S,
|
|
268
|
+
centerOfMass: i.centerOfMass,
|
|
269
|
+
inertiaDiagonal: i.inertiaDiagonal
|
|
211
270
|
},
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}];
|
|
216
|
-
for (let e of f) {
|
|
217
|
-
let t = _.panels.find((t) => t.nodeName === e.nodeName);
|
|
218
|
-
if (!t) continue;
|
|
219
|
-
O.add(t.group);
|
|
220
|
-
let n = [
|
|
221
|
-
v(t.center[0] - t.anchor[0]),
|
|
222
|
-
v(t.center[1] - t.anchor[1]),
|
|
223
|
-
v(t.center[2] - t.anchor[2])
|
|
224
|
-
], r = new d.Object3D();
|
|
225
|
-
r.name = `${e.nodeName}_Panel`, r.position.set(n[0], n[1], n[2]), t.group.add(r), E.push({
|
|
226
|
-
nodeName: r.name,
|
|
271
|
+
extras: { role: "chassis" }
|
|
272
|
+
}, {
|
|
273
|
+
nodeName: "Chassis_Hull",
|
|
227
274
|
collider: {
|
|
228
275
|
shape: {
|
|
229
276
|
type: "box",
|
|
230
277
|
size: [
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
278
|
+
w(Math.max(.2, l.x - c.x)),
|
|
279
|
+
w(Math.max(.22, y - v)),
|
|
280
|
+
w(Math.max(.2, l.z - c.z))
|
|
234
281
|
]
|
|
235
282
|
},
|
|
236
|
-
friction: .
|
|
283
|
+
friction: .38,
|
|
284
|
+
restitution: .05
|
|
237
285
|
}
|
|
238
|
-
}
|
|
286
|
+
}];
|
|
287
|
+
for (let e of d) j.push({
|
|
288
|
+
nodeName: e.name,
|
|
289
|
+
extras: { ecctrlWheel: {
|
|
290
|
+
...e.userData.ecctrlWheel,
|
|
291
|
+
...B
|
|
292
|
+
} }
|
|
293
|
+
});
|
|
294
|
+
for (let e of O(A, "ecctrlPropeller")) j.push({
|
|
295
|
+
nodeName: e.name,
|
|
296
|
+
extras: { ecctrlPropeller: e.userData.ecctrlPropeller }
|
|
297
|
+
});
|
|
298
|
+
} else {
|
|
299
|
+
let n = D(e, a.axles ?? o(e), y, [
|
|
300
|
+
p,
|
|
301
|
+
b,
|
|
302
|
+
x
|
|
303
|
+
]), c = z.map((e, t) => ({
|
|
304
|
+
nodeName: `Propeller_${t + 1}`,
|
|
305
|
+
islandIds: [e]
|
|
306
|
+
})), d = /* @__PURE__ */ new Set([...n.flatMap((e) => e.islandIds), ...z]), h = E(e, a.partPicks, d), g = Object.entries(a.partPicks ?? {}).filter(([e, t]) => t === "glass" && !d.has(Number(e))).map(([e]) => Number(e)), _ = [...h.map((e) => ({
|
|
239
307
|
nodeName: e.nodeName,
|
|
308
|
+
islandIds: e.islandIds,
|
|
309
|
+
anchor: e.hinge.anchor
|
|
310
|
+
})), ...g.length > 0 ? [{
|
|
311
|
+
nodeName: "ChassisGlass",
|
|
312
|
+
islandIds: g,
|
|
313
|
+
anchor: [
|
|
314
|
+
0,
|
|
315
|
+
0,
|
|
316
|
+
0
|
|
317
|
+
]
|
|
318
|
+
}] : []], v = l(r, e, n.filter((e) => e.islandIds.length > 0), _, c), C = new m.Group();
|
|
319
|
+
C.name = "Chassis", C.add(v.chassisGroup);
|
|
320
|
+
let O = v.panels.find((e) => e.nodeName === "ChassisGlass");
|
|
321
|
+
if (O) {
|
|
322
|
+
let e = new m.MeshStandardMaterial({
|
|
323
|
+
color: "#7dd3fc",
|
|
324
|
+
roughness: .12,
|
|
325
|
+
metalness: .1,
|
|
326
|
+
transparent: !0,
|
|
327
|
+
opacity: .34,
|
|
328
|
+
side: m.DoubleSide
|
|
329
|
+
});
|
|
330
|
+
O.group.traverse((t) => {
|
|
331
|
+
t instanceof m.Mesh && (t.material = e);
|
|
332
|
+
}), C.add(O.group);
|
|
333
|
+
}
|
|
334
|
+
a.cabin?.enabled && a.cabin.includeInteriorTub && C.add(s(a.cabin, T, N)), A.add(C);
|
|
335
|
+
for (let e of n) {
|
|
336
|
+
let t = v.wheels.find((t) => t.nodeName === e.nodeName), n = t?.center ?? e.fallbackPos ?? [
|
|
337
|
+
0,
|
|
338
|
+
e.radius,
|
|
339
|
+
0
|
|
340
|
+
];
|
|
341
|
+
if (a.wheelSource === "fleet12" || !t) {
|
|
342
|
+
let t = i(e.radius, e.width, e.nodeName);
|
|
343
|
+
t.position.set(n[0], n[1], n[2]), A.add(t);
|
|
344
|
+
} else A.add(t.group);
|
|
345
|
+
}
|
|
346
|
+
for (let e of v.propellers) A.add(e.group);
|
|
347
|
+
let k = Math.max(...n.map((e) => e.radius)), M = Math.max(.08, Math.min(.32, k * .68)), P = M * .4, F = new m.Box3().setFromObject(v.chassisGroup), I = F.isEmpty() ? u.min : F.min, L = F.isEmpty() ? u.max : F.max, R = Math.min(L.y - .18, Math.max(I.y, M - P + .12)), V = Math.max(R + .22, L.y), H = [
|
|
348
|
+
w(Math.max(.3, L.x - I.x)),
|
|
349
|
+
w(Math.max(.22, V - R)),
|
|
350
|
+
w(Math.max(.35, L.z - I.z))
|
|
351
|
+
], U = new m.Object3D();
|
|
352
|
+
U.name = "Chassis_Hull", U.position.set(w((I.x + L.x) * .5), w((R + V) * .5), w((I.z + L.z) * .5)), C.add(U);
|
|
353
|
+
let W = Math.max(40, S - h.reduce((e, t) => e + t.massKg, 0)), G = t(v.chassisGroup, W, [
|
|
354
|
+
f.x,
|
|
355
|
+
Math.max(k + .12, b * .36),
|
|
356
|
+
f.z
|
|
357
|
+
], [
|
|
358
|
+
p,
|
|
359
|
+
Math.max(.4, b - k * .4),
|
|
360
|
+
x
|
|
361
|
+
]), K = n.map((e) => v.wheels.find((t) => t.nodeName === e.nodeName)?.center[2] ?? e.fallbackPos?.[2] ?? 0), q = Math.min(...K), J = Math.max(...K), Y = J - q > .2 ? Math.max(q + .05, Math.min(J - .05, G.centerOfMass[2])) : G.centerOfMass[2], X = Math.max(k * .65, Math.min(L.y * .85, G.centerOfMass[1]));
|
|
362
|
+
j = [{
|
|
363
|
+
nodeName: "Chassis",
|
|
240
364
|
motion: {
|
|
241
365
|
isKinematic: !1,
|
|
242
|
-
mass:
|
|
243
|
-
centerOfMass:
|
|
244
|
-
|
|
366
|
+
mass: W,
|
|
367
|
+
centerOfMass: [
|
|
368
|
+
G.centerOfMass[0],
|
|
369
|
+
w(X),
|
|
370
|
+
w(Y)
|
|
371
|
+
],
|
|
372
|
+
inertiaDiagonal: G.inertiaDiagonal
|
|
245
373
|
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
374
|
+
extras: { role: "chassis" }
|
|
375
|
+
}, {
|
|
376
|
+
nodeName: "Chassis_Hull",
|
|
377
|
+
collider: {
|
|
378
|
+
shape: {
|
|
379
|
+
type: "box",
|
|
380
|
+
size: H
|
|
381
|
+
},
|
|
382
|
+
friction: .38,
|
|
383
|
+
restitution: .05
|
|
384
|
+
}
|
|
385
|
+
}];
|
|
386
|
+
for (let e of h) {
|
|
387
|
+
let n = v.panels.find((t) => t.nodeName === e.nodeName);
|
|
388
|
+
if (!n) continue;
|
|
389
|
+
C.add(n.group);
|
|
390
|
+
let r = t(n.group, e.massKg, [
|
|
391
|
+
n.center[0] - n.anchor[0],
|
|
392
|
+
n.center[1] - n.anchor[1],
|
|
393
|
+
n.center[2] - n.anchor[2]
|
|
394
|
+
], n.size), i = new m.Object3D();
|
|
395
|
+
i.name = `${e.nodeName}_Panel`, i.position.set(w(n.center[0] - n.anchor[0]), w(n.center[1] - n.anchor[1]), w(n.center[2] - n.anchor[2])), n.group.add(i), j.push({
|
|
396
|
+
nodeName: i.name,
|
|
397
|
+
collider: {
|
|
398
|
+
shape: {
|
|
399
|
+
type: "box",
|
|
400
|
+
size: [
|
|
401
|
+
w(n.size[0]),
|
|
402
|
+
w(n.size[1]),
|
|
403
|
+
w(n.size[2])
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
friction: .45
|
|
256
407
|
}
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
408
|
+
}), j.push({
|
|
409
|
+
nodeName: e.nodeName,
|
|
410
|
+
motion: {
|
|
411
|
+
isKinematic: !1,
|
|
412
|
+
mass: e.massKg,
|
|
413
|
+
centerOfMass: r.centerOfMass,
|
|
414
|
+
inertiaDiagonal: r.inertiaDiagonal
|
|
415
|
+
},
|
|
416
|
+
joint: {
|
|
417
|
+
connectedNodeName: "Chassis",
|
|
418
|
+
kind: "revolute",
|
|
419
|
+
axis: e.hinge.axis,
|
|
420
|
+
limits: e.hinge.limits,
|
|
421
|
+
drive: {
|
|
422
|
+
mode: "acceleration",
|
|
423
|
+
stiffness: 60,
|
|
424
|
+
damping: 12,
|
|
425
|
+
positionTarget: 0
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
extras: { role: e.role }
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
for (let e of n) {
|
|
432
|
+
let t = w(Math.max(.08, Math.min(.32, e.radius * .68))), n = w(t * .4);
|
|
433
|
+
j.push({
|
|
434
|
+
nodeName: e.nodeName,
|
|
435
|
+
extras: { ecctrlWheel: {
|
|
436
|
+
radius: w(e.radius),
|
|
437
|
+
width: w(e.width),
|
|
438
|
+
travel: t,
|
|
439
|
+
sag: n,
|
|
440
|
+
steer: e.steered,
|
|
441
|
+
drive: e.driven,
|
|
442
|
+
brake: e.brake,
|
|
443
|
+
...B
|
|
444
|
+
} }
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
if (v.propellers.length > 0) {
|
|
448
|
+
let e = Math.max(400, Math.ceil(S * 9.81 * 2.2 / v.propellers.length));
|
|
449
|
+
v.propellers.forEach((t, n) => j.push({
|
|
450
|
+
nodeName: t.nodeName,
|
|
451
|
+
extras: { ecctrlPropeller: {
|
|
452
|
+
maxThrust: e,
|
|
453
|
+
torqueRatio: .6,
|
|
454
|
+
invertTorque: n % 2 == 1
|
|
455
|
+
} }
|
|
456
|
+
}));
|
|
457
|
+
}
|
|
281
458
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
finalDriveRatio: 3.58,
|
|
293
|
-
transmissionMode: "auto",
|
|
294
|
-
maxSteerAngle: .55,
|
|
295
|
-
engineTorqueCurveData: p.naScreamer,
|
|
296
|
-
steerAngleCurveData: m.driftCountersteer
|
|
297
|
-
} };
|
|
298
|
-
} else if (o.archetype === "starcraft") {
|
|
299
|
-
for (let e of n.clone(!0).children) T.add(e);
|
|
300
|
-
let e = new d.Object3D();
|
|
301
|
-
e.name = "HullBody", e.position.set(l.x, l.y, l.z), T.add(e);
|
|
302
|
-
let t = Math.max(400, o.powerOrThrust || 4500, Math.ceil(w * 9.81 * .72));
|
|
303
|
-
E = [{
|
|
304
|
-
nodeName: "HullBody",
|
|
305
|
-
motion: {
|
|
306
|
-
isKinematic: !1,
|
|
307
|
-
mass: w,
|
|
308
|
-
centerOfMass: [
|
|
309
|
-
0,
|
|
310
|
-
v(-S * .06),
|
|
311
|
-
0
|
|
312
|
-
],
|
|
313
|
-
inertiaDiagonal: y(w, u, S, C)
|
|
459
|
+
a.cabin?.enabled && V.push(...n(a.cabin, T, N)), M = {
|
|
460
|
+
tune: {
|
|
461
|
+
engineHorsepower: C,
|
|
462
|
+
engineMaxRPM: R.maxRpm,
|
|
463
|
+
gearRatios: R.gears,
|
|
464
|
+
finalDriveRatio: R.finalDrive,
|
|
465
|
+
transmissionMode: "auto",
|
|
466
|
+
maxSteerAngle: .55,
|
|
467
|
+
engineTorqueCurveData: g[P],
|
|
468
|
+
steerAngleCurveData: _[F]
|
|
314
469
|
},
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
470
|
+
...z.length > 0 || h.length > 0 ? { droneTune: {
|
|
471
|
+
controlMode: "VELOCITY",
|
|
472
|
+
maxYawRate: 2.4,
|
|
473
|
+
maxHorizSpeed: 44,
|
|
474
|
+
maxVertSpeed: 22,
|
|
475
|
+
maxTiltAngle: .52,
|
|
476
|
+
airDragFactor: .18
|
|
477
|
+
} } : {}
|
|
478
|
+
};
|
|
479
|
+
} else if (a.archetype === "starcraft") {
|
|
480
|
+
let e = a.islands ?? c(r), n = z.length === 0 ? O(r, "ecctrlPropeller") : [], i = new m.Group();
|
|
481
|
+
if (i.name = "HullBody", z.length > 0) {
|
|
482
|
+
let n = l(r, e, [], [], z.map((e, t) => ({
|
|
483
|
+
nodeName: `Propeller_${t + 1}`,
|
|
484
|
+
islandIds: [e]
|
|
485
|
+
})));
|
|
486
|
+
i.add(n.chassisGroup), A.add(i);
|
|
487
|
+
let o = t(i, S, [
|
|
488
|
+
f.x,
|
|
489
|
+
f.y,
|
|
490
|
+
f.z
|
|
491
|
+
], [
|
|
492
|
+
p,
|
|
493
|
+
b,
|
|
494
|
+
x
|
|
495
|
+
]), s = new m.Box3().setFromObject(i), c = s.isEmpty() ? d : s.getSize(new m.Vector3()), u = s.isEmpty() ? f : s.getCenter(new m.Vector3()), h = new m.Object3D();
|
|
496
|
+
h.name = "HullBody_Col", h.position.set(w(u.x), w(u.y), w(u.z)), i.add(h), j = [{
|
|
497
|
+
nodeName: "HullBody",
|
|
498
|
+
motion: {
|
|
499
|
+
isKinematic: !1,
|
|
500
|
+
mass: S,
|
|
501
|
+
centerOfMass: o.centerOfMass,
|
|
502
|
+
inertiaDiagonal: o.inertiaDiagonal
|
|
503
|
+
}
|
|
504
|
+
}, {
|
|
505
|
+
nodeName: "HullBody_Col",
|
|
506
|
+
collider: {
|
|
507
|
+
shape: {
|
|
508
|
+
type: "box",
|
|
509
|
+
size: [
|
|
510
|
+
w(Math.max(.2, c.x)),
|
|
511
|
+
w(Math.max(.2, c.y)),
|
|
512
|
+
w(Math.max(.2, c.z))
|
|
513
|
+
]
|
|
514
|
+
},
|
|
515
|
+
friction: .35,
|
|
516
|
+
restitution: .08
|
|
517
|
+
}
|
|
518
|
+
}];
|
|
519
|
+
let g = Math.max(400, a.powerOrThrust || 4500, Math.ceil(S * 9.81 * 2.2 / n.propellers.length));
|
|
520
|
+
n.propellers.forEach((e, t) => {
|
|
521
|
+
A.add(e.group), j.push({
|
|
522
|
+
nodeName: e.nodeName,
|
|
523
|
+
extras: { ecctrlPropeller: {
|
|
524
|
+
maxThrust: g,
|
|
525
|
+
torqueRatio: .6,
|
|
526
|
+
invertTorque: t % 2 == 1
|
|
527
|
+
} }
|
|
528
|
+
});
|
|
529
|
+
});
|
|
530
|
+
} else {
|
|
531
|
+
k(r.clone(!0), A, i, ["ecctrlPropeller"]), A.add(i);
|
|
532
|
+
let e = t(i, S, [
|
|
533
|
+
f.x,
|
|
534
|
+
f.y,
|
|
535
|
+
f.z
|
|
536
|
+
], [
|
|
537
|
+
p,
|
|
538
|
+
b,
|
|
539
|
+
x
|
|
540
|
+
]), o = new m.Object3D();
|
|
541
|
+
if (o.name = "HullBody_Col", o.position.set(w(f.x), w(f.y), w(f.z)), i.add(o), j = [{
|
|
542
|
+
nodeName: "HullBody",
|
|
543
|
+
motion: {
|
|
544
|
+
isKinematic: !1,
|
|
545
|
+
mass: S,
|
|
546
|
+
centerOfMass: e.centerOfMass,
|
|
547
|
+
inertiaDiagonal: e.inertiaDiagonal
|
|
548
|
+
}
|
|
549
|
+
}, {
|
|
550
|
+
nodeName: "HullBody_Col",
|
|
551
|
+
collider: {
|
|
552
|
+
shape: {
|
|
553
|
+
type: "box",
|
|
554
|
+
size: [
|
|
555
|
+
w(p * .88),
|
|
556
|
+
w(b * .8),
|
|
557
|
+
w(x * .9)
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
friction: .35,
|
|
561
|
+
restitution: .08
|
|
562
|
+
}
|
|
563
|
+
}], n.length > 0) for (let e of O(A, "ecctrlPropeller")) j.push({
|
|
564
|
+
nodeName: e.name,
|
|
565
|
+
extras: { ecctrlPropeller: e.userData.ecctrlPropeller }
|
|
566
|
+
});
|
|
567
|
+
else {
|
|
568
|
+
let e = Math.max(400, a.powerOrThrust || 4500, Math.ceil(S * 9.81 * .72));
|
|
569
|
+
for (let [t, n, r, i] of [
|
|
570
|
+
[
|
|
571
|
+
"Thruster_FL",
|
|
572
|
+
p * .36,
|
|
573
|
+
x * .32,
|
|
574
|
+
!1
|
|
575
|
+
],
|
|
576
|
+
[
|
|
577
|
+
"Thruster_FR",
|
|
578
|
+
-p * .36,
|
|
579
|
+
x * .32,
|
|
580
|
+
!0
|
|
581
|
+
],
|
|
582
|
+
[
|
|
583
|
+
"Thruster_RL",
|
|
584
|
+
p * .36,
|
|
585
|
+
-x * .32,
|
|
586
|
+
!0
|
|
587
|
+
],
|
|
588
|
+
[
|
|
589
|
+
"Thruster_RR",
|
|
590
|
+
-p * .36,
|
|
591
|
+
-x * .32,
|
|
592
|
+
!1
|
|
322
593
|
]
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
594
|
+
]) {
|
|
595
|
+
let a = new m.Object3D();
|
|
596
|
+
a.name = t, a.position.set(f.x + n, f.y, f.z + r), A.add(a), j.push({
|
|
597
|
+
nodeName: t,
|
|
598
|
+
extras: { ecctrlPropeller: {
|
|
599
|
+
maxThrust: e,
|
|
600
|
+
torqueRatio: .6,
|
|
601
|
+
invertTorque: i
|
|
602
|
+
} }
|
|
603
|
+
});
|
|
604
|
+
}
|
|
326
605
|
}
|
|
327
|
-
}];
|
|
328
|
-
for (let [e, n, r, i] of [
|
|
329
|
-
[
|
|
330
|
-
"Thruster_FL",
|
|
331
|
-
u * .36,
|
|
332
|
-
C * .32,
|
|
333
|
-
!1
|
|
334
|
-
],
|
|
335
|
-
[
|
|
336
|
-
"Thruster_FR",
|
|
337
|
-
-u * .36,
|
|
338
|
-
C * .32,
|
|
339
|
-
!0
|
|
340
|
-
],
|
|
341
|
-
[
|
|
342
|
-
"Thruster_RL",
|
|
343
|
-
u * .36,
|
|
344
|
-
-C * .32,
|
|
345
|
-
!0
|
|
346
|
-
],
|
|
347
|
-
[
|
|
348
|
-
"Thruster_RR",
|
|
349
|
-
-u * .36,
|
|
350
|
-
-C * .32,
|
|
351
|
-
!1
|
|
352
|
-
]
|
|
353
|
-
]) {
|
|
354
|
-
let a = new d.Object3D();
|
|
355
|
-
a.name = e, a.position.set(l.x + n, l.y, l.z + r), T.add(a), E.push({
|
|
356
|
-
nodeName: e,
|
|
357
|
-
extras: { ecctrlPropeller: {
|
|
358
|
-
maxThrust: t,
|
|
359
|
-
torqueRatio: .6,
|
|
360
|
-
invertTorque: i
|
|
361
|
-
} }
|
|
362
|
-
});
|
|
363
606
|
}
|
|
364
|
-
|
|
607
|
+
M = { droneTune: {
|
|
365
608
|
controlMode: "VELOCITY",
|
|
366
609
|
maxYawRate: 2.4,
|
|
367
610
|
maxHorizSpeed: 44,
|
|
@@ -370,25 +613,31 @@ async function S(n, o) {
|
|
|
370
613
|
airDragFactor: .18
|
|
371
614
|
} };
|
|
372
615
|
} else {
|
|
373
|
-
let e = new
|
|
616
|
+
let e = new m.Group();
|
|
374
617
|
e.name = "PropBody";
|
|
375
|
-
let
|
|
376
|
-
for (let
|
|
377
|
-
e instanceof
|
|
618
|
+
let n = !1;
|
|
619
|
+
for (let t of r.clone(!0).children) e.add(t), t.traverse((e) => {
|
|
620
|
+
e instanceof m.Mesh && (e.geometry?.getAttribute("position")?.count ?? 0) >= 3 && (n = !0);
|
|
378
621
|
});
|
|
379
|
-
|
|
622
|
+
A.add(e);
|
|
623
|
+
let i = t(e, S, [
|
|
624
|
+
f.x,
|
|
625
|
+
f.y,
|
|
626
|
+
f.z
|
|
627
|
+
], [
|
|
628
|
+
p,
|
|
629
|
+
b,
|
|
630
|
+
x
|
|
631
|
+
]);
|
|
632
|
+
j = [{
|
|
380
633
|
nodeName: "PropBody",
|
|
381
|
-
motion:
|
|
634
|
+
motion: a.staticProp ? { isKinematic: !0 } : {
|
|
382
635
|
isKinematic: !1,
|
|
383
|
-
mass:
|
|
384
|
-
centerOfMass:
|
|
385
|
-
|
|
386
|
-
v(l.y),
|
|
387
|
-
v(l.z)
|
|
388
|
-
],
|
|
389
|
-
inertiaDiagonal: y(w, u, S, C)
|
|
636
|
+
mass: S,
|
|
637
|
+
centerOfMass: i.centerOfMass,
|
|
638
|
+
inertiaDiagonal: i.inertiaDiagonal
|
|
390
639
|
},
|
|
391
|
-
collider:
|
|
640
|
+
collider: n ? {
|
|
392
641
|
meshNodeName: "PropBody",
|
|
393
642
|
convexHull: !0,
|
|
394
643
|
friction: .6,
|
|
@@ -397,9 +646,9 @@ async function S(n, o) {
|
|
|
397
646
|
shape: {
|
|
398
647
|
type: "box",
|
|
399
648
|
size: [
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
649
|
+
w(p),
|
|
650
|
+
w(b),
|
|
651
|
+
w(x)
|
|
403
652
|
]
|
|
404
653
|
},
|
|
405
654
|
friction: .6,
|
|
@@ -407,26 +656,26 @@ async function S(n, o) {
|
|
|
407
656
|
}
|
|
408
657
|
}];
|
|
409
658
|
}
|
|
410
|
-
let
|
|
411
|
-
|
|
412
|
-
if (!(e instanceof
|
|
659
|
+
let H = [];
|
|
660
|
+
A.traverse((e) => {
|
|
661
|
+
if (!(e instanceof m.Mesh) || !e.material) return;
|
|
413
662
|
let t = e.material;
|
|
414
|
-
for (let e of
|
|
663
|
+
for (let e of C) {
|
|
415
664
|
let n = t[e];
|
|
416
|
-
n && !n.image && (
|
|
665
|
+
n && !n.image && (H.push({
|
|
417
666
|
rec: t,
|
|
418
667
|
slot: e,
|
|
419
668
|
tex: n
|
|
420
669
|
}), t[e] = null);
|
|
421
670
|
}
|
|
422
671
|
});
|
|
423
|
-
let
|
|
672
|
+
let U;
|
|
424
673
|
try {
|
|
425
|
-
|
|
674
|
+
U = new Uint8Array(await h(A, j, M));
|
|
426
675
|
} finally {
|
|
427
|
-
for (let e of
|
|
676
|
+
for (let e of H) e.rec[e.slot] = e.tex;
|
|
428
677
|
}
|
|
429
|
-
let
|
|
430
|
-
return
|
|
678
|
+
let W = new Set((a.patches ?? []).map((e) => e.nodeName)), G = [...V.filter((e) => !W.has(e.nodeName)), ...a.patches ?? []], K = e(U, G);
|
|
679
|
+
return K instanceof Uint8Array ? K : new Uint8Array(K);
|
|
431
680
|
}
|
|
432
|
-
export {
|
|
681
|
+
export { S as STEER_CURVE_IDS, b as TIRE_PRESET_IDS, x as TORQUE_CURVE_IDS, u as buildPatchPreviewEmitters, A as compileKhrAssetGlb, d as computeChopPartHinge, f as createVehiclePanelAnimator, p as normalToMinusZQuaternion, E as planArticulatedPanels };
|