@adatechnology/game-vehicles-fleet 11.0.0 → 11.0.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.
@@ -5094,6 +5094,242 @@ var GameVehiclesFleet = (() => {
5094
5094
  );
5095
5095
  }
5096
5096
 
5097
+ // ../game-vehicles/dist/index.js
5098
+ var DIVISION_HALF = 0.02;
5099
+ var GLASS_IN_FROM_EDGE = 0.03;
5100
+ var CUT_EPS = 1e-6;
5101
+ var PAST_EDGE_MIN = 0.01;
5102
+ var PANE_MIN_AREA = 8e-3;
5103
+ var PANE_MIN_WIDTH = 0.12;
5104
+ function carDoorEdges(fb, rb, pillars, xr, rr) {
5105
+ const doorF = fb - 0.03;
5106
+ const pil = pillars.slice().sort((a, b) => b - a);
5107
+ const first = pil[0];
5108
+ const B = first !== void 0 && first < doorF - 0.45 && first > rb + 0.2 ? first : Math.max(rb + 0.1, doorF - 1.1);
5109
+ const rearDoor = first !== void 0 && first < doorF - 0.45 && B - Math.max(rb, xr) > 0.5;
5110
+ const second = pil[1];
5111
+ const C = rearDoor ? Math.max(second !== void 0 && second < B - 0.4 ? second : rb, xr + rr * 0.2) : B;
5112
+ return { doorF, B, C, rearDoor };
5113
+ }
5114
+ function doorEdgesOf(gh, wheels) {
5115
+ let xr = Infinity;
5116
+ let rr = 0.3;
5117
+ for (const w of wheels) {
5118
+ const x = w[0];
5119
+ const r = w[1];
5120
+ if (typeof x === "number" && x < xr) {
5121
+ xr = x;
5122
+ rr = typeof r === "number" ? r : 0.3;
5123
+ }
5124
+ }
5125
+ if (!Number.isFinite(xr)) {
5126
+ if (gh.pillars.length) return null;
5127
+ xr = -Infinity;
5128
+ }
5129
+ return carDoorEdges(gh.fb, gh.rb, gh.pillars, xr, rr);
5130
+ }
5131
+ var SEAM_SNAP = 0.1;
5132
+ var SEAM_INSIDE = 4e-3;
5133
+ function seamOnDoorEdge(x, edges) {
5134
+ if (!edges) return x;
5135
+ let best = x;
5136
+ let gap = SEAM_SNAP;
5137
+ const lines = [edges.doorF - SEAM_INSIDE, edges.B, edges.C === edges.B ? edges.C : edges.C + SEAM_INSIDE];
5138
+ for (let i = 0; i < lines.length; i++) {
5139
+ const d = Math.abs([edges.doorF, edges.B, edges.C][i] - x);
5140
+ if (d <= gap) [best, gap] = [lines[i], d];
5141
+ }
5142
+ return best;
5143
+ }
5144
+ function doorGlassSplits(gh, wheels) {
5145
+ const edges = doorEdgesOf(gh, wheels);
5146
+ if (!edges) return [];
5147
+ return [{ at: edges.C + GLASS_IN_FROM_EDGE - DIVISION_HALF, front: edges.rearDoor ? edges.B : edges.doorF }];
5148
+ }
5149
+ function clipPoly(poly, at, keep) {
5150
+ const out = [];
5151
+ const inside = (p) => keep * ((p[0] ?? 0) - at) >= 0;
5152
+ for (let i = 0; i < poly.length; i++) {
5153
+ const a = poly[i];
5154
+ const b = poly[(i + 1) % poly.length];
5155
+ const ina = inside(a);
5156
+ const inb = inside(b);
5157
+ if (ina) out.push([a[0], a[1]]);
5158
+ if (ina !== inb) {
5159
+ const t = (at - a[0]) / (b[0] - a[0]);
5160
+ out.push([at, a[1] + t * (b[1] - a[1])]);
5161
+ }
5162
+ }
5163
+ return out;
5164
+ }
5165
+ function areaOf(poly) {
5166
+ let a = 0;
5167
+ for (let i = 0; i < poly.length; i++) {
5168
+ const p = poly[i];
5169
+ const q = poly[(i + 1) % poly.length];
5170
+ a += p[0] * q[1] - q[0] * p[1];
5171
+ }
5172
+ return Math.abs(a) / 2;
5173
+ }
5174
+ function widthOf(poly) {
5175
+ const xs = poly.map((p) => p[0]);
5176
+ return Math.max(...xs) - Math.min(...xs);
5177
+ }
5178
+ function splitSidePolys(polys, splits) {
5179
+ let out = polys.map((p) => p.map((q) => [...q]));
5180
+ const used = [];
5181
+ for (const { at, front: doorFront } of splits) {
5182
+ const next = [];
5183
+ let cut = false;
5184
+ for (const poly of out) {
5185
+ const xs = poly.map((p) => p[0]);
5186
+ const edge = at + DIVISION_HALF - GLASS_IN_FROM_EDGE;
5187
+ const middle = (Math.min(...xs) + Math.max(...xs)) / 2;
5188
+ if (Math.min(...xs) >= edge - PAST_EDGE_MIN || Math.max(...xs) <= edge + CUT_EPS || middle <= edge || middle >= doorFront) {
5189
+ next.push(poly);
5190
+ continue;
5191
+ }
5192
+ cut = true;
5193
+ const rear = clipPoly(poly, at - DIVISION_HALF, -1);
5194
+ const front = clipPoly(poly, at + DIVISION_HALF, 1);
5195
+ if (rear.length >= 3 && areaOf(rear) >= PANE_MIN_AREA && widthOf(rear) >= PANE_MIN_WIDTH) next.push(rear);
5196
+ if (front.length >= 3) next.push(front);
5197
+ }
5198
+ if (cut) used.push(at);
5199
+ out = next;
5200
+ }
5201
+ return { polys: out, used };
5202
+ }
5203
+ var SmokeCause = { STEAM: "steam", OIL: "oil", FIRE: "fire" };
5204
+ var SMOKE_LOOKS = {
5205
+ [SmokeCause.STEAM]: { color: 14870248, alpha: 0.18 },
5206
+ [SmokeCause.OIL]: { color: 11120306, alpha: 0.2 },
5207
+ [SmokeCause.FIRE]: { color: 2302756, alpha: 0.3 }
5208
+ };
5209
+ var CAUSE_OF_EMITTER = { white: SmokeCause.STEAM, oil: SmokeCause.OIL, black: SmokeCause.FIRE };
5210
+ var LIFT = { [SmokeCause.STEAM]: 0.5, [SmokeCause.OIL]: 0.45, [SmokeCause.FIRE]: 0.6 };
5211
+ var LID_OUTWARD = [-Math.SQRT1_2, Math.SQRT1_2, 0];
5212
+ var cabin_default = {
5213
+ source: "Spec 012 (R6, T0.2) \u2014 SAE J1100 interior packaging & ISO 7250-1 / NASA-STD-3000 adult anthropometry (1.80 m seated height = 0.936 m, buttock-knee = 0.612 m, shoulder = 0.468 m)",
5214
+ entryDuckFactor: 0.44,
5215
+ categories: {
5216
+ passenger_car: {
5217
+ frontHeadroomMetres: 0.95,
5218
+ rearHeadroomMetres: 0.9,
5219
+ frontLegroomMetres: 0.62,
5220
+ widthMetres: 0.52,
5221
+ door: { widthMetres: 0.65, heightMetres: 0.8 }
5222
+ },
5223
+ suv_pickup: {
5224
+ frontHeadroomMetres: 0.98,
5225
+ rearHeadroomMetres: 0.93,
5226
+ frontLegroomMetres: 0.64,
5227
+ widthMetres: 0.54,
5228
+ door: { widthMetres: 0.7, heightMetres: 0.82 }
5229
+ },
5230
+ van: {
5231
+ frontHeadroomMetres: 1.05,
5232
+ rearHeadroomMetres: 1.05,
5233
+ frontLegroomMetres: 0.65,
5234
+ widthMetres: 0.54,
5235
+ door: { widthMetres: 0.75, heightMetres: 0.95 }
5236
+ },
5237
+ truck: {
5238
+ frontHeadroomMetres: 1,
5239
+ rearHeadroomMetres: 1,
5240
+ frontLegroomMetres: 0.62,
5241
+ widthMetres: 0.52,
5242
+ door: { widthMetres: 0.65, heightMetres: 0.85 }
5243
+ },
5244
+ bus: {
5245
+ frontHeadroomMetres: 1.2,
5246
+ rearHeadroomMetres: 1.2,
5247
+ frontLegroomMetres: 0.62,
5248
+ widthMetres: 0.5,
5249
+ door: { widthMetres: 0.7, heightMetres: 1.75 }
5250
+ },
5251
+ agricultural: {
5252
+ frontHeadroomMetres: 1.05,
5253
+ rearHeadroomMetres: null,
5254
+ frontLegroomMetres: 0.62,
5255
+ widthMetres: 0.52,
5256
+ door: { widthMetres: 0.65, heightMetres: 0.9 }
5257
+ },
5258
+ military_light: {
5259
+ frontHeadroomMetres: 0.95,
5260
+ rearHeadroomMetres: 0.92,
5261
+ frontLegroomMetres: 0.62,
5262
+ widthMetres: 0.5,
5263
+ door: { widthMetres: 0.6, heightMetres: 0.8 }
5264
+ },
5265
+ military_armored: {
5266
+ frontHeadroomMetres: 0.88,
5267
+ rearHeadroomMetres: 0.88,
5268
+ frontLegroomMetres: 0.58,
5269
+ widthMetres: 0.46,
5270
+ door: { widthMetres: 0.5, heightMetres: 0.55 }
5271
+ },
5272
+ open_vehicle: {
5273
+ frontHeadroomMetres: null,
5274
+ rearHeadroomMetres: null,
5275
+ frontLegroomMetres: null,
5276
+ widthMetres: null,
5277
+ door: null
5278
+ },
5279
+ boat_cabin: {
5280
+ frontHeadroomMetres: 1.05,
5281
+ rearHeadroomMetres: 1.05,
5282
+ frontLegroomMetres: 0.62,
5283
+ widthMetres: 0.52,
5284
+ door: { widthMetres: 0.6, heightMetres: 0.9 }
5285
+ },
5286
+ aircraft_enclosed: {
5287
+ frontHeadroomMetres: 0.95,
5288
+ rearHeadroomMetres: 0.92,
5289
+ frontLegroomMetres: 0.62,
5290
+ widthMetres: 0.48,
5291
+ door: { widthMetres: 0.55, heightMetres: 0.8 }
5292
+ }
5293
+ }
5294
+ };
5295
+ var CABIN_CATEGORIES = [
5296
+ "passenger_car",
5297
+ "suv_pickup",
5298
+ "van",
5299
+ "truck",
5300
+ "bus",
5301
+ "agricultural",
5302
+ "military_light",
5303
+ "military_armored",
5304
+ "open_vehicle",
5305
+ "boat_cabin",
5306
+ "aircraft_enclosed"
5307
+ ];
5308
+ var toClearance = (value) => value === null ? Number.POSITIVE_INFINITY : value;
5309
+ var toCabinMinimum = (category, raw) => {
5310
+ if (category === "open_vehicle") {
5311
+ return {
5312
+ frontHeadroomMetres: Number.POSITIVE_INFINITY,
5313
+ rearHeadroomMetres: Number.POSITIVE_INFINITY,
5314
+ frontLegroomMetres: Number.POSITIVE_INFINITY,
5315
+ widthMetres: Number.POSITIVE_INFINITY,
5316
+ door: void 0
5317
+ };
5318
+ }
5319
+ return {
5320
+ frontHeadroomMetres: toClearance(raw.frontHeadroomMetres),
5321
+ rearHeadroomMetres: raw.rearHeadroomMetres === null ? void 0 : raw.rearHeadroomMetres,
5322
+ frontLegroomMetres: toClearance(raw.frontLegroomMetres),
5323
+ widthMetres: toClearance(raw.widthMetres),
5324
+ door: raw.door === null ? void 0 : { widthMetres: raw.door.widthMetres, heightMetres: raw.door.heightMetres }
5325
+ };
5326
+ };
5327
+ var CABIN_SOURCE = cabin_default.source;
5328
+ var ENTRY_DUCK_FACTOR = cabin_default.entryDuckFactor;
5329
+ var CABIN_MINIMUMS = Object.fromEntries(
5330
+ CABIN_CATEGORIES.map((category) => [category, toCabinMinimum(category, cabin_default.categories[category])])
5331
+ );
5332
+
5097
5333
  // src/vehicles/moving-parts.ts
5098
5334
  var WIPER_SWEEP = 1.5;
5099
5335
  function tagWiper(params) {
@@ -5780,6 +6016,7 @@ var GameVehiclesFleet = (() => {
5780
6016
  };
5781
6017
  return K;
5782
6018
  }
6019
+ const glassDivisions = /* @__PURE__ */ new WeakMap();
5783
6020
  function car(c, s) {
5784
6021
  const W = s.W, gh = s.gh, bev = 0.05, T = { belt: gh.belt, top: gh.roof + bev, k: gh.k }, m = c.meta;
5785
6022
  m.color = s.col;
@@ -5814,6 +6051,9 @@ var GameVehiclesFleet = (() => {
5814
6051
  let polys = windows(gh);
5815
6052
  if (s.dropRear) polys = polys.slice(1);
5816
6053
  if (gh.polys) polys = gh.polys(polys);
6054
+ const divided = splitSidePolys(polys, doorGlassSplits(gh, s.wheels ?? []));
6055
+ polys = divided.polys;
6056
+ glassDivisions.set(c, divided.used);
5817
6057
  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 });
5818
6058
  const gHoles = [];
5819
6059
  if (intr) {
@@ -5879,6 +6119,8 @@ var GameVehiclesFleet = (() => {
5879
6119
  rb: gh.rb,
5880
6120
  rt: gh.rt,
5881
6121
  roof: gh.roof + 0.02,
6122
+ roofRear: (gh.roofR || gh.roof) + 0.02,
6123
+ roofCrown: gh.crown || 0,
5882
6124
  belt: gh.belt,
5883
6125
  floor: s.bottomY + 0.02,
5884
6126
  seatH: 0.12,
@@ -5973,19 +6215,25 @@ var GameVehiclesFleet = (() => {
5973
6215
  K.plate(-1, s.plateR || (bR.y0 + bR.y1) / 2 + 0.03, { off: s.plateROnBumper === false ? 4e-3 : 0.018 });
5974
6216
  const tang = Math.atan(gh.Wg / 2 * gh.k / (T.top - T.belt));
5975
6217
  [1, -1].forEach(function(sd) {
5976
- ;
5977
- (s.blackPillars || []).forEach(function(px) {
6218
+ const bar = function(px, width) {
5978
6219
  const ry = roofAt(gh, px), yc = (gh.belt + ry) / 2 + 5e-3, hh = ry - gh.belt - 0.1;
5979
- 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;
6220
+ const m2 = c.roundBox(width, hh, 3e-3, 15e-4, GLOSS, px, yc, sd * (halfAt(gh.Wg, T, yc) + 4e-3), { rot: [-sd * tang, 0, 0] });
6221
+ m2.castShadow = false;
6222
+ return m2;
6223
+ };
6224
+ (s.blackPillars || []).forEach((px) => bar(px, 0.118));
6225
+ (glassDivisions.get(c) ?? []).forEach((px) => {
6226
+ bar(px, 2 * DIVISION_HALF - 2e-3).userData.doorChannel = true;
5980
6227
  });
5981
6228
  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;
5982
6229
  c.roundBox(0.16, 0.05, 0.08, 0.02, MT.trim, mx + 0.03, my - 0.04, sd * (mz0 + 0.03));
5983
6230
  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 } });
5984
6231
  c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
5985
6232
  if (s.mirrorBlink !== false) c.roundBox(0.02, 0.012, 0.12, 5e-3, MT.amber, mx + 0.03, my - 0.025, sd * (mz0 + 0.17));
6233
+ const edges = doorEdgesOf(gh, s.wheels ?? []);
5986
6234
  (s.seams || []).forEach(function(q) {
5987
- const r = q, x = r.length ? r[0] : q, y0 = r.length ? r[1] : by + 0.09, y1 = r.length ? r[2] : gh.belt - 0.03;
5988
- c.roundBox(8e-3, y1 - y0, 6e-3, 3e-3, MT.dark, x, (y0 + y1) / 2, sd * (hw + 1e-3));
6235
+ const r = q, x = seamOnDoorEdge(r.length ? r[0] : q, edges), y0 = r.length ? r[1] : by + 0.09, y1 = r.length ? r[2] : gh.belt - 0.03;
6236
+ doorSeam(c, S, sd, x, y0, y1);
5989
6237
  });
5990
6238
  (s.handles || []).forEach(function(x) {
5991
6239
  c.roundBox(
@@ -6140,6 +6388,18 @@ var GameVehiclesFleet = (() => {
6140
6388
  c.cylinder(0.07, 0.055, 0.1, MT.steel, x, y, z, "x");
6141
6389
  c.cylinder(0.06, 0.06, 0.012, MT.head, x + 0.055, y, z, "x");
6142
6390
  }
6391
+ const SEAM_POINTS = 14;
6392
+ function doorSeam(c, S, sd, x, y0, y1) {
6393
+ const pts = [];
6394
+ for (let k = 0; k <= SEAM_POINTS; k++) {
6395
+ const y = y0 + (y1 - y0) * k / SEAM_POINTS, h = S.hit(new V3(x, y, sd * (S.hw + 1)), new V3(0, 0, -sd), "M");
6396
+ pts.push(h ? h.p.clone().addScaledVector(h.n, 1e-3) : new V3(x, y, sd * (S.hw + 1e-3)));
6397
+ }
6398
+ const t = c.tube(pts, 3e-3, MT.dark, { seg: SEAM_POINTS, rs: 4 });
6399
+ t.castShadow = false;
6400
+ t.userData.doorSeam = true;
6401
+ return t;
6402
+ }
6143
6403
  function sm(t) {
6144
6404
  t = clamp(t, 0, 1);
6145
6405
  return t * t * (3 - 2 * t);
@@ -6727,7 +6987,8 @@ var GameVehiclesFleet = (() => {
6727
6987
  [1.75, 0.8],
6728
6988
  [0.6, 0.82],
6729
6989
  [-0.6, 0.835],
6730
- [-1.82, 0.85]
6990
+ // it ends where the taillight wraps onto the side, never running into the lamp
6991
+ [-1.6, 0.845]
6731
6992
  ],
6732
6993
  { col: hex, h: 0.024 }
6733
6994
  );
@@ -7704,7 +7965,7 @@ var GameVehiclesFleet = (() => {
7704
7965
  frameR: 9e-3
7705
7966
  });
7706
7967
  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);
7707
- kit.emblem(c2, e.p.x + 0.025, 0.67, 0, 0.045);
7968
+ kit.emblem(c2, e.p.x + 0.018, 0.67, 0, 0.045);
7708
7969
  const bg = c2.meta.frontBumper.userData.grid;
7709
7970
  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 }));
7710
7971
  },
@@ -14874,6 +15135,7 @@ var GameVehiclesFleet = (() => {
14874
15135
  };
14875
15136
  return K;
14876
15137
  }
15138
+ const glassDivisions = /* @__PURE__ */ new WeakMap();
14877
15139
  function car(c, s) {
14878
15140
  const W = s.W, gh = s.gh, bev = 0.05, T = { belt: gh.belt, top: gh.roof + bev, k: gh.k }, m = c.meta;
14879
15141
  m.color = s.col;
@@ -14907,6 +15169,9 @@ var GameVehiclesFleet = (() => {
14907
15169
  ghItems.push([gh.ft, gh.roof, gh.r2 || 0.2], [gh.fb, gh.belt - 0.1, 0]);
14908
15170
  let polys = windows(gh);
14909
15171
  if (s.dropRear) polys = polys.slice(1);
15172
+ const divided = splitSidePolys(polys, doorGlassSplits(gh, s.wheels ?? []));
15173
+ polys = divided.polys;
15174
+ glassDivisions.set(c, divided.used);
14910
15175
  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);
14911
15176
  const gHoles = [];
14912
15177
  if (intr) {
@@ -14967,6 +15232,8 @@ var GameVehiclesFleet = (() => {
14967
15232
  rb: gh.rb,
14968
15233
  rt: gh.rt,
14969
15234
  roof: gh.roof + 0.02,
15235
+ roofRear: (gh.roofR || gh.roof) + 0.02,
15236
+ roofCrown: gh.crown || 0,
14970
15237
  belt: gh.belt,
14971
15238
  floor: s.bottomY + 0.02,
14972
15239
  seatH: 0.12,
@@ -15059,18 +15326,25 @@ var GameVehiclesFleet = (() => {
15059
15326
  K.plate(-1, s.plateR || (bR.y0 + bR.y1) / 2 + 0.03, { off: s.plateROnBumper === false ? 4e-3 : 0.018 });
15060
15327
  const tang = Math.atan(gh.Wg / 2 * gh.k / (T.top - T.belt));
15061
15328
  [1, -1].forEach(function(sd) {
15062
- ;
15063
- (s.blackPillars || []).forEach(function(px) {
15329
+ const bar = function(px, width) {
15064
15330
  const ry = roofAt(gh, px), yc = (gh.belt + ry) / 2 + 5e-3, hh = ry - gh.belt - 0.1;
15065
- 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;
15331
+ const m2 = c.roundBox(width, hh, 3e-3, 15e-4, GLOSS, px, yc, sd * (halfAt(gh.Wg, T, yc) + 4e-3), { rot: [-sd * tang, 0, 0] });
15332
+ m2.castShadow = false;
15333
+ return m2;
15334
+ };
15335
+ (s.blackPillars || []).forEach((px) => bar(px, 0.118));
15336
+ (glassDivisions.get(c) ?? []).forEach((px) => {
15337
+ bar(px, 2 * DIVISION_HALF - 2e-3).userData.doorChannel = true;
15066
15338
  });
15067
15339
  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;
15068
15340
  c.roundBox(0.16, 0.05, 0.08, 0.02, MT.trim, mx + 0.03, my - 0.04, sd * (mz0 + 0.03));
15069
15341
  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 } });
15070
15342
  c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
15071
15343
  if (s.mirrorBlink !== false) c.roundBox(0.02, 0.012, 0.12, 5e-3, MT.amber, mx + 0.03, my - 0.025, sd * (mz0 + 0.17));
15072
- (s.seams || []).forEach(function(x) {
15073
- c.roundBox(8e-3, gh.belt - by - 0.12, 6e-3, 3e-3, MT.dark, x, (gh.belt + by) / 2 + 0.03, sd * (hw + 1e-3));
15344
+ const edges = doorEdgesOf(gh, s.wheels ?? []);
15345
+ (s.seams || []).forEach(function(x0) {
15346
+ const x = seamOnDoorEdge(x0, edges);
15347
+ doorSeam(c, S, sd, x, by + 0.09, gh.belt - 0.03);
15074
15348
  });
15075
15349
  (s.handles || []).forEach(function(x) {
15076
15350
  c.roundBox(
@@ -15212,6 +15486,18 @@ var GameVehiclesFleet = (() => {
15212
15486
  c.cylinder(0.07, 0.055, 0.1, MT.steel, x, y, z, "x");
15213
15487
  c.cylinder(0.06, 0.06, 0.012, MT.head, x + 0.055, y, z, "x");
15214
15488
  }
15489
+ const SEAM_POINTS = 14;
15490
+ function doorSeam(c, S, sd, x, y0, y1) {
15491
+ const pts = [];
15492
+ for (let k = 0; k <= SEAM_POINTS; k++) {
15493
+ const y = y0 + (y1 - y0) * k / SEAM_POINTS, h = S.hit(new V3(x, y, sd * (S.hw + 1)), new V3(0, 0, -sd), "M");
15494
+ pts.push(h ? h.p.clone().addScaledVector(h.n, 1e-3) : new V3(x, y, sd * (S.hw + 1e-3)));
15495
+ }
15496
+ const t = c.tube(pts, 3e-3, MT.dark, { seg: SEAM_POINTS, rs: 4 });
15497
+ t.castShadow = false;
15498
+ t.userData.doorSeam = true;
15499
+ return t;
15500
+ }
15215
15501
  function sm(t) {
15216
15502
  t = clamp(t, 0, 1);
15217
15503
  return t * t * (3 - 2 * t);
@@ -18713,8 +18999,8 @@ var GameVehiclesFleet = (() => {
18713
18999
  return b;
18714
19000
  }
18715
19001
  function plateMoto(c, x, y, txt) {
18716
- c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x + 9e-3, y, 0);
18717
- c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x - 3e-3, y, 0, "-x", {
19002
+ c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x + 7e-3, y, 0);
19003
+ c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x - 5e-3, y, 0, "-x", {
18718
19004
  w: 300,
18719
19005
  h: 220,
18720
19006
  bg: "#f2f2ee",
@@ -18828,8 +19114,8 @@ var GameVehiclesFleet = (() => {
18828
19114
  d.position.z = s * hw * 0.72;
18829
19115
  g.add(d);
18830
19116
  for (let q = 0; q < 12; q++) {
18831
- 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 }));
18832
- sl.position.set(Math.cos(a2) * rimR * 0.62, Math.sin(a2) * rimR * 0.62, s * (hw * 0.72 + 0.0105));
19117
+ 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 }));
19118
+ sl.position.set(Math.cos(a2) * rimR * 0.62, Math.sin(a2) * rimR * 0.62, s * (hw * 0.72 + 0.013));
18833
19119
  sl.rotation.z = a2;
18834
19120
  g.add(sl);
18835
19121
  }
@@ -23803,7 +24089,8 @@ var GameVehiclesFleet = (() => {
23803
24089
  tailLightY: 2.06,
23804
24090
  noAntenna: true,
23805
24091
  hl: { style: "round", w: 0.2, h: 0.2, y: 2.03, in: 0.12, yaw: 0 },
23806
- grille: { style: "bars", w: 1, h: 0.3, y: 2 },
24092
+ /* 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) */
24093
+ grille: { style: "bars", w: 1, h: 0.3, y: 2, emblemBack: 9e-3 },
23807
24094
  tl: { style: "vertical", w: 0.12, h: 0.28, y: 2.06, in: 0 },
23808
24095
  interior: { rows: 1, col: "#202224", trim: "#141516", front: "bench" },
23809
24096
  hood: { motor: "v8" },