@adatechnology/game-vehicles-three 0.3.6 → 0.3.7

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.
@@ -3745,11 +3745,11 @@ var GameVehiclesThree = (() => {
3745
3745
  function installBoatsExtra(fx) {
3746
3746
  const kit = fx.kit;
3747
3747
  const THREE = kit.THREE;
3748
- const shared = fx.shared;
3748
+ const shared2 = fx.shared;
3749
3749
  const trl = fx.t;
3750
3750
  const lbl = fx.label;
3751
- if (!kit || !shared.EA) return;
3752
- const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, DS = THREE.DoubleSide, EA = shared.EA, tb = EA.tab;
3751
+ if (!kit || !shared2.EA) return;
3752
+ const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, DS = THREE.DoubleSide, EA = shared2.EA, tb = EA.tab;
3753
3753
  function sailGeo(T, Hd, C, cam, o) {
3754
3754
  o = o || {};
3755
3755
  const nu = o.nu || 10, nv = o.nv || 16, pos = [], idx = [], roach = o.roach || 0;
@@ -9617,11 +9617,11 @@ var GameVehiclesThree = (() => {
9617
9617
  function installHelicoptersExtra(fx) {
9618
9618
  const kit = fx.kit;
9619
9619
  const THREE = kit.THREE;
9620
- const shared = fx.shared;
9620
+ const shared2 = fx.shared;
9621
9621
  const trl = fx.t;
9622
9622
  const lbl = fx.label;
9623
9623
  const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, G2 = kit.geo;
9624
- const GH = shared.GH;
9624
+ const GH = shared2.GH;
9625
9625
  function skids(c, o) {
9626
9626
  const mat = o.mat || MT.steel, z = o.z, y = o.y || 0.07, out = [];
9627
9627
  [1, -1].forEach(function(s) {
@@ -9768,7 +9768,7 @@ var GameVehiclesThree = (() => {
9768
9768
  hood: false
9769
9769
  },
9770
9770
  function(c) {
9771
- const EA = shared.EA, col = "#1f4f8a", blue = c.paint(col), white = c.paint("#e9e7e0"), blk = CM("#1c1d1f", { roughness: 0.6 });
9771
+ const EA = shared2.EA, col = "#1f4f8a", blue = c.paint(col), white = c.paint("#e9e7e0"), blk = CM("#1c1d1f", { roughness: 0.6 });
9772
9772
  const ST = [
9773
9773
  [1.6, 0.84, 0.92, 0.06, 2],
9774
9774
  [1.5, 0.64, 1.22, 0.66, 2.2],
@@ -10103,7 +10103,7 @@ var GameVehiclesThree = (() => {
10103
10103
  hood: false
10104
10104
  },
10105
10105
  function(c) {
10106
- const EA = shared.EA, wcol = "#eeece6", white = c.paint(wcol), mar = c.paint("#7a1e22"), gold = c.paint("#c49a3a"), blk = CM("#1c1d1f", { roughness: 0.6 });
10106
+ const EA = shared2.EA, wcol = "#eeece6", white = c.paint(wcol), mar = c.paint("#7a1e22"), gold = c.paint("#c49a3a"), blk = CM("#1c1d1f", { roughness: 0.6 });
10107
10107
  const ST = [
10108
10108
  [2.62, 0.95, 1.06, 0.08, 2],
10109
10109
  [2.48, 0.7, 1.45, 0.86, 2.2],
@@ -10488,7 +10488,7 @@ var GameVehiclesThree = (() => {
10488
10488
  hood: false
10489
10489
  },
10490
10490
  function(c) {
10491
- const EA = shared.EA, navyC = "#1b2c52", navy = c.paint(navyC), white = c.paint("#ecebe6"), yel = c.paint("#d7b23a"), blk = CM("#1c1d1f", { roughness: 0.6 });
10491
+ const EA = shared2.EA, navyC = "#1b2c52", navy = c.paint(navyC), white = c.paint("#ecebe6"), yel = c.paint("#d7b23a"), blk = CM("#1c1d1f", { roughness: 0.6 });
10492
10492
  const ST = [
10493
10493
  [3.36, 1, 1.12, 0.08, 2],
10494
10494
  [3.22, 0.76, 1.56, 0.96, 2.4],
@@ -10932,7 +10932,7 @@ var GameVehiclesThree = (() => {
10932
10932
  hood: false
10933
10933
  },
10934
10934
  function(c) {
10935
- const EA = shared.EA, blk = CM("#1a1b1d", { roughness: 0.6 });
10935
+ const EA = shared2.EA, blk = CM("#1a1b1d", { roughness: 0.6 });
10936
10936
  c.meta.matte = true;
10937
10937
  const cA = new THREE.Color("#3a4430"), cB = new THREE.Color("#66603f"), cC = new THREE.Color("#55613f"), cL = new THREE.Color("#8d958c");
10938
10938
  function camo(x, y, z, under) {
@@ -19988,7 +19988,7 @@ var GameVehiclesThree = (() => {
19988
19988
  function installPlanesExtra(fx) {
19989
19989
  const kit = fx.kit;
19990
19990
  const THREE = kit.THREE;
19991
- const shared = fx.shared;
19991
+ const shared2 = fx.shared;
19992
19992
  const trl = fx.t;
19993
19993
  const lbl = fx.label;
19994
19994
  const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
@@ -20140,7 +20140,7 @@ var GameVehiclesThree = (() => {
20140
20140
  m.rotation.y += -s * Math.atan2(a - b, w);
20141
20141
  return m;
20142
20142
  }
20143
- shared.GH = {
20143
+ shared2.GH = {
20144
20144
  pose3,
20145
20145
  starDecal,
20146
20146
  rrect,
@@ -20174,7 +20174,7 @@ var GameVehiclesThree = (() => {
20174
20174
  hood: false
20175
20175
  },
20176
20176
  function(c) {
20177
- const EA = shared.EA, yel = "#f0bd22";
20177
+ const EA = shared2.EA, yel = "#f0bd22";
20178
20178
  const Q = pose3([1.62, -0.78], 0.25, [-3.24, -0.27], 0.075), P = Q.P, TH = Q.TH;
20179
20179
  const grp = new THREE.Group();
20180
20180
  grp.position.set(0, Q.Y0, 0);
@@ -20486,7 +20486,7 @@ var GameVehiclesThree = (() => {
20486
20486
  });
20487
20487
  const pd = pod(
20488
20488
  c2,
20489
- shared.EA,
20489
+ shared2.EA,
20490
20490
  P(1.4, -0.6).x,
20491
20491
  P(-1.2, -0.45).x,
20492
20492
  P(0.1, -0.66).y,
@@ -20523,7 +20523,7 @@ var GameVehiclesThree = (() => {
20523
20523
  hood: false
20524
20524
  },
20525
20525
  function(c) {
20526
- const EA = shared.EA, wcol = "#ecebe6", white = c.paint(wcol), blue = c.paint("#1d4f8c"), grey = c.paint("#8e959a"), blk = CM("#1c1d1f", { roughness: 0.6 });
20526
+ const EA = shared2.EA, wcol = "#ecebe6", white = c.paint(wcol), blue = c.paint("#1d4f8c"), grey = c.paint("#8e959a"), blk = CM("#1c1d1f", { roughness: 0.6 });
20527
20527
  const ST = [
20528
20528
  [7.58, 1.5, 1.62, 0.08, 2],
20529
20529
  [7.35, 1.3, 1.82, 0.56, 2.2],
@@ -20911,7 +20911,7 @@ var GameVehiclesThree = (() => {
20911
20911
  hood: false
20912
20912
  },
20913
20913
  function(c) {
20914
- const EA = shared.EA, wcol = "#eceae3", white = c.paint(wcol), navy = c.paint("#1e2f55"), gold = c.paint("#c99a2e"), blk = CM("#1c1d1f", { roughness: 0.6 });
20914
+ const EA = shared2.EA, wcol = "#eceae3", white = c.paint(wcol), navy = c.paint("#1e2f55"), gold = c.paint("#c99a2e"), blk = CM("#1c1d1f", { roughness: 0.6 });
20915
20915
  const ST = [
20916
20916
  [5, 2.26, 2.86, 0.62, 2.2],
20917
20917
  [4.75, 2.08, 3, 0.98, 2.6],
@@ -21326,7 +21326,7 @@ var GameVehiclesThree = (() => {
21326
21326
  hood: false
21327
21327
  },
21328
21328
  function(c) {
21329
- const EA = shared.EA, wcol = "#efeeea", white = c.paint(wcol), silver = c.paint("#7d868e", { metalness: 0.45, roughness: 0.35 }), navy = c.paint("#23324f"), blk = CM("#15161a", { roughness: 0.5 });
21329
+ const EA = shared2.EA, wcol = "#efeeea", white = c.paint(wcol), silver = c.paint("#7d868e", { metalness: 0.45, roughness: 0.35 }), navy = c.paint("#23324f"), blk = CM("#15161a", { roughness: 0.5 });
21330
21330
  const ST = [
21331
21331
  [6.3, 1.13, 1.2, 0.06, 2],
21332
21332
  [6, 0.92, 1.44, 0.6, 2.1],
@@ -21707,7 +21707,7 @@ var GameVehiclesThree = (() => {
21707
21707
  hood: false
21708
21708
  },
21709
21709
  function(c) {
21710
- const EA = shared.EA, blk = CM("#1a1b1d", { roughness: 0.6 });
21710
+ const EA = shared2.EA, blk = CM("#1a1b1d", { roughness: 0.6 });
21711
21711
  c.meta.matte = true;
21712
21712
  const cA = new THREE.Color("#323f2b"), cB = new THREE.Color("#5f6d45"), cC = new THREE.Color("#7f8466"), cL = new THREE.Color("#a3abad");
21713
21713
  function camo(x, z, y, under) {
@@ -24365,7 +24365,7 @@ var GameVehiclesThree = (() => {
24365
24365
  function installWaterAir(fx) {
24366
24366
  const kit = fx.kit;
24367
24367
  const THREE = kit.THREE;
24368
- const shared = fx.shared;
24368
+ const shared2 = fx.shared;
24369
24369
  const trl = fx.t;
24370
24370
  const lbl = fx.label;
24371
24371
  const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, G2 = kit.geo, DS = THREE.DoubleSide, clamp3 = kit.clamp;
@@ -25040,7 +25040,7 @@ var GameVehiclesThree = (() => {
25040
25040
  t.rotation.y += s > 0 ? -Math.atan(m) : Math.atan(m);
25041
25041
  return t;
25042
25042
  }
25043
- shared.EA = {
25043
+ shared2.EA = {
25044
25044
  colorize,
25045
25045
  tab,
25046
25046
  tabL,
@@ -25099,7 +25099,7 @@ var GameVehiclesThree = (() => {
25099
25099
  hood: false
25100
25100
  },
25101
25101
  function(c) {
25102
- const EA = shared.EA, tb = EA.tab, alu = CM("#9aa1a6", { metalness: 0.65, roughness: 0.38, side: DS }), aluD = CM("#7d8489", { metalness: 0.6, roughness: 0.45, side: DS });
25102
+ const EA = shared2.EA, tb = EA.tab, alu = CM("#9aa1a6", { metalness: 0.65, roughness: 0.38, side: DS }), aluD = CM("#7d8489", { metalness: 0.6, roughness: 0.45, side: DS });
25103
25103
  const L = 5, x0 = -2.5;
25104
25104
  const H = EA.boatHull({
25105
25105
  x0,
@@ -25251,7 +25251,7 @@ var GameVehiclesThree = (() => {
25251
25251
  hood: false
25252
25252
  },
25253
25253
  function(c) {
25254
- const EA = shared.EA, tb = EA.tab, L = 7.26, x0 = -3.63;
25254
+ const EA = shared2.EA, tb = EA.tab, L = 7.26, x0 = -3.63;
25255
25255
  const white = c.paint("#ecebe5", { roughness: 0.3, metalness: 0.1 }), navy = c.paint("#1f2f4a", { roughness: 0.3, metalness: 0.1 }), vinyl = CM("#e3ddd0", { roughness: 0.65 }), _vinylD = CM("#3c4a5c", { roughness: 0.65 }), teak = CM("#8a6a45", { roughness: 0.8 });
25256
25256
  const H = EA.boatHull({
25257
25257
  x0,
@@ -25498,7 +25498,7 @@ var GameVehiclesThree = (() => {
25498
25498
  hood: false
25499
25499
  },
25500
25500
  function(c) {
25501
- const EA = shared.EA, tb = EA.tab, L = 11, x0 = -5.5;
25501
+ const EA = shared2.EA, tb = EA.tab, L = 11, x0 = -5.5;
25502
25502
  const blue = c.paint("#2f5e86", { roughness: 0.7, metalness: 0.05 }), wht = c.paint("#e6e3da", { roughness: 0.7, metalness: 0.05 }), redP = c.paint("#7a2219", { roughness: 0.8, metalness: 0.05 }), wood = CM("#6b4a2e", { roughness: 0.85 }), deckW = CM("#8a6e4c", { roughness: 0.9, side: DS });
25503
25503
  const H = EA.boatHull({
25504
25504
  x0,
@@ -25802,7 +25802,7 @@ var GameVehiclesThree = (() => {
25802
25802
  hood: false
25803
25803
  },
25804
25804
  function(c) {
25805
- const EA = shared.EA, white = "#ecebe6";
25805
+ const EA = shared2.EA, white = "#ecebe6";
25806
25806
  const paintW = c.paint(white);
25807
25807
  const ST = [
25808
25808
  [2.3, 0.98, 1.46, 0.7, 2.4],
@@ -26131,7 +26131,7 @@ var GameVehiclesThree = (() => {
26131
26131
  hood: false
26132
26132
  },
26133
26133
  function(c) {
26134
- const EA = shared.EA, TH = 0.19, X0 = 0.3, Y0 = 1, cs = Math.cos(TH), sn = Math.sin(TH);
26134
+ const EA = shared2.EA, TH = 0.19, X0 = 0.3, Y0 = 1, cs = Math.cos(TH), sn = Math.sin(TH);
26135
26135
  function P(x, y, z) {
26136
26136
  return new V3(x * cs - y * sn + X0, x * sn + y * cs + Y0, z || 0);
26137
26137
  }
@@ -26488,7 +26488,7 @@ var GameVehiclesThree = (() => {
26488
26488
  hood: false
26489
26489
  },
26490
26490
  function(c) {
26491
- const EA = shared.EA, red = c.paint("#a9241e"), white = c.paint("#e9e7e0"), blk = CM("#1c1d1f", { roughness: 0.6 });
26491
+ const EA = shared2.EA, red = c.paint("#a9241e"), white = c.paint("#e9e7e0"), blk = CM("#1c1d1f", { roughness: 0.6 });
26492
26492
  const ST = [
26493
26493
  [1.96, 0.96, 1.06, 0.06, 2],
26494
26494
  [1.85, 0.76, 1.4, 0.76, 2.2],
@@ -26814,7 +26814,7 @@ var GameVehiclesThree = (() => {
26814
26814
  hood: false
26815
26815
  },
26816
26816
  function(c) {
26817
- const EA = shared.EA, org = c.paint("#d0531e"), white = c.paint("#e8e6df"), blk = CM("#1c1d1f", { roughness: 0.6 });
26817
+ const EA = shared2.EA, org = c.paint("#d0531e"), white = c.paint("#e8e6df"), blk = CM("#1c1d1f", { roughness: 0.6 });
26818
26818
  const ST = [
26819
26819
  [3.34, 1, 1.12, 0.1, 2],
26820
26820
  [3.2, 0.82, 1.48, 0.95, 2.2],
@@ -27176,11 +27176,11 @@ var GameVehiclesThree = (() => {
27176
27176
  const groups = new Set(options.groups || fleetGroupIds);
27177
27177
  const only = options.vehicles ? new Set(options.vehicles) : null;
27178
27178
  const skip = new Set(options.exclude || []);
27179
- const shared = {};
27179
+ const shared2 = {};
27180
27180
  const t = (key, vars) => kit.t("fleet." + key, vars);
27181
27181
  return {
27182
27182
  kit,
27183
- shared,
27183
+ shared: shared2,
27184
27184
  t,
27185
27185
  label: (key) => ({ key, label: t("labels." + key) }),
27186
27186
  register(spec, build) {
@@ -29507,6 +29507,90 @@ var GameVehiclesThree = (() => {
29507
29507
  shims.add(result);
29508
29508
  return result;
29509
29509
  }
29510
+ var isTexture = (v) => !!v && typeof v === "object" && v.isTexture === true;
29511
+ function texturesOf(material, out) {
29512
+ for (const value of Object.values(material)) if (isTexture(value)) out.add(value);
29513
+ const uniforms = material.uniforms;
29514
+ if (uniforms) {
29515
+ for (const u of Object.values(uniforms)) if (isTexture(u?.value)) out.add(u.value);
29516
+ }
29517
+ }
29518
+ function collect(roots) {
29519
+ const geometries = /* @__PURE__ */ new Set();
29520
+ const materials = /* @__PURE__ */ new Set();
29521
+ const textures = /* @__PURE__ */ new Set();
29522
+ const skeletons = /* @__PURE__ */ new Set();
29523
+ for (const root of roots) {
29524
+ root.traverse((object2) => {
29525
+ const o = object2;
29526
+ if (o.geometry && typeof o.geometry.dispose === "function") geometries.add(o.geometry);
29527
+ if (o.skeleton && typeof o.skeleton.dispose === "function") skeletons.add(o.skeleton);
29528
+ const list2 = Array.isArray(o.material) ? o.material : o.material ? [o.material] : [];
29529
+ for (const m of list2) {
29530
+ if (!m || typeof m.dispose !== "function") continue;
29531
+ materials.add(m);
29532
+ texturesOf(m, textures);
29533
+ }
29534
+ });
29535
+ }
29536
+ return { geometries, materials, textures, skeletons };
29537
+ }
29538
+ var marked = /* @__PURE__ */ new WeakSet();
29539
+ var shared = (r) => r.userData?.shared === true || marked.has(r);
29540
+ function releaseObject3D(roots, options = {}) {
29541
+ const list2 = Array.isArray(roots) ? roots : [roots];
29542
+ const report = { geometries: 0, materials: 0, textures: 0 };
29543
+ if (list2.length === 0) return report;
29544
+ const found = collect(list2);
29545
+ const keepRoots = options.keep === void 0 ? [] : Array.isArray(options.keep) ? options.keep : [options.keep];
29546
+ const releasing = new Set(list2);
29547
+ for (const keep of keepRoots) {
29548
+ const walk = (o) => {
29549
+ if (releasing.has(o)) return;
29550
+ const owner = o;
29551
+ if (owner.geometry) found.geometries.delete(owner.geometry);
29552
+ if (owner.skeleton) found.skeletons.delete(owner.skeleton);
29553
+ const mats = Array.isArray(owner.material) ? owner.material : owner.material ? [owner.material] : [];
29554
+ for (const m of mats) {
29555
+ if (!m) continue;
29556
+ found.materials.delete(m);
29557
+ const t = /* @__PURE__ */ new Set();
29558
+ texturesOf(m, t);
29559
+ for (const x of t) found.textures.delete(x);
29560
+ }
29561
+ for (const c of o.children) walk(c);
29562
+ };
29563
+ walk(keep);
29564
+ }
29565
+ for (const g of found.geometries) {
29566
+ if (shared(g)) continue;
29567
+ g.dispose();
29568
+ report.geometries++;
29569
+ }
29570
+ for (const m of found.materials) {
29571
+ if (shared(m)) continue;
29572
+ m.dispose();
29573
+ report.materials++;
29574
+ }
29575
+ for (const t of found.textures) {
29576
+ if (shared(t)) continue;
29577
+ t.dispose();
29578
+ report.textures++;
29579
+ }
29580
+ for (const s of found.skeletons) s.dispose();
29581
+ return report;
29582
+ }
29583
+ function discardObject3D(objects, options = {}) {
29584
+ const list2 = Array.isArray(objects) ? objects : [objects];
29585
+ const keep = options.keep === void 0 ? [] : Array.isArray(options.keep) ? [...options.keep] : [options.keep];
29586
+ for (const object2 of list2) {
29587
+ let top = object2;
29588
+ while (top.parent) top = top.parent;
29589
+ object2.removeFromParent();
29590
+ if (top !== object2 && !keep.includes(top)) keep.push(top);
29591
+ }
29592
+ return releaseObject3D(list2, { keep });
29593
+ }
29510
29594
 
29511
29595
  // ../game-vehicles/dist/index.js
29512
29596
  var __defProp2 = Object.defineProperty;
@@ -34509,8 +34593,15 @@ var GameVehiclesThree = (() => {
34509
34593
  x.arc(cx, cy, 26 * s, 0, PI * 2);
34510
34594
  x.fill();
34511
34595
  }
34596
+ const NO_CANVAS = new Proxy(function() {
34597
+ }, { get: () => NO_CANVAS, apply: () => NO_CANVAS, set: () => true });
34512
34598
  function crackGlass(c, msh, p, force, sc) {
34513
34599
  const G2 = msh.userData.glass;
34600
+ if (G2.cracksFreed) {
34601
+ drawWeb(NO_CANVAS, 0, 0, sc != null ? sc : 0.6 + force * 0.5, Math.max(0.4, G2.aspect || 1), c.rand);
34602
+ G2.hits++;
34603
+ return;
34604
+ }
34514
34605
  if (!G2.cv) {
34515
34606
  G2.cv = document2.createElement("canvas");
34516
34607
  G2.cv.width = G2.cv.height = 256;
@@ -34593,6 +34684,14 @@ var GameVehiclesThree = (() => {
34593
34684
  const G2 = msh.userData.glass;
34594
34685
  if (G2.broken) return;
34595
34686
  G2.broken = true;
34687
+ const freeCracks = function() {
34688
+ if (!G2.tex) return;
34689
+ if (msh.material !== MATERIALS.glassEdge && msh.material?.map === G2.tex) msh.material.dispose();
34690
+ G2.tex.dispose();
34691
+ G2.tex = null;
34692
+ G2.cv = null;
34693
+ G2.cracksFreed = true;
34694
+ };
34596
34695
  const cubesAt = [];
34597
34696
  if (G2.outline && G2.T !== void 0) {
34598
34697
  const out = G2.outline;
@@ -34626,6 +34725,7 @@ var GameVehiclesThree = (() => {
34626
34725
  geo.computeVertexNormals();
34627
34726
  msh.geometry.dispose();
34628
34727
  msh.geometry = geo;
34728
+ freeCracks();
34629
34729
  msh.material = MATERIALS.glassEdge;
34630
34730
  let minx = 1e9;
34631
34731
  let maxx = -1e9;
@@ -34649,8 +34749,12 @@ var GameVehiclesThree = (() => {
34649
34749
  if (rim) {
34650
34750
  msh.geometry.dispose();
34651
34751
  msh.geometry = rim;
34752
+ freeCracks();
34652
34753
  msh.material = MATERIALS.glassEdge;
34653
- } else msh.visible = false;
34754
+ } else {
34755
+ freeCracks();
34756
+ msh.visible = false;
34757
+ }
34654
34758
  for (let j = 0; j < 36; j++)
34655
34759
  cubesAt.push(
34656
34760
  new V3(
@@ -40153,13 +40257,13 @@ var GameVehiclesThree = (() => {
40153
40257
  return c;
40154
40258
  }
40155
40259
  kit.dispose = function(c) {
40156
- const shared = Object.values(I.PARTICLE_GEOMETRIES);
40260
+ const shared2 = Object.values(I.PARTICLE_GEOMETRIES);
40157
40261
  c.root.traverse(function(o) {
40158
40262
  if (o.isSprite) {
40159
40263
  if (o.material && o.material.userData.dis) o.material.dispose();
40160
40264
  return;
40161
40265
  }
40162
- if (o.geometry && !shared.includes(o.geometry)) o.geometry.dispose();
40266
+ if (o.geometry && !shared2.includes(o.geometry)) o.geometry.dispose();
40163
40267
  });
40164
40268
  };
40165
40269
  kit.registerLegacySeeds = registerLegacySeeds;
@@ -42090,8 +42194,8 @@ var GameVehiclesThree = (() => {
42090
42194
  const buildState = () => {
42091
42195
  const parts = model.parts.map((d) => {
42092
42196
  const p = ps.get(d.id);
42093
- const marked = p.dents.length > 0 || p.holes.length > 0 || p.cracks.length > 0;
42094
- const status = p.lost ? p.status : p.hp < p.def.hp || marked ? "damaged" : "intact";
42197
+ const marked2 = p.dents.length > 0 || p.holes.length > 0 || p.cracks.length > 0;
42198
+ const status = p.lost ? p.status : p.hp < p.def.hp || marked2 ? "damaged" : "intact";
42095
42199
  return {
42096
42200
  id: d.id,
42097
42201
  material: d.material,
@@ -43491,10 +43595,10 @@ var GameVehiclesThree = (() => {
43491
43595
  };
43492
43596
  const clearHelpers = () => {
43493
43597
  for (const entry of placed.values()) {
43494
- for (const helper of entry.helpers) helper.parent?.remove(helper);
43598
+ discardObject3D(entry.helpers);
43495
43599
  entry.helpers = [];
43496
43600
  }
43497
- for (const axis of axes) axis.parent?.remove(axis);
43601
+ discardObject3D(axes);
43498
43602
  axes = [];
43499
43603
  helpersShown = "";
43500
43604
  };