@adatechnology/game-vehicles 0.6.3 → 0.6.5

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.
@@ -62,7 +62,7 @@ var GameVehicles = (() => {
62
62
  wrapThreeForLod: () => wrapThreeForLod
63
63
  });
64
64
 
65
- // ../game-shapes/dist/chunk-M5N2SHNL.js
65
+ // ../game-shapes/dist/chunk-FZQTELDQ.js
66
66
  function canonicalJson(value) {
67
67
  if (value === null) return "null";
68
68
  if (typeof value === "number") return Object.is(value, -0) ? "-0" : Number.isFinite(value) ? String(value) : JSON.stringify(String(value));
@@ -938,17 +938,19 @@ var GameVehicles = (() => {
938
938
  if (p.prevZ) p.prevZ.nextZ = p.nextZ;
939
939
  if (p.nextZ) p.nextZ.prevZ = p.prevZ;
940
940
  }
941
- function Node(i, x, y) {
942
- this.i = i;
943
- this.x = x;
944
- this.y = y;
945
- this.prev = null;
946
- this.next = null;
947
- this.z = 0;
948
- this.prevZ = null;
949
- this.nextZ = null;
950
- this.steiner = false;
951
- }
941
+ var Node = class {
942
+ constructor(i, x, y) {
943
+ this.i = i;
944
+ this.x = x;
945
+ this.y = y;
946
+ this.prev = null;
947
+ this.next = null;
948
+ this.z = 0;
949
+ this.prevZ = null;
950
+ this.nextZ = null;
951
+ this.steiner = false;
952
+ }
953
+ };
952
954
  function signedArea(data, start2, end, dim) {
953
955
  let sum = 0;
954
956
  for (let i = start2, j = end - dim; i < end; i += dim) {
@@ -2141,10 +2143,11 @@ var GameVehicles = (() => {
2141
2143
  return out;
2142
2144
  }
2143
2145
  function assignDeep(target, source) {
2146
+ const t = target;
2144
2147
  Object.keys(source || {}).forEach(function(k) {
2145
2148
  const v = source[k];
2146
- if (v && typeof v === "object" && !Array.isArray(v)) target[k] = assignDeep(target[k] && typeof target[k] === "object" ? target[k] : {}, v);
2147
- else if (v !== void 0) target[k] = v;
2149
+ if (v && typeof v === "object" && !Array.isArray(v)) t[k] = assignDeep(t[k] && typeof t[k] === "object" ? t[k] : {}, v);
2150
+ else if (v !== void 0) t[k] = v;
2148
2151
  });
2149
2152
  return target;
2150
2153
  }
@@ -2527,7 +2530,9 @@ var GameVehicles = (() => {
2527
2530
  return t;
2528
2531
  }
2529
2532
  kit.textTexture = textTexture;
2530
- Object.assign(I, { RUST, cache: cache2, studioEnvironment, makeMaterial, makeFlatMaterial, DOUBLE_SIDE, toColor, MATERIALS, paintColor, texCache, textTexture });
2533
+ const shared = { RUST, cache: cache2, studioEnvironment, makeMaterial, makeFlatMaterial, DOUBLE_SIDE, toColor, MATERIALS, paintColor, texCache, textTexture };
2534
+ Object.assign(I, shared);
2535
+ return shared;
2531
2536
  }
2532
2537
 
2533
2538
  // src/tri-index.ts
@@ -2682,7 +2687,8 @@ var GameVehicles = (() => {
2682
2687
  }
2683
2688
  return s;
2684
2689
  }
2685
- function indexable(THREE, mesh2) {
2690
+ function indexable(THREE, object2) {
2691
+ const mesh2 = object2;
2686
2692
  const geo = mesh2.geometry;
2687
2693
  if (mesh2.raycast !== THREE.Mesh.prototype.raycast) return false;
2688
2694
  if (!mesh2.isMesh || mesh2.isSkinnedMesh || mesh2.isInstancedMesh || mesh2.isBatchedMesh || !geo || !geo.isBufferGeometry) return false;
@@ -3281,21 +3287,23 @@ var GameVehicles = (() => {
3281
3287
  let wb = 0;
3282
3288
  segs.forEach(function(seg) {
3283
3289
  if (typeof seg[0] === "number") {
3290
+ const run = seg;
3284
3291
  for (let a = 0; a < names.length; a++) {
3285
3292
  const size = sizes[a];
3286
3293
  if (!idx) {
3287
- dst[a].set(arrs[a].subarray(seg[0] * 3 * size, seg[1] * 3 * size), w[a]);
3288
- w[a] += (seg[1] - seg[0]) * 3 * size;
3294
+ dst[a].set(arrs[a].subarray(run[0] * 3 * size, run[1] * 3 * size), w[a]);
3295
+ w[a] += (run[1] - run[0]) * 3 * size;
3289
3296
  continue;
3290
3297
  }
3291
- for (let f = seg[0] * 3; f < seg[1] * 3; f++) for (let q = 0; q < size; q++) dst[a][w[a]++] = arrs[a][idx[f] * size + q];
3298
+ for (let f = run[0] * 3; f < run[1] * 3; f++) for (let q = 0; q < size; q++) dst[a][w[a]++] = arrs[a][idx[f] * size + q];
3292
3299
  }
3293
3300
  if (boxesOut2 && ti) {
3294
- boxesOut2.set(ti.boxes.subarray(seg[0] * 6, seg[1] * 6), wb);
3295
- wb += (seg[1] - seg[0]) * 6;
3301
+ boxesOut2.set(ti.boxes.subarray(run[0] * 6, run[1] * 6), wb);
3302
+ wb += (run[1] - run[0]) * 6;
3296
3303
  }
3297
3304
  return;
3298
3305
  }
3306
+ ;
3299
3307
  seg.forEach(function(t) {
3300
3308
  if (boxesOut2) {
3301
3309
  for (let k = 0; k < 3; k++) {
@@ -3489,7 +3497,9 @@ var GameVehicles = (() => {
3489
3497
  }
3490
3498
  };
3491
3499
  };
3492
- Object.assign(I, { roundedBoxGeometry, taper, subdivide, crease, creaseTask, refreshBounds, pathShape, tumble, loftGeometry, hullGeometry, cutGeometry, mergeGeometries, uvProject });
3500
+ const shared = { roundedBoxGeometry, taper, subdivide, crease, creaseTask, refreshBounds, pathShape, tumble, loftGeometry, hullGeometry, cutGeometry, mergeGeometries, uvProject };
3501
+ Object.assign(I, shared);
3502
+ return shared;
3493
3503
  }
3494
3504
 
3495
3505
  // src/context.ts
@@ -3743,6 +3753,7 @@ var GameVehicles = (() => {
3743
3753
  }
3744
3754
  kit.BuildContext = BuildContext;
3745
3755
  I.BuildContext = BuildContext;
3756
+ return { resolveLabel, BuildContext };
3746
3757
  }
3747
3758
 
3748
3759
  // src/warp.ts
@@ -3938,7 +3949,9 @@ var GameVehicles = (() => {
3938
3949
  kit.applyWarp = applyWarp;
3939
3950
  kit.geo.resample = resample;
3940
3951
  kit.geo.smoothLoft = smoothLoft;
3941
- Object.assign(I, { makeWarp, applyWarp, resample, smoothLoft });
3952
+ const shared = { makeWarp, applyWarp, resample, smoothLoft };
3953
+ Object.assign(I, shared);
3954
+ return shared;
3942
3955
  }
3943
3956
 
3944
3957
  // src/body.ts
@@ -4004,23 +4017,24 @@ var GameVehicles = (() => {
4004
4017
  o.arches.forEach(function(a) {
4005
4018
  const a0 = Math.asin(clamp((o.bottomY - a[1]) / a[2], -1, 1));
4006
4019
  const rr = a[2] - 0.01;
4020
+ const archInner = o.archInner;
4007
4021
  if (o.archInner == null) {
4008
4022
  const wl = c.add(new THREE.CylinderGeometry(rr, rr, o.W - 0.12, 20, 1, true, a0 + PI / 2, PI - 2 * a0), MATERIALS.dark, a[0], a[1], 0);
4009
4023
  wl.rotation.x = PI / 2;
4010
4024
  wl.castShadow = false;
4011
4025
  } else
4012
4026
  [1, -1].forEach(function(s) {
4013
- const len = o.W / 2 - 0.06 - o.archInner;
4027
+ const len = o.W / 2 - 0.06 - archInner;
4014
4028
  const w2 = c.add(
4015
4029
  new THREE.CylinderGeometry(rr, rr, len, 20, 1, true, a0 + PI / 2, PI - 2 * a0),
4016
4030
  MATERIALS.dark,
4017
4031
  a[0],
4018
4032
  a[1],
4019
- s * (o.archInner + len / 2)
4033
+ s * (archInner + len / 2)
4020
4034
  );
4021
4035
  w2.rotation.x = PI / 2;
4022
4036
  w2.castShadow = false;
4023
- const cap = c.add(new THREE.CircleGeometry(rr, 20, a0, PI - 2 * a0), MATERIALS.dark, a[0], a[1], s * o.archInner);
4037
+ const cap = c.add(new THREE.CircleGeometry(rr, 20, a0, PI - 2 * a0), MATERIALS.dark, a[0], a[1], s * archInner);
4024
4038
  cap.castShadow = false;
4025
4039
  });
4026
4040
  });
@@ -4097,8 +4111,12 @@ var GameVehicles = (() => {
4097
4111
  if (!q.isMesh || !q.visible || q.userData.glass || q.userData.decal || q.isSprite) return;
4098
4112
  if (o.all || dset.has(q) || c.paints && c.paints.has(q.material)) cands.push(q);
4099
4113
  });
4100
- const d = (dir.isVector3 ? dir.clone() : new V3(dir[0], dir[1], dir[2])).normalize();
4101
- const p0 = org.isVector3 ? org.clone() : new V3(org[0], org[1], org[2]);
4114
+ const dv = dir;
4115
+ const da = dir;
4116
+ const d = (dv.isVector3 ? dv.clone() : new V3(da[0], da[1], da[2])).normalize();
4117
+ const ov = org;
4118
+ const oa = org;
4119
+ const p0 = ov.isVector3 ? ov.clone() : new V3(oa[0], oa[1], oa[2]);
4102
4120
  _sr.set(p0.clone().applyMatrix4(Mw), d.clone().transformDirection(Mw));
4103
4121
  _sr.near = 0;
4104
4122
  _sr.far = o.max || 20;
@@ -4115,7 +4133,9 @@ var GameVehicles = (() => {
4115
4133
  const h = kit.surfaceAt(c, new V3(x0, y, z || 0), new V3(-sg, 0, 0));
4116
4134
  return h ? h.p.x : items ? profX(items, y, front !== false) : null;
4117
4135
  };
4118
- Object.assign(I, { halfAt, shell, autoWindows, profX, _sr });
4136
+ const shared = { halfAt, shell, autoWindows, profX, _sr };
4137
+ Object.assign(I, shared);
4138
+ return shared;
4119
4139
  }
4120
4140
 
4121
4141
  // src/glass.ts
@@ -4124,7 +4144,8 @@ var GameVehicles = (() => {
4124
4144
  const V3 = THREE.Vector3;
4125
4145
  const I = kit._;
4126
4146
  const { MATERIALS, crease, cutGeometry, pathShape, subdivide, tumble, uvProject } = I;
4127
- I.paneSeals = /* @__PURE__ */ new WeakMap();
4147
+ const paneSeals = /* @__PURE__ */ new WeakMap();
4148
+ I.paneSeals = paneSeals;
4128
4149
  kit.addGlass = function(c, geo, label, type, o) {
4129
4150
  o = o || {};
4130
4151
  if (!geo.attributes.uv || o.reuv) o.aspect = uvProject(geo, o.uvAxes);
@@ -4221,7 +4242,7 @@ var GameVehicles = (() => {
4221
4242
  };
4222
4243
  kit.quadDef = function(pb, pt, Wg, T, which, bev, o) {
4223
4244
  o = o || {};
4224
- bev = bev == null ? 0.05 : bev;
4245
+ const bv = bev == null ? 0.05 : bev;
4225
4246
  const dx = pt[0] - pb[0];
4226
4247
  const dy = pt[1] - pb[1];
4227
4248
  const L = Math.hypot(dx, dy);
@@ -4230,13 +4251,13 @@ var GameVehicles = (() => {
4230
4251
  const nx = which === "front" ? uy : -uy;
4231
4252
  const ny = which === "front" ? -ux : ux;
4232
4253
  const ins = o.inset || 0.09;
4233
- const off = bev + 6e-3;
4254
+ const off = bv + 6e-3;
4234
4255
  const sd = o.side || 0.1;
4235
4256
  const b = [pb[0] + ux * ins + nx * off, pb[1] + uy * ins + ny * off];
4236
4257
  const t = [pt[0] - ux * ins * 1.3 + nx * off, pt[1] - uy * ins * 1.3 + ny * off];
4237
4258
  const hb = I.halfAt(Wg, T, b[1]) - sd;
4238
4259
  const ht = I.halfAt(Wg, T, t[1]) - sd;
4239
- return { pb, pt, L, u: [ux, uy], n: [nx, ny], ins, b, t, hb, ht, which, bev, Wg, T };
4260
+ return { pb, pt, L, u: [ux, uy], n: [nx, ny], ins, b, t, hb, ht, which, bev: bv, Wg, T };
4240
4261
  };
4241
4262
  kit.glassQuad = function(c, q, label, o) {
4242
4263
  o = o || {};
@@ -4290,7 +4311,9 @@ var GameVehicles = (() => {
4290
4311
  c.quads.push(q);
4291
4312
  return m;
4292
4313
  };
4293
- Object.assign(I, {});
4314
+ const shared = { paneSeals };
4315
+ Object.assign(I, shared);
4316
+ return shared;
4294
4317
  }
4295
4318
 
4296
4319
  // src/lights.ts
@@ -4627,7 +4650,9 @@ var GameVehicles = (() => {
4627
4650
  if (o.emblem !== false) kit.emblem(c, 0.05, st === "closed" ? h * 0.12 : 0, 0, Math.min(0.05, h * 0.3), g);
4628
4651
  return g;
4629
4652
  };
4630
- Object.assign(I, { lampGroup, gm, wedgeY, haloTex, glowTexture, haloMats, halo, lampKit });
4653
+ const shared = { lampGroup, gm, wedgeY, haloTex, glowTexture, haloMats, halo, lampKit };
4654
+ Object.assign(I, shared);
4655
+ return shared;
4631
4656
  }
4632
4657
 
4633
4658
  // src/interior.ts
@@ -4879,7 +4904,9 @@ var GameVehicles = (() => {
4879
4904
  c.roundBox(o.x0 - o.x1 + 1, 0.03, zi * 2, 0.01, MATERIALS.carpet, (o.x0 + o.x1) / 2, o.floor, 0);
4880
4905
  return n;
4881
4906
  };
4882
- Object.assign(I, { consoleBox });
4907
+ const shared = { consoleBox };
4908
+ Object.assign(I, shared);
4909
+ return shared;
4883
4910
  }
4884
4911
 
4885
4912
  // src/hood.ts
@@ -5274,7 +5301,9 @@ var GameVehicles = (() => {
5274
5301
  };
5275
5302
  return out;
5276
5303
  };
5277
- Object.assign(I, {});
5304
+ const shared = {};
5305
+ Object.assign(I, shared);
5306
+ return shared;
5278
5307
  }
5279
5308
 
5280
5309
  // src/car.ts
@@ -5632,7 +5661,9 @@ var GameVehicles = (() => {
5632
5661
  });
5633
5662
  return out;
5634
5663
  };
5635
- Object.assign(I, {});
5664
+ const shared = {};
5665
+ Object.assign(I, shared);
5666
+ return shared;
5636
5667
  }
5637
5668
 
5638
5669
  // src/trucks.ts
@@ -5777,7 +5808,9 @@ var GameVehicles = (() => {
5777
5808
  m.rear = rear;
5778
5809
  m.length = L;
5779
5810
  };
5780
- Object.assign(I, {});
5811
+ const shared = {};
5812
+ Object.assign(I, shared);
5813
+ return shared;
5781
5814
  }
5782
5815
 
5783
5816
  // src/wheels.ts
@@ -5916,7 +5949,9 @@ var GameVehicles = (() => {
5916
5949
  c.part("track", kit.t("parts.track", { s: z > 0 ? 1 : -1 }), tm, new V3((x0 + x1) / 2, 0.3, z), 1.4);
5917
5950
  return { mesh: tm, wheels: gs, sprocket: spr, idler: idl };
5918
5951
  };
5919
- Object.assign(I, {});
5952
+ const shared = {};
5953
+ Object.assign(I, shared);
5954
+ return shared;
5920
5955
  }
5921
5956
 
5922
5957
  // src/routed-particles.ts
@@ -6345,7 +6380,7 @@ var GameVehicles = (() => {
6345
6380
  }
6346
6381
  });
6347
6382
  }
6348
- Object.assign(I, {
6383
+ const shared = {
6349
6384
  PARTICLE_LIMIT,
6350
6385
  PARTICLE_GEOMETRIES,
6351
6386
  PARTICLE_MATERIALS,
@@ -6365,7 +6400,9 @@ var GameVehicles = (() => {
6365
6400
  burst,
6366
6401
  exhaustLook,
6367
6402
  tickEmit
6368
- });
6403
+ };
6404
+ Object.assign(I, shared);
6405
+ return shared;
6369
6406
  }
6370
6407
 
6371
6408
  // src/fluids.ts
@@ -6839,7 +6876,9 @@ var GameVehicles = (() => {
6839
6876
  }
6840
6877
  return n;
6841
6878
  };
6842
- Object.assign(I, { _fr, buildDrip, DOWNHILL, PN, puddleGeometry, rimGeometry, puddle, shapePuddle, updateFluids });
6879
+ const shared = { _fr, buildDrip, DOWNHILL, PN, puddleGeometry, rimGeometry, puddle, shapePuddle, updateFluids };
6880
+ Object.assign(I, shared);
6881
+ return shared;
6843
6882
  }
6844
6883
 
6845
6884
  // src/glass-damage.ts
@@ -7215,7 +7254,9 @@ var GameVehicles = (() => {
7215
7254
  for (const h of L.halo ?? []) h.visible = false;
7216
7255
  }
7217
7256
  kit.crackLight = crackLight;
7218
- Object.assign(I, { glassUV, drawWeb, crackGlass, glassRim, shatterGlass, hitGlass, breakLight, crackLight });
7257
+ const shared = { glassUV, drawWeb, crackGlass, glassRim, shatterGlass, hitGlass, breakLight, crackLight };
7258
+ Object.assign(I, shared);
7259
+ return shared;
7219
7260
  }
7220
7261
 
7221
7262
  // src/impact.ts
@@ -7689,7 +7730,7 @@ var GameVehicles = (() => {
7689
7730
  return hit;
7690
7731
  }
7691
7732
  kit.zoneImpact = zoneImpact;
7692
- Object.assign(I, {
7733
+ const shared = {
7693
7734
  dentField,
7694
7735
  hangBumper,
7695
7736
  tankFuel,
@@ -7705,7 +7746,9 @@ var GameVehicles = (() => {
7705
7746
  _pr,
7706
7747
  probe,
7707
7748
  zoneImpact
7708
- });
7749
+ };
7750
+ Object.assign(I, shared);
7751
+ return shared;
7709
7752
  }
7710
7753
 
7711
7754
  // src/explosion.ts
@@ -8090,7 +8133,9 @@ var GameVehicles = (() => {
8090
8133
  }
8091
8134
  }
8092
8135
  }
8093
- Object.assign(I, { BURNT, BURNT_RUB, boomMat, enginePos, fling, burnAll, bigBoomFx, detonate, tickBoom, tickFlying });
8136
+ const shared = { BURNT, BURNT_RUB, boomMat, enginePos, fling, burnAll, bigBoomFx, detonate, tickBoom, tickFlying };
8137
+ Object.assign(I, shared);
8138
+ return shared;
8094
8139
  }
8095
8140
 
8096
8141
  // src/rollover.ts
@@ -8292,7 +8337,8 @@ var GameVehicles = (() => {
8292
8337
  c.parts.forEach(function(p) {
8293
8338
  if (p.kind !== "rotor" && p.kind !== "tail_rotor" || !p.obj) return;
8294
8339
  const main = p.kind === "rotor";
8295
- p.obj.traverse(function(o) {
8340
+ p.obj.traverse(function(node) {
8341
+ const o = node;
8296
8342
  if (!o.isMesh || !o.visible) return;
8297
8343
  const bb = new THREE.Box3().setFromObject(o).applyMatrix4(inv);
8298
8344
  if (!main && bb.min.y >= -0.01) return;
@@ -8364,7 +8410,9 @@ var GameVehicles = (() => {
8364
8410
  if (p >= 1) finishRoll(c);
8365
8411
  }
8366
8412
  kit.rollContact = rollContact;
8367
- Object.assign(I, { rollMeshes, convexHull, rollContact, exactMinY, finishRoll, tickRoll });
8413
+ const shared = { rollMeshes, convexHull, rollContact, exactMinY, finishRoll, tickRoll };
8414
+ Object.assign(I, shared);
8415
+ return shared;
8368
8416
  }
8369
8417
 
8370
8418
  // src/tick.ts
@@ -8402,7 +8450,9 @@ var GameVehicles = (() => {
8402
8450
  c.hood.target = open ? c.hood.open : 0;
8403
8451
  return true;
8404
8452
  };
8405
- Object.assign(I, {});
8453
+ const shared = {};
8454
+ Object.assign(I, shared);
8455
+ return shared;
8406
8456
  }
8407
8457
 
8408
8458
  // src/armor.ts
@@ -8654,7 +8704,9 @@ var GameVehicles = (() => {
8654
8704
  }
8655
8705
  }
8656
8706
  kit.applyArmor = applyArmor;
8657
- Object.assign(I, { STEEL_MATERIAL, PLATE_MATERIALS, jerryCan, applyArmor });
8707
+ const shared = { STEEL_MATERIAL, PLATE_MATERIALS, jerryCan, applyArmor };
8708
+ Object.assign(I, shared);
8709
+ return shared;
8658
8710
  }
8659
8711
 
8660
8712
  // src/zone-core.ts
@@ -8673,8 +8725,8 @@ var GameVehicles = (() => {
8673
8725
  return { id: b.id, name: kit.t("bands." + b.id), min: b.min, health: b.health, color: b.color };
8674
8726
  });
8675
8727
  function bandOf(h) {
8676
- h = Math.round(clamp(h == null ? 100 : h, 0, 100));
8677
- for (let i = 0; i < BANDS.length; i++) if (h >= BANDS[i].min) return i;
8728
+ const v = Math.round(clamp(h == null ? 100 : h, 0, 100));
8729
+ for (let i = 0; i < BANDS.length; i++) if (v >= BANDS[i].min) return i;
8678
8730
  return 4;
8679
8731
  }
8680
8732
  kit.bands = BANDS;
@@ -8700,8 +8752,12 @@ var GameVehicles = (() => {
8700
8752
  z0: Math.min(b[4], b[5]),
8701
8753
  z1: Math.max(b[4], b[5])
8702
8754
  };
8703
- if (b.isBox3) return { x0: b.min.x, x1: b.max.x, y0: b.min.y, y1: b.max.y, z0: b.min.z, z1: b.max.z };
8704
- return { x0: b.x0, x1: b.x1, y0: b.y0, y1: b.y1, z0: b.z0, z1: b.z1 };
8755
+ if (b.isBox3) {
8756
+ const box2 = b;
8757
+ return { x0: box2.min.x, x1: box2.max.x, y0: box2.min.y, y1: box2.max.y, z0: box2.min.z, z1: box2.max.z };
8758
+ }
8759
+ const r = b;
8760
+ return { x0: r.x0, x1: r.x1, y0: r.y0, y1: r.y1, z0: r.z0, z1: r.z1 };
8705
8761
  }
8706
8762
  kit.normalizeBox = normalizeBox;
8707
8763
  function boxLo(B, a) {
@@ -8738,7 +8794,8 @@ var GameVehicles = (() => {
8738
8794
  const bb = new THREE.Box3();
8739
8795
  const tmp = new THREE.Box3();
8740
8796
  const M = new THREE.Matrix4();
8741
- o.traverse(function(x) {
8797
+ o.traverse(function(node) {
8798
+ const x = node;
8742
8799
  if (!x.isMesh || !x.geometry || !x.geometry.attributes.position || x.userData.decal) return;
8743
8800
  if (!x.geometry.boundingBox) x.geometry.computeBoundingBox();
8744
8801
  tmp.copy(x.geometry.boundingBox).applyMatrix4(M.multiplyMatrices(inv, x.matrixWorld));
@@ -8804,7 +8861,7 @@ var GameVehicles = (() => {
8804
8861
  for (let q = o; q && q !== c.vehicle; q = q.parent) if (q.visible === false) return false;
8805
8862
  return !!o;
8806
8863
  }
8807
- Object.assign(I, {
8864
+ const shared = {
8808
8865
  BANDS,
8809
8866
  bandOf,
8810
8867
  ZONE_WEIGHTS,
@@ -8827,7 +8884,9 @@ var GameVehicles = (() => {
8827
8884
  lightBoxOf,
8828
8885
  hideObj,
8829
8886
  shown
8830
- });
8887
+ };
8888
+ Object.assign(I, shared);
8889
+ return shared;
8831
8890
  }
8832
8891
 
8833
8892
  // src/zone-decals.ts
@@ -9112,7 +9171,10 @@ var GameVehicles = (() => {
9112
9171
  narrowTo(rc, q);
9113
9172
  }
9114
9173
  const hits = rc.intersectObjects(cands, false);
9115
- for (let i = 0; i < hits.length; i++) if (hits[i].object.proxyOf) hits[i].object = hits[i].object.proxyOf;
9174
+ for (let i = 0; i < hits.length; i++) {
9175
+ const proxyOf = hits[i].object.proxyOf;
9176
+ if (proxyOf) hits[i].object = proxyOf;
9177
+ }
9116
9178
  return hits;
9117
9179
  }
9118
9180
  function zoneCands(c, z, inv, glassToo) {
@@ -9313,7 +9375,7 @@ var GameVehicles = (() => {
9313
9375
  for (i = 0; i < (spec.tear || 0); i++) if (s = nx()) tears.push(tearDecal(c, s.p, s.n, 0.07 + R() * 0.06, R, s.obj));
9314
9376
  return S;
9315
9377
  }
9316
- Object.assign(I, {
9378
+ const shared = {
9317
9379
  dmat,
9318
9380
  DAMAGE_MATERIALS,
9319
9381
  _zq,
@@ -9334,7 +9396,9 @@ var GameVehicles = (() => {
9334
9396
  ribbonGeo,
9335
9397
  scratchDecal,
9336
9398
  zoneDecals
9337
- });
9399
+ };
9400
+ Object.assign(I, shared);
9401
+ return shared;
9338
9402
  }
9339
9403
 
9340
9404
  // src/zone-dent.ts
@@ -9692,7 +9756,9 @@ var GameVehicles = (() => {
9692
9756
  });
9693
9757
  return piv;
9694
9758
  }
9695
- Object.assign(I, { sm, subdivIn, dentTargets, zoneDent, cutPanel, pivotOf });
9759
+ const shared = { sm, subdivIn, dentTargets, zoneDent, cutPanel, pivotOf };
9760
+ Object.assign(I, shared);
9761
+ return shared;
9696
9762
  }
9697
9763
 
9698
9764
  // src/damage-panels.ts
@@ -10045,7 +10111,9 @@ var GameVehicles = (() => {
10045
10111
  const sgn = new V3().crossVectors(axisV, tangent).dot(outv) > 0 ? 1 : -1;
10046
10112
  piv.quaternion.setFromAxisAngle(axisV, sgn * (0.6 + R() * 0.3));
10047
10113
  }
10048
- Object.assign(I, { panelBand, roofOff, tailOff, followersIn, windowsOver, doorGap, mirrorHang, doorHang, lidHang, flapHang });
10114
+ const shared = { panelBand, roofOff, tailOff, followersIn, windowsOver, doorGap, mirrorHang, doorHang, lidHang, flapHang };
10115
+ Object.assign(I, shared);
10116
+ return shared;
10049
10117
  }
10050
10118
 
10051
10119
  // src/damage-parts.ts
@@ -10161,7 +10229,8 @@ var GameVehicles = (() => {
10161
10229
  }
10162
10230
  function tireMeshes(w) {
10163
10231
  const out = [];
10164
- w.traverse(function(o) {
10232
+ w.traverse(function(node) {
10233
+ const o = node;
10165
10234
  if (o.isMesh && o.material === MATERIALS.rubber) out.push(o);
10166
10235
  });
10167
10236
  return out;
@@ -10220,7 +10289,8 @@ var GameVehicles = (() => {
10220
10289
  c.zoneDrops.push({ x: w.position.x, z: w.position.z, d: r * 0.24 });
10221
10290
  } else if (b === 4) {
10222
10291
  let rr = 0;
10223
- w.traverse(function(o) {
10292
+ w.traverse(function(node) {
10293
+ const o = node;
10224
10294
  if (!o.isMesh || o.material === MATERIALS.rubber) return;
10225
10295
  if (!o.geometry.boundingSphere) o.geometry.computeBoundingSphere();
10226
10296
  const cc = o.geometry.boundingSphere.center.clone().applyMatrix4(o.matrix);
@@ -10428,7 +10498,8 @@ var GameVehicles = (() => {
10428
10498
  const xf = H.x0 + (H.x1 - H.x0) * (0.5 + R() * 0.1);
10429
10499
  const k = 0.55 + R() * 0.2;
10430
10500
  const v = new V3();
10431
- H.piv.children.forEach(function(msh) {
10501
+ H.piv.children.forEach(function(node) {
10502
+ const msh = node;
10432
10503
  if (!msh.isMesh) return;
10433
10504
  msh.updateMatrix();
10434
10505
  const M = msh.matrix;
@@ -10621,7 +10692,7 @@ var GameVehicles = (() => {
10621
10692
  });
10622
10693
  void K;
10623
10694
  }
10624
- Object.assign(I, {
10695
+ const shared = {
10625
10696
  glassPt,
10626
10697
  glassIn,
10627
10698
  glassBand,
@@ -10639,7 +10710,9 @@ var GameVehicles = (() => {
10639
10710
  bumperBand,
10640
10711
  partBand,
10641
10712
  bendAft
10642
- });
10713
+ };
10714
+ Object.assign(I, shared);
10715
+ return shared;
10643
10716
  }
10644
10717
 
10645
10718
  // src/zone-derive.ts
@@ -10662,7 +10735,8 @@ var GameVehicles = (() => {
10662
10735
  }
10663
10736
  function resolveObjs(c, list2, z) {
10664
10737
  const out = [];
10665
- (list2 || []).forEach(function(o) {
10738
+ (list2 || []).forEach(function(item) {
10739
+ const o = item;
10666
10740
  if (!o) return;
10667
10741
  if (typeof o === "string") {
10668
10742
  c.parts.forEach(function(p) {
@@ -10911,7 +10985,9 @@ var GameVehicles = (() => {
10911
10985
  return null;
10912
10986
  }
10913
10987
  kit.zoneOwner = ownerOf;
10914
- Object.assign(I, { parseDir, resolveObjs, deriveZones, carMap, zonesOf, ownerOf });
10988
+ const shared = { parseDir, resolveObjs, deriveZones, carMap, zonesOf, ownerOf };
10989
+ Object.assign(I, shared);
10990
+ return shared;
10915
10991
  }
10916
10992
 
10917
10993
  // src/zone-auto.ts
@@ -11706,7 +11782,9 @@ var GameVehicles = (() => {
11706
11782
  if (!wheelsDone) wheelZones(false);
11707
11783
  return Z;
11708
11784
  }
11709
- Object.assign(I, { autoZones });
11785
+ const shared = { autoZones };
11786
+ Object.assign(I, shared);
11787
+ return shared;
11710
11788
  }
11711
11789
 
11712
11790
  // src/zone-apply.ts
@@ -11917,7 +11995,9 @@ var GameVehicles = (() => {
11917
11995
  c.rand = R0;
11918
11996
  return c.zoneState;
11919
11997
  };
11920
- Object.assign(I, { fadePaint, abandonFx, burntFx, settleDrops });
11998
+ const shared = { fadePaint, abandonFx, burntFx, settleDrops };
11999
+ Object.assign(I, shared);
12000
+ return shared;
11921
12001
  }
11922
12002
 
11923
12003
  // src/scenarios.ts
@@ -12074,7 +12154,9 @@ var GameVehicles = (() => {
12074
12154
  }
12075
12155
  return { p, dir };
12076
12156
  };
12077
- Object.assign(I, { BODY_TYPES });
12157
+ const shared = { BODY_TYPES };
12158
+ Object.assign(I, shared);
12159
+ return shared;
12078
12160
  }
12079
12161
 
12080
12162
  // src/ui.ts
@@ -12231,7 +12313,8 @@ var GameVehicles = (() => {
12231
12313
  }
12232
12314
  g.addEventListener("click", pick);
12233
12315
  g.addEventListener("keydown", function(e) {
12234
- if (e.key === "Enter" || e.key === " ") {
12316
+ const key = e.key;
12317
+ if (key === "Enter" || key === " ") {
12235
12318
  e.preventDefault();
12236
12319
  pick();
12237
12320
  }
@@ -12244,7 +12327,7 @@ var GameVehicles = (() => {
12244
12327
  return kit.bands.map(function(B, i) {
12245
12328
  const b = el("button", null, B.name);
12246
12329
  b.type = "button";
12247
- b.dataset.b = i;
12330
+ b.dataset.b = String(i);
12248
12331
  b.style.setProperty("--band", B.color);
12249
12332
  b.addEventListener("click", function() {
12250
12333
  if (onPick) onPick(B.health, i);
@@ -12472,6 +12555,7 @@ var GameVehicles = (() => {
12472
12555
  hash,
12473
12556
  clamp,
12474
12557
  smooth,
12558
+ // filled by the modules below, each with the helpers it shares
12475
12559
  _: {}
12476
12560
  };
12477
12561
  kit.fuels = {};
@@ -12549,8 +12633,8 @@ var GameVehicles = (() => {
12549
12633
  fn.apply(kit, args);
12550
12634
  });
12551
12635
  };
12552
- kit.configure = function(o) {
12553
- o = o || {};
12636
+ kit.configure = function(cfg) {
12637
+ const o = cfg || {};
12554
12638
  if (o.bands)
12555
12639
  o.bands.forEach(function(b, i) {
12556
12640
  if (kit.bands[i] && b) Object.assign(kit.bands[i], b);
@@ -12586,7 +12670,8 @@ var GameVehicles = (() => {
12586
12670
  }
12587
12671
  ;
12588
12672
  ["impactStain", "defaultSplat", "defaultGroup", "damagedScenario"].forEach(function(k) {
12589
- if (o[k] !== void 0) kit.config[k] = o[k];
12673
+ const v = o[k];
12674
+ if (v !== void 0) kit.config[k] = v;
12590
12675
  });
12591
12676
  return kit;
12592
12677
  };