@adatechnology/game-vehicles-fleet 11.0.0 → 11.0.1

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/dist/index.js CHANGED
@@ -5028,6 +5028,9 @@ function installBoatsExtra(fx) {
5028
5028
  );
5029
5029
  }
5030
5030
 
5031
+ // src/vehicles/cars-extra.ts
5032
+ import { DIVISION_HALF, doorGlassSplits, splitSidePolys } from "@adatechnology/game-vehicles";
5033
+
5031
5034
  // src/vehicles/moving-parts.ts
5032
5035
  var WIPER_SWEEP = 1.5;
5033
5036
  function tagWiper(params) {
@@ -5714,6 +5717,7 @@ function installCarsExtra(fx) {
5714
5717
  };
5715
5718
  return K;
5716
5719
  }
5720
+ const glassDivisions = /* @__PURE__ */ new WeakMap();
5717
5721
  function car(c, s) {
5718
5722
  const W = s.W, gh = s.gh, bev = 0.05, T = { belt: gh.belt, top: gh.roof + bev, k: gh.k }, m = c.meta;
5719
5723
  m.color = s.col;
@@ -5748,6 +5752,9 @@ function installCarsExtra(fx) {
5748
5752
  let polys = windows(gh);
5749
5753
  if (s.dropRear) polys = polys.slice(1);
5750
5754
  if (gh.polys) polys = gh.polys(polys);
5755
+ const divided = splitSidePolys(polys, doorGlassSplits(gh, s.wheels ?? []));
5756
+ polys = divided.polys;
5757
+ glassDivisions.set(c, divided.used);
5751
5758
  const qf = kit.quadDef([gh.fb, gh.belt], [gh.ft, gh.roof], gh.Wg, T, "front", bev, { side: gh.qfSide }), qr = kit.quadDef([gh.rb, gh.belt], [gh.rt, roofR], gh.Wg, T, "rear", bev, { side: gh.qrSide });
5752
5759
  const gHoles = [];
5753
5760
  if (intr) {
@@ -5907,11 +5914,12 @@ function installCarsExtra(fx) {
5907
5914
  K.plate(-1, s.plateR || (bR.y0 + bR.y1) / 2 + 0.03, { off: s.plateROnBumper === false ? 4e-3 : 0.018 });
5908
5915
  const tang = Math.atan(gh.Wg / 2 * gh.k / (T.top - T.belt));
5909
5916
  [1, -1].forEach(function(sd) {
5910
- ;
5911
- (s.blackPillars || []).forEach(function(px) {
5917
+ const bar = function(px, width) {
5912
5918
  const ry = roofAt(gh, px), yc = (gh.belt + ry) / 2 + 5e-3, hh = ry - gh.belt - 0.1;
5913
- c.roundBox(0.118, hh, 3e-3, 15e-4, GLOSS, px, yc, sd * (halfAt(gh.Wg, T, yc) + 4e-3), { rot: [-sd * tang, 0, 0] }).castShadow = false;
5914
- });
5919
+ c.roundBox(width, hh, 3e-3, 15e-4, GLOSS, px, yc, sd * (halfAt(gh.Wg, T, yc) + 4e-3), { rot: [-sd * tang, 0, 0] }).castShadow = false;
5920
+ };
5921
+ (s.blackPillars || []).forEach((px) => bar(px, 0.118));
5922
+ (glassDivisions.get(c) ?? []).forEach((px) => bar(px, 2 * DIVISION_HALF - 2e-3));
5915
5923
  const mx = gh.fb - 0.22, my = gh.belt + 0.09, mz0 = halfAt(gh.Wg, T, my), mcol = s.mirrorCol ? CM(s.mirrorCol, { roughness: 0.4, metalness: 0.3 }) : paint;
5916
5924
  c.roundBox(0.16, 0.05, 0.08, 0.02, MT.trim, mx + 0.03, my - 0.04, sd * (mz0 + 0.03));
5917
5925
  c.roundBox(0.12, 0.12, 0.2, 0.05, mcol, mx, my + 0.02, sd * (mz0 + 0.14), { taper: { sx: 0.8, shift: -0.01 } });
@@ -7638,7 +7646,7 @@ function installCarsExtra(fx) {
7638
7646
  frameR: 9e-3
7639
7647
  });
7640
7648
  const e = K.grid(1, 0, { z1: 0.1, y0: 0.64, y1: 0.72, du: 0.03, dv: 0.03 }).at(0.5, 0.67);
7641
- kit.emblem(c2, e.p.x + 0.025, 0.67, 0, 0.045);
7649
+ kit.emblem(c2, e.p.x + 0.018, 0.67, 0, 0.045);
7642
7650
  const bg = c2.meta.frontBumper.userData.grid;
7643
7651
  c2.deform.push(K.skin(bg, MT.rubber, { u0: 0.02, u1: 0.98, yb: 0.37, yt: 0.405, off: 0.02, nv: 1 }));
7644
7652
  },
@@ -14037,6 +14045,7 @@ function installMilitary(fx) {
14037
14045
  }
14038
14046
 
14039
14047
  // src/vehicles/motorcycles-cars.ts
14048
+ import { DIVISION_HALF as DIVISION_HALF2, doorGlassSplits as doorGlassSplits2, splitSidePolys as splitSidePolys2 } from "@adatechnology/game-vehicles";
14040
14049
  function installMotorcyclesCars(fx) {
14041
14050
  const kit = fx.kit;
14042
14051
  const THREE = kit.THREE;
@@ -14808,6 +14817,7 @@ function installMotorcyclesCars(fx) {
14808
14817
  };
14809
14818
  return K;
14810
14819
  }
14820
+ const glassDivisions = /* @__PURE__ */ new WeakMap();
14811
14821
  function car(c, s) {
14812
14822
  const W = s.W, gh = s.gh, bev = 0.05, T = { belt: gh.belt, top: gh.roof + bev, k: gh.k }, m = c.meta;
14813
14823
  m.color = s.col;
@@ -14841,6 +14851,9 @@ function installMotorcyclesCars(fx) {
14841
14851
  ghItems.push([gh.ft, gh.roof, gh.r2 || 0.2], [gh.fb, gh.belt - 0.1, 0]);
14842
14852
  let polys = windows(gh);
14843
14853
  if (s.dropRear) polys = polys.slice(1);
14854
+ const divided = splitSidePolys2(polys, doorGlassSplits2(gh, s.wheels ?? []));
14855
+ polys = divided.polys;
14856
+ glassDivisions.set(c, divided.used);
14844
14857
  const qf = kit.quadDef([gh.fb, gh.belt], [gh.ft, gh.roof], gh.Wg, T, "front", bev), qr = kit.quadDef([gh.rb, gh.belt], [gh.rt, roofR], gh.Wg, T, "rear", bev);
14845
14858
  const gHoles = [];
14846
14859
  if (intr) {
@@ -14993,11 +15006,12 @@ function installMotorcyclesCars(fx) {
14993
15006
  K.plate(-1, s.plateR || (bR.y0 + bR.y1) / 2 + 0.03, { off: s.plateROnBumper === false ? 4e-3 : 0.018 });
14994
15007
  const tang = Math.atan(gh.Wg / 2 * gh.k / (T.top - T.belt));
14995
15008
  [1, -1].forEach(function(sd) {
14996
- ;
14997
- (s.blackPillars || []).forEach(function(px) {
15009
+ const bar = function(px, width) {
14998
15010
  const ry = roofAt(gh, px), yc = (gh.belt + ry) / 2 + 5e-3, hh = ry - gh.belt - 0.1;
14999
- c.roundBox(0.118, hh, 3e-3, 15e-4, GLOSS, px, yc, sd * (halfAt(gh.Wg, T, yc) + 4e-3), { rot: [-sd * tang, 0, 0] }).castShadow = false;
15000
- });
15011
+ c.roundBox(width, hh, 3e-3, 15e-4, GLOSS, px, yc, sd * (halfAt(gh.Wg, T, yc) + 4e-3), { rot: [-sd * tang, 0, 0] }).castShadow = false;
15012
+ };
15013
+ (s.blackPillars || []).forEach((px) => bar(px, 0.118));
15014
+ (glassDivisions.get(c) ?? []).forEach((px) => bar(px, 2 * DIVISION_HALF2 - 2e-3));
15001
15015
  const mx = gh.fb - 0.22, my = gh.belt + 0.09, mz0 = halfAt(gh.Wg, T, my), mcol = s.mirrorCol ? CM(s.mirrorCol, { roughness: 0.4, metalness: 0.3 }) : paint;
15002
15016
  c.roundBox(0.16, 0.05, 0.08, 0.02, MT.trim, mx + 0.03, my - 0.04, sd * (mz0 + 0.03));
15003
15017
  c.roundBox(0.12, 0.12, 0.2, 0.05, mcol, mx, my + 0.02, sd * (mz0 + 0.14), { taper: { sx: 0.8, shift: -0.01 } });
@@ -18647,8 +18661,8 @@ function installMotorcyclesExtra(fx) {
18647
18661
  return b;
18648
18662
  }
18649
18663
  function plateMoto(c, x, y, txt) {
18650
- c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x + 9e-3, y, 0);
18651
- c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x - 3e-3, y, 0, "-x", {
18664
+ c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x + 7e-3, y, 0);
18665
+ c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x - 5e-3, y, 0, "-x", {
18652
18666
  w: 300,
18653
18667
  h: 220,
18654
18668
  bg: "#f2f2ee",
@@ -18762,8 +18776,8 @@ function installMotorcyclesExtra(fx) {
18762
18776
  d.position.z = s * hw * 0.72;
18763
18777
  g.add(d);
18764
18778
  for (let q = 0; q < 12; q++) {
18765
- const a2 = q / 12 * PI * 2, sl = new THREE.Mesh(G.roundedBox(rimR * 0.42, 0.016, 6e-3, 5e-3), o.slot || CM("#1c1e21", { metalness: 0.5, roughness: 0.4 }));
18766
- sl.position.set(Math.cos(a2) * rimR * 0.62, Math.sin(a2) * rimR * 0.62, s * (hw * 0.72 + 0.0105));
18779
+ const a2 = q / 12 * PI * 2, sl = new THREE.Mesh(G.roundedBox(rimR * 0.42, 0.016, 6e-3, 2e-3), o.slot || CM("#1c1e21", { metalness: 0.5, roughness: 0.4 }));
18780
+ sl.position.set(Math.cos(a2) * rimR * 0.62, Math.sin(a2) * rimR * 0.62, s * (hw * 0.72 + 0.013));
18767
18781
  sl.rotation.z = a2;
18768
18782
  g.add(sl);
18769
18783
  }
@@ -23737,7 +23751,8 @@ function installSuvPickupVan(fx) {
23737
23751
  tailLightY: 2.06,
23738
23752
  noAntenna: true,
23739
23753
  hl: { style: "round", w: 0.2, h: 0.2, y: 2.03, in: 0.12, yaw: 0 },
23740
- grille: { style: "bars", w: 1, h: 0.3, y: 2 },
23754
+ /* the badge is this truck's foremost point: 9 mm back, where it was before its layers grew 7 mm and the grille came 2 mm ahead (the length the team measured) */
23755
+ grille: { style: "bars", w: 1, h: 0.3, y: 2, emblemBack: 9e-3 },
23741
23756
  tl: { style: "vertical", w: 0.12, h: 0.28, y: 2.06, in: 0 },
23742
23757
  interior: { rows: 1, col: "#202224", trim: "#141516", front: "bench" },
23743
23758
  hood: { motor: "v8" },