@adatechnology/game-vehicles-fleet 11.0.1 → 11.0.3

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.
@@ -5095,12 +5095,32 @@ var GameVehiclesFleet = (() => {
5095
5095
  }
5096
5096
 
5097
5097
  // ../game-vehicles/dist/index.js
5098
+ var SHUT_LINE_RADIUS = 2e-3;
5099
+ var SHUT_LINE_LIFT = 8e-4;
5100
+ var SHUT_LINE_STEPS = 36;
5101
+ var SHUT_LINE_STRAY = 0.04;
5102
+ function shutLinePoints(hit, x, y0, y1) {
5103
+ const out = [];
5104
+ for (let k = 0; k <= SHUT_LINE_STEPS; k++) {
5105
+ const h = hit(x, y0 + (y1 - y0) * k / SHUT_LINE_STEPS);
5106
+ if (h) out.push([h.p.x + h.n.x * SHUT_LINE_LIFT, h.p.y + h.n.y * SHUT_LINE_LIFT, h.p.z + h.n.z * SHUT_LINE_LIFT]);
5107
+ }
5108
+ if (out.length < 3) return out;
5109
+ const depths = out.map((q) => q[2]).sort((a, b) => a - b);
5110
+ const median = depths[Math.floor(depths.length / 2)];
5111
+ return out.filter((q) => Math.abs(q[2] - median) < SHUT_LINE_STRAY);
5112
+ }
5113
+ var FINISH_DETAIL = "finishDetail";
5114
+ function markFinishDetail(object) {
5115
+ object.userData[FINISH_DETAIL] = true;
5116
+ return object;
5117
+ }
5098
5118
  var DIVISION_HALF = 0.02;
5099
5119
  var GLASS_IN_FROM_EDGE = 0.03;
5100
5120
  var CUT_EPS = 1e-6;
5101
5121
  var PAST_EDGE_MIN = 0.01;
5102
- var PANE_MIN_AREA = 0.012;
5103
- var PANE_MIN_WIDTH = 0.15;
5122
+ var PANE_MIN_AREA = 8e-3;
5123
+ var PANE_MIN_WIDTH = 0.12;
5104
5124
  function carDoorEdges(fb, rb, pillars, xr, rr) {
5105
5125
  const doorF = fb - 0.03;
5106
5126
  const pil = pillars.slice().sort((a, b) => b - a);
@@ -5111,7 +5131,7 @@ var GameVehiclesFleet = (() => {
5111
5131
  const C = rearDoor ? Math.max(second !== void 0 && second < B - 0.4 ? second : rb, xr + rr * 0.2) : B;
5112
5132
  return { doorF, B, C, rearDoor };
5113
5133
  }
5114
- function doorGlassSplits(gh, wheels) {
5134
+ function doorEdgesOf(gh, wheels) {
5115
5135
  let xr = Infinity;
5116
5136
  let rr = 0.3;
5117
5137
  for (const w of wheels) {
@@ -5123,10 +5143,27 @@ var GameVehiclesFleet = (() => {
5123
5143
  }
5124
5144
  }
5125
5145
  if (!Number.isFinite(xr)) {
5126
- if (gh.pillars.length) return [];
5146
+ if (gh.pillars.length) return null;
5127
5147
  xr = -Infinity;
5128
5148
  }
5129
- const edges = carDoorEdges(gh.fb, gh.rb, gh.pillars, xr, rr);
5149
+ return carDoorEdges(gh.fb, gh.rb, gh.pillars, xr, rr);
5150
+ }
5151
+ var SEAM_SNAP = 0.1;
5152
+ var SEAM_INSIDE = 4e-3;
5153
+ function seamOnDoorEdge(x, edges) {
5154
+ if (!edges) return x;
5155
+ let best = x;
5156
+ let gap = SEAM_SNAP;
5157
+ const lines = [edges.doorF - SEAM_INSIDE, edges.B, edges.C === edges.B ? edges.C : edges.C + SEAM_INSIDE];
5158
+ for (let i = 0; i < lines.length; i++) {
5159
+ const d = Math.abs([edges.doorF, edges.B, edges.C][i] - x);
5160
+ if (d <= gap) [best, gap] = [lines[i], d];
5161
+ }
5162
+ return best;
5163
+ }
5164
+ function doorGlassSplits(gh, wheels) {
5165
+ const edges = doorEdgesOf(gh, wheels);
5166
+ if (!edges) return [];
5130
5167
  return [{ at: edges.C + GLASS_IN_FROM_EDGE - DIVISION_HALF, front: edges.rearDoor ? edges.B : edges.doorF }];
5131
5168
  }
5132
5169
  function clipPoly(poly, at, keep) {
@@ -5183,6 +5220,28 @@ var GameVehiclesFleet = (() => {
5183
5220
  }
5184
5221
  return { polys: out, used };
5185
5222
  }
5223
+ function crossingAt(polys, x) {
5224
+ let lo = Infinity;
5225
+ let hi = -Infinity;
5226
+ for (const poly of polys) {
5227
+ for (let i = 0; i < poly.length; i++) {
5228
+ const a = poly[i];
5229
+ const b = poly[(i + 1) % poly.length];
5230
+ if ((a[0] - x) * (b[0] - x) > 0 || a[0] === b[0]) continue;
5231
+ const y = a[1] + (x - a[0]) / (b[0] - a[0]) * (b[1] - a[1]);
5232
+ lo = Math.min(lo, y);
5233
+ hi = Math.max(hi, y);
5234
+ }
5235
+ }
5236
+ return hi >= lo ? [lo, hi] : null;
5237
+ }
5238
+ function divisionSpan(polys, at) {
5239
+ const rear = crossingAt(polys, at - DIVISION_HALF);
5240
+ const front = crossingAt(polys, at + DIVISION_HALF);
5241
+ if (!rear) return front;
5242
+ if (!front) return rear;
5243
+ return [Math.min(rear[0], front[0]), Math.max(rear[1], front[1])];
5244
+ }
5186
5245
  var SmokeCause = { STEAM: "steam", OIL: "oil", FIRE: "fire" };
5187
5246
  var SMOKE_LOOKS = {
5188
5247
  [SmokeCause.STEAM]: { color: 14870248, alpha: 0.18 },
@@ -5327,6 +5386,57 @@ var GameVehiclesFleet = (() => {
5327
5386
  return pane;
5328
5387
  }
5329
5388
 
5389
+ // src/vehicles/side-design.ts
5390
+ var CREASE_FOLD_LIFT = 7e-3;
5391
+ var CREASE_FOLD_AT = 0.4;
5392
+ function creaseHeightAt(pts, x) {
5393
+ const n = pts.length;
5394
+ const slope = (i) => (pts[i + 1][1] - pts[i][1]) / (pts[i + 1][0] - pts[i][0] || 1);
5395
+ const tangent = (i) => {
5396
+ if (i === 0) return slope(0);
5397
+ if (i === n - 1) return slope(n - 2);
5398
+ const a = slope(i - 1), b = slope(i);
5399
+ return a * b <= 0 ? 0 : 2 * a * b / (a + b);
5400
+ };
5401
+ for (let i = 0; i < n - 1; i++) {
5402
+ const a = pts[i], b = pts[i + 1];
5403
+ if ((x - a[0]) * (x - b[0]) > 0) continue;
5404
+ const w = b[0] - a[0] || 1, t = (x - a[0]) / w, t2 = t * t, t3 = t2 * t;
5405
+ return (2 * t3 - 3 * t2 + 1) * a[1] + (t3 - 2 * t2 + t) * w * tangent(i) + (-2 * t3 + 3 * t2) * b[1] + (t3 - t2) * w * tangent(i + 1);
5406
+ }
5407
+ return pts[n - 1][1];
5408
+ }
5409
+ var raised = /* @__PURE__ */ new WeakMap();
5410
+ function raisedOnSide(c) {
5411
+ let list = raised.get(c);
5412
+ if (!list) raised.set(c, list = []);
5413
+ return list;
5414
+ }
5415
+ function markRaised(c, mesh) {
5416
+ raisedOnSide(c).push(mesh);
5417
+ }
5418
+ function bodySide(THREE, c, S, sd) {
5419
+ const ray = new THREE.Raycaster();
5420
+ const world = c.vehicle.matrixWorld;
5421
+ const toVehicle = world.clone().invert();
5422
+ return function(x, y) {
5423
+ const origin = new THREE.Vector3(x, y, sd * (S.hw + 1));
5424
+ const best = S.hit(origin, new THREE.Vector3(0, 0, -sd), "M");
5425
+ ray.set(origin.clone().applyMatrix4(world), new THREE.Vector3(0, 0, -sd).transformDirection(world));
5426
+ raisedOnSide(c).forEach(function(m) {
5427
+ const h = ray.intersectObject(m, false)[0];
5428
+ if (!h || !h.face) return;
5429
+ const p = h.point.clone().applyMatrix4(toVehicle);
5430
+ if (!best || Math.abs(p.z) <= Math.abs(best.p.z)) return;
5431
+ const n = h.face.normal.clone().transformDirection(m.matrixWorld).transformDirection(toVehicle);
5432
+ if (n.z * sd < 0) n.negate();
5433
+ best.p = p;
5434
+ best.n = n;
5435
+ });
5436
+ return best;
5437
+ };
5438
+ }
5439
+
5330
5440
  // src/vehicles/cars-extra.ts
5331
5441
  function installCarsExtra(fx) {
5332
5442
  const kit = fx.kit;
@@ -5666,7 +5776,8 @@ var GameVehiclesFleet = (() => {
5666
5776
  const u = u0 + (u1 - u0) * i / nu, b = yb(u), t = yt(u), row = [];
5667
5777
  for (let j = 0; j <= nv; j++) {
5668
5778
  const y = b + (t - b) * j / nv, s = G2.at(u, y);
5669
- row.push({ p: s.p.addScaledVector(s.n, of), n: s.n, uv: [i / nu * su, o.tile ? (y - G2.y0) * sv0 : j / nv] });
5779
+ const lift = o.ridge ? o.ridge.lift * (j / nv < o.ridge.at ? j / nv / o.ridge.at : (1 - j / nv) / (1 - o.ridge.at)) : 0;
5780
+ row.push({ p: s.p.addScaledVector(s.n, of + lift), n: s.n, uv: [i / nu * su, o.tile ? (y - G2.y0) * sv0 : j / nv] });
5670
5781
  }
5671
5782
  Q.push(row);
5672
5783
  }
@@ -5972,8 +6083,9 @@ var GameVehiclesFleet = (() => {
5972
6083
  const h = q.top ? S.hit(new V3(q.x, 3, q.z), new V3(0, -1, 0), "R") : S.hit(new V3(S.endX(-1, q.y) - 1, q.y, q.z), new V3(1, 0, 0), "R");
5973
6084
  return h ? h.p.addScaledVector(h.n, 3e-3) : null;
5974
6085
  }).filter(Boolean);
5975
- const t = c.tube(P, 38e-4, MT.dark, { seg: P.length * 8, rs: 4 });
6086
+ const t = c.tube(P, GAP_R, I.gap ?? MT.dark, { seg: P.length * 8, rs: 4 });
5976
6087
  t.castShadow = false;
6088
+ t.userData.gap = true;
5977
6089
  c.deform.push(t);
5978
6090
  return t;
5979
6091
  };
@@ -5999,6 +6111,8 @@ var GameVehiclesFleet = (() => {
5999
6111
  };
6000
6112
  return K;
6001
6113
  }
6114
+ const DIVISION_OVER = 0.012;
6115
+ const COWL_DROP = 0.012;
6002
6116
  const glassDivisions = /* @__PURE__ */ new WeakMap();
6003
6117
  function car(c, s) {
6004
6118
  const W = s.W, gh = s.gh, bev = 0.05, T = { belt: gh.belt, top: gh.roof + bev, k: gh.k }, m = c.meta;
@@ -6036,7 +6150,10 @@ var GameVehiclesFleet = (() => {
6036
6150
  if (gh.polys) polys = gh.polys(polys);
6037
6151
  const divided = splitSidePolys(polys, doorGlassSplits(gh, s.wheels ?? []));
6038
6152
  polys = divided.polys;
6039
- glassDivisions.set(c, divided.used);
6153
+ glassDivisions.set(
6154
+ c,
6155
+ divided.used.map((at) => ({ at, span: divisionSpan(divided.polys, at) }))
6156
+ );
6040
6157
  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 });
6041
6158
  const gHoles = [];
6042
6159
  if (intr) {
@@ -6057,6 +6174,7 @@ var GameVehiclesFleet = (() => {
6057
6174
  side: THREE.DoubleSide
6058
6175
  }) : null;
6059
6176
  kit.shell(c, { items: ghItems, W: gh.Wg, col: s.col, mat: roofMat, T, holes: gHoles, sub: intr ? 0.12 : 0.2 });
6177
+ const sealEdges = doorEdgesOf(gh, s.wheels ?? []);
6060
6178
  kit.sideWindows(
6061
6179
  c,
6062
6180
  polys,
@@ -6065,7 +6183,14 @@ var GameVehiclesFleet = (() => {
6065
6183
  function(i, n) {
6066
6184
  return i === 0 && n > 2 ? lbl("quarter_glass") : i === n - 1 ? lbl("window_front") : lbl("window_rear");
6067
6185
  },
6068
- { see: !!intr }
6186
+ {
6187
+ see: !!intr,
6188
+ // a fixed pane sits in a thin rubber flush with the body; the window of a door runs in a channel round its frame
6189
+ seal: function(i) {
6190
+ const xs = polys[i].map((q) => q[0]), mid = (Math.min(...xs) + Math.max(...xs)) / 2;
6191
+ return sealEdges && mid > sealEdges.C && mid < sealEdges.doorF ? DOOR_SEAL_R : FIXED_SEAL_R;
6192
+ }
6193
+ }
6069
6194
  );
6070
6195
  kit.glassQuad(c, qf, lbl("windshield"), { see: !!intr });
6071
6196
  kit.glassQuad(c, qr, lbl("rear_window"), { see: !!intr, mat: intr ? MT.tint : MT.glassDark });
@@ -6102,6 +6227,8 @@ var GameVehiclesFleet = (() => {
6102
6227
  rb: gh.rb,
6103
6228
  rt: gh.rt,
6104
6229
  roof: gh.roof + 0.02,
6230
+ roofRear: (gh.roofR || gh.roof) + 0.02,
6231
+ roofCrown: gh.crown || 0,
6105
6232
  belt: gh.belt,
6106
6233
  floor: s.bottomY + 0.02,
6107
6234
  seatH: 0.12,
@@ -6122,7 +6249,7 @@ var GameVehiclesFleet = (() => {
6122
6249
  (s.arches || []).forEach(function(a) {
6123
6250
  fa = Math.max(fa, a[0]);
6124
6251
  });
6125
- const hood = kit.makeHood(c, lowMesh.userData.cut.hood, { x0: hx0, col: s.col });
6252
+ const hood = kit.makeHood(c, lowMesh.userData.cut.hood, { x0: hx0, col: s.col, gap: HOOD_GAP });
6126
6253
  if (hood)
6127
6254
  kit.engineBay(c, {
6128
6255
  x0: hx0 + 0.02,
@@ -6156,6 +6283,7 @@ var GameVehiclesFleet = (() => {
6156
6283
  );
6157
6284
  const Wf = mkWarp(wo);
6158
6285
  const S = mkSurf(lowMesh, W);
6286
+ if (c.hood && hoodO) hoodGap(c, S, hx0, hx1, zH, gapMaterial(s.col));
6159
6287
  details(c, s, Wf, S);
6160
6288
  applyWarp(c, Wf);
6161
6289
  return m;
@@ -6167,7 +6295,7 @@ var GameVehiclesFleet = (() => {
6167
6295
  }, rx = function(y) {
6168
6296
  return profX(it, y, false);
6169
6297
  };
6170
- const I = { fx: fx2, rx, W, hw, by, gh, T, Wf, S };
6298
+ const I = { fx: fx2, rx, W, hw, by, gh, T, Wf, S, gap: gapMaterial(s.col) };
6171
6299
  I.fxB = S.endX(1, by + 0.2);
6172
6300
  I.rxB = S.endX(-1, by + 0.2);
6173
6301
  const K = mkKit(c, S, I);
@@ -6196,21 +6324,22 @@ var GameVehiclesFleet = (() => {
6196
6324
  K.plate(-1, s.plateR || (bR.y0 + bR.y1) / 2 + 0.03, { off: s.plateROnBumper === false ? 4e-3 : 0.018 });
6197
6325
  const tang = Math.atan(gh.Wg / 2 * gh.k / (T.top - T.belt));
6198
6326
  [1, -1].forEach(function(sd) {
6199
- const bar = function(px, width) {
6200
- const ry = roofAt(gh, px), yc = (gh.belt + ry) / 2 + 5e-3, hh = ry - gh.belt - 0.1;
6201
- 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;
6327
+ const bar = function(px, width, span) {
6328
+ const ry = roofAt(gh, px), yc = span ? (span[0] + span[1]) / 2 : (gh.belt + ry) / 2 + 5e-3, hh = span ? span[1] - span[0] + 2 * DIVISION_OVER : ry - gh.belt - 0.1;
6329
+ 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] });
6330
+ m2.castShadow = false;
6331
+ return m2;
6202
6332
  };
6203
6333
  (s.blackPillars || []).forEach((px) => bar(px, 0.118));
6204
- (glassDivisions.get(c) ?? []).forEach((px) => bar(px, 2 * DIVISION_HALF - 2e-3));
6334
+ (glassDivisions.get(c) ?? []).forEach(({ at, span }) => {
6335
+ bar(at, 2 * DIVISION_HALF - 2e-3, span).userData.doorChannel = true;
6336
+ });
6205
6337
  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;
6206
6338
  c.roundBox(0.16, 0.05, 0.08, 0.02, MT.trim, mx + 0.03, my - 0.04, sd * (mz0 + 0.03));
6207
6339
  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 } });
6208
6340
  c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
6209
6341
  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));
6210
- (s.seams || []).forEach(function(q) {
6211
- 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;
6212
- c.roundBox(8e-3, y1 - y0, 6e-3, 3e-3, MT.dark, x, (y0 + y1) / 2, sd * (hw + 1e-3));
6213
- });
6342
+ if (s.fuelDoor && sd === s.fuelDoor[2]) fuelDoorGap(c, S, sd, s.fuelDoor[0], s.fuelDoor[1], I.gap);
6214
6343
  (s.handles || []).forEach(function(x) {
6215
6344
  c.roundBox(
6216
6345
  0.15,
@@ -6225,7 +6354,8 @@ var GameVehiclesFleet = (() => {
6225
6354
  });
6226
6355
  if (s.arches && s.arches.length > 1) {
6227
6356
  const x0 = s.arches[1][0] + s.arches[1][2] + 0.02, x1 = s.arches[0][0] - s.arches[0][2] - 0.02;
6228
- c.roundBox(x1 - x0, 0.08, 0.035, 0.015, MT.trim, (x0 + x1) / 2, by + 0.05, sd * (hw - 8e-3));
6357
+ const mouldingG = sideGrid(S, sd, { x0, x1, y0: by + 5e-3, y1: by + 0.12 });
6358
+ markRaised(c, K.skin(mouldingG, MT.trim, { yb: by + 0.01, yt: by + 0.09, off: 0.012, thick: 0.03, nv: 2, crease: 30, shadow: true }));
6229
6359
  if (s.clad)
6230
6360
  s.arches.forEach(function(a) {
6231
6361
  const a0 = Math.asin(clamp((by - a[1]) / a[2], -1, 1)), tor = c.add(new THREE.TorusGeometry(a[2] + 0.02, 0.035, 6, 26, PI - 2 * a0), MT.trim, a[0], a[1], sd * (hw - 0.01));
@@ -6237,16 +6367,25 @@ var GameVehiclesFleet = (() => {
6237
6367
  c.roundBox(
6238
6368
  gh.fb - gh.rb - 0.3,
6239
6369
  0.012,
6240
- 8e-3,
6370
+ 0.012,
6241
6371
  4e-3,
6242
6372
  MT.chrome,
6243
6373
  (gh.fb + gh.rb) / 2 - 0.05,
6244
6374
  gh.belt + 0.035,
6245
- sd * (halfAt(gh.Wg, T, gh.belt + 0.035) + 4e-3)
6375
+ sd * (halfAt(gh.Wg, T, gh.belt + 0.035) + 6e-3)
6246
6376
  );
6247
6377
  });
6248
6378
  const cwh = S.hit(new V3(gh.fb + 0.03, 3, 0), new V3(0, -1, 0)), cwy = cwh ? cwh.p.y : gh.belt;
6249
- c.roundBox(0.15, 0.02, gh.Wg - 0.06, 8e-3, PLASTIC, gh.fb + 0.02, cwy + 4e-3, 0).castShadow = false;
6379
+ let cwz = gh.Wg / 2 - 0.03;
6380
+ for (let z = 0.3; z < cwz; z += 0.01) {
6381
+ const h = S.hit(new V3(gh.fb + 0.03, 3, z), new V3(0, -1, 0));
6382
+ if (!h || h.p.y < cwy - COWL_DROP) {
6383
+ cwz = z;
6384
+ break;
6385
+ }
6386
+ }
6387
+ cwz = Math.min(cwz, halfAt(gh.Wg, T, gh.belt + 0.05) - 0.072);
6388
+ c.roundBox(0.15, 0.02, 2 * cwz, 8e-3, PLASTIC, gh.fb + 0.02, cwy + 4e-3, 0).castShadow = false;
6250
6389
  const wd = new V3(gh.ft - gh.fb, gh.roof - gh.belt, 0).normalize(), wn = new V3(wd.y, -wd.x, 0);
6251
6390
  const fr = new V3(gh.fb, gh.belt, 0).addScaledVector(wd, 0.065).addScaledVector(wn, 0.047), frw = 2 * (halfAt(gh.Wg, T, gh.belt + 0.05) - 0.07);
6252
6391
  c.roundBox(0.14, 6e-3, frw, 3e-3, PLASTIC, fr.x, fr.y, 0, { rot: [0, 0, Math.atan2(wd.y, wd.x)] }).castShadow = false;
@@ -6291,6 +6430,21 @@ var GameVehiclesFleet = (() => {
6291
6430
  });
6292
6431
  underbody(c, s, I);
6293
6432
  if (s.extra) s.extra(c, I);
6433
+ c.vehicle.updateMatrixWorld(true);
6434
+ [1, -1].forEach(function(sd) {
6435
+ const side = bodySide(THREE, c, S, sd);
6436
+ const edges = doorEdgesOf(gh, s.wheels ?? []);
6437
+ (s.seams || []).forEach(function(q) {
6438
+ const r = q, x = seamOnDoorEdge(r.length ? r[0] : q, edges), y0 = r.length ? r[1] : by + 0.11, y1 = r.length ? r[2] : gh.belt - 0.03;
6439
+ const pts = shutLinePoints(side, x, y0, y1);
6440
+ if (pts.length < 3) return;
6441
+ const seam = markFinishDetail(c.tube(pts, SHUT_LINE_RADIUS, I.gap ?? MT.dark, { seg: 72, rs: 5 }));
6442
+ seam.castShadow = false;
6443
+ seam.userData.doorSeam = true;
6444
+ seam.userData.gap = true;
6445
+ c.deform.push(seam);
6446
+ });
6447
+ });
6294
6448
  if (!c.parts.some(function(p) {
6295
6449
  return p.kind === "engine";
6296
6450
  }))
@@ -6364,6 +6518,59 @@ var GameVehiclesFleet = (() => {
6364
6518
  c.cylinder(0.07, 0.055, 0.1, MT.steel, x, y, z, "x");
6365
6519
  c.cylinder(0.06, 0.06, 0.012, MT.head, x + 0.055, y, z, "x");
6366
6520
  }
6521
+ const GAP_R = 2e-3;
6522
+ const FIXED_SEAL_R = 4e-3;
6523
+ const DOOR_SEAL_R = 6e-3;
6524
+ const GAP_SHADE = 0.45;
6525
+ const gapMaterials = /* @__PURE__ */ new Map();
6526
+ function gapMaterial(col) {
6527
+ const hex = "#" + new THREE.Color(col).multiplyScalar(GAP_SHADE).getHexString();
6528
+ const known = gapMaterials.get(hex);
6529
+ if (known) return known;
6530
+ const made = CM(hex, { roughness: 0.6 }) ?? MT.dark;
6531
+ gapMaterials.set(hex, made);
6532
+ return made;
6533
+ }
6534
+ const HOOD_GAP = 4 * GAP_R;
6535
+ function hoodGap(c, S, x0, x1, zH, mat) {
6536
+ const onTop = (x, z) => {
6537
+ const h = S.hit(new V3(x, 3, z), new V3(0, -1, 0));
6538
+ return h ? h.p.clone().addScaledVector(h.n, 1e-3) : new V3(x, 0, z);
6539
+ };
6540
+ const steps = Math.max(4, Math.ceil((x1 - x0) / 0.04));
6541
+ const across = Math.max(4, Math.ceil(2 * zH / 0.04));
6542
+ const line = [];
6543
+ for (let k = 0; k <= steps; k++) line.push(onTop(x0 + (x1 - x0) * k / steps, zH));
6544
+ for (let k = 1; k < across; k++) line.push(onTop(x1, zH - 2 * zH * k / across));
6545
+ for (let k = steps; k >= 0; k--) line.push(onTop(x0 + (x1 - x0) * k / steps, -zH));
6546
+ const t = c.tube(line, GAP_R, mat, { seg: line.length * 2, rs: 4 });
6547
+ t.castShadow = false;
6548
+ t.userData.gap = true;
6549
+ return t;
6550
+ }
6551
+ const FUEL_DOOR_W = 0.13;
6552
+ const FUEL_DOOR_H = 0.11;
6553
+ const FUEL_DOOR_R = 0.02;
6554
+ function fuelDoorGap(c, S, sd, x, y, mat) {
6555
+ const pts = [];
6556
+ const hx = FUEL_DOOR_W / 2 - FUEL_DOOR_R, hy = FUEL_DOOR_H / 2 - FUEL_DOOR_R;
6557
+ const corners = [
6558
+ [hx, hy, 0],
6559
+ [-hx, hy, 0.5 * PI],
6560
+ [-hx, -hy, PI],
6561
+ [hx, -hy, 1.5 * PI]
6562
+ ];
6563
+ corners.forEach(function([cx, cy, a0]) {
6564
+ for (let k = 0; k <= 4; k++) {
6565
+ const a = a0 + k / 4 * 0.5 * PI, px = x + cx + FUEL_DOOR_R * Math.cos(a), py = y + cy + FUEL_DOOR_R * Math.sin(a), h = S.hit(new V3(px, py, sd * (S.hw + 1)), new V3(0, 0, -sd), "M");
6566
+ pts.push(h ? h.p.clone().addScaledVector(h.n, 1e-3) : new V3(px, py, sd * S.hw));
6567
+ }
6568
+ });
6569
+ const t = c.tube(pts, GAP_R, mat, { closed: true, seg: pts.length * 2, rs: 4 });
6570
+ t.castShadow = false;
6571
+ t.userData.gap = true;
6572
+ return t;
6573
+ }
6367
6574
  function sm(t) {
6368
6575
  t = clamp(t, 0, 1);
6369
6576
  return t * t * (3 - 2 * t);
@@ -6410,36 +6617,23 @@ var GameVehiclesFleet = (() => {
6410
6617
  });
6411
6618
  const h = o.h || 0.03, Gd = sideGrid(I.S, sd, { x0, x1, y0: lo - h - 0.03, y1: hi + 0.03 });
6412
6619
  function yAt(u) {
6413
- const x = x0 + (x1 - x0) * u;
6414
- for (let i = 0; i < pts.length - 1; i++) {
6415
- const a = pts[i], b = pts[i + 1];
6416
- if ((x - a[0]) * (x - b[0]) <= 0) {
6417
- const t = (x - a[0]) / (b[0] - a[0] || 1);
6418
- return a[1] + (b[1] - a[1]) * sm(t);
6419
- }
6420
- }
6421
- return pts[pts.length - 1][1];
6620
+ return creaseHeightAt(pts, x0 + (x1 - x0) * u);
6422
6621
  }
6423
- I.K.skin(Gd, o.mat || c.paint(o.col), {
6622
+ const fold = I.K.skin(Gd, o.mat || c.paint(o.col), {
6424
6623
  yb: function(u) {
6425
6624
  return yAt(u) - h;
6426
6625
  },
6427
6626
  yt: yAt,
6428
- off: o.off || 6e-3,
6429
- thick: 9e-3,
6430
- nv: 2,
6627
+ off: o.off || 2e-3,
6628
+ ridge: { at: CREASE_FOLD_AT, lift: CREASE_FOLD_LIFT },
6629
+ crease: 30,
6630
+ nv: 5,
6431
6631
  u0: o.u0 || 0.01,
6432
6632
  u1: o.u1 || 0.99
6433
6633
  });
6434
- const l = [];
6435
- for (let k = 0; k <= 30; k++) {
6436
- const u = (o.u0 || 0.01) + k / 30 * ((o.u1 || 0.99) - (o.u0 || 0.01));
6437
- l.push([u, yAt(u) - h - 1e-3]);
6438
- }
6439
- lineOn(c, Gd, l, 3e-3, o.shade || SHADE, 3e-3);
6634
+ markRaised(c, markFinishDetail(fold));
6440
6635
  return Gd;
6441
6636
  }
6442
- const SHADE = CM("#000000", { roughness: 1, transparent: true, opacity: 0.45, depthWrite: false });
6443
6637
  const CHROMEH = CM("#c9cdd0", { metalness: 0.85, roughness: 0.25 });
6444
6638
  const CHROMEB = CM("#d4d8db", { metalness: 0.5, roughness: 0.24 });
6445
6639
  const VINYL = "#2e2622";
@@ -6774,6 +6968,8 @@ var GameVehiclesFleet = (() => {
6774
6968
  dropRear: true,
6775
6969
  seams: [0.64, -0.5, [-1.27, 0.67, 0.93]],
6776
6970
  handles: [0.12, -0.86],
6971
+ /* fuel door on the right rear fender, between the rear door and the taillight, over the wheel */
6972
+ fuelDoor: [-1.47, 0.71, 1],
6777
6973
  blackPillars: [-0.5],
6778
6974
  frontBumper: { y1: 0.6 },
6779
6975
  rearBumper: { y1: 0.58 },
@@ -6951,7 +7147,8 @@ var GameVehiclesFleet = (() => {
6951
7147
  [1.75, 0.8],
6952
7148
  [0.6, 0.82],
6953
7149
  [-0.6, 0.835],
6954
- [-1.82, 0.85]
7150
+ // it ends where the taillight wraps onto the side, never running into the lamp
7151
+ [-1.6, 0.845]
6955
7152
  ],
6956
7153
  { col: hex, h: 0.024 }
6957
7154
  );
@@ -14778,7 +14975,8 @@ var GameVehiclesFleet = (() => {
14778
14975
  const u = u0 + (u1 - u0) * i / nu, b = yb(u), t = yt(u), row = [];
14779
14976
  for (let j = 0; j <= nv; j++) {
14780
14977
  const y = b + (t - b) * j / nv, s = G2.at(u, y);
14781
- row.push({ p: s.p.addScaledVector(s.n, of), n: s.n, uv: [i / nu * su, o.tile ? (y - G2.y0) * sv0 : j / nv] });
14978
+ const lift = o.ridge ? o.ridge.lift * (j / nv < o.ridge.at ? j / nv / o.ridge.at : (1 - j / nv) / (1 - o.ridge.at)) : 0;
14979
+ row.push({ p: s.p.addScaledVector(s.n, of + lift), n: s.n, uv: [i / nu * su, o.tile ? (y - G2.y0) * sv0 : j / nv] });
14782
14980
  }
14783
14981
  Q.push(row);
14784
14982
  }
@@ -15071,8 +15269,9 @@ var GameVehiclesFleet = (() => {
15071
15269
  const h = q.top ? S.hit(new V3(q.x, 3, q.z), new V3(0, -1, 0), "R") : S.hit(new V3(S.endX(-1, q.y) - 1, q.y, q.z), new V3(1, 0, 0), "R");
15072
15270
  return h ? h.p.addScaledVector(h.n, 3e-3) : null;
15073
15271
  }).filter(Boolean);
15074
- const t = c.tube(P, 38e-4, MT.dark, { seg: P.length * 8, rs: 4 });
15272
+ const t = c.tube(P, GAP_R, I.gap ?? MT.dark, { seg: P.length * 8, rs: 4 });
15075
15273
  t.castShadow = false;
15274
+ t.userData.gap = true;
15076
15275
  c.deform.push(t);
15077
15276
  return t;
15078
15277
  };
@@ -15098,6 +15297,7 @@ var GameVehiclesFleet = (() => {
15098
15297
  };
15099
15298
  return K;
15100
15299
  }
15300
+ const DIVISION_OVER = 0.012;
15101
15301
  const glassDivisions = /* @__PURE__ */ new WeakMap();
15102
15302
  function car(c, s) {
15103
15303
  const W = s.W, gh = s.gh, bev = 0.05, T = { belt: gh.belt, top: gh.roof + bev, k: gh.k }, m = c.meta;
@@ -15134,7 +15334,10 @@ var GameVehiclesFleet = (() => {
15134
15334
  if (s.dropRear) polys = polys.slice(1);
15135
15335
  const divided = splitSidePolys(polys, doorGlassSplits(gh, s.wheels ?? []));
15136
15336
  polys = divided.polys;
15137
- glassDivisions.set(c, divided.used);
15337
+ glassDivisions.set(
15338
+ c,
15339
+ divided.used.map((at) => ({ at, span: divisionSpan(divided.polys, at) }))
15340
+ );
15138
15341
  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);
15139
15342
  const gHoles = [];
15140
15343
  if (intr) {
@@ -15155,6 +15358,7 @@ var GameVehiclesFleet = (() => {
15155
15358
  side: THREE.DoubleSide
15156
15359
  }) : null;
15157
15360
  kit.shell(c, { items: ghItems, W: gh.Wg, col: s.col, mat: roofMat, T, holes: gHoles, sub: intr ? 0.12 : 0.2 });
15361
+ const sealEdges = doorEdgesOf(gh, s.wheels ?? []);
15158
15362
  kit.sideWindows(
15159
15363
  c,
15160
15364
  polys,
@@ -15163,7 +15367,14 @@ var GameVehiclesFleet = (() => {
15163
15367
  function(i, n) {
15164
15368
  return i === 0 && n > 2 ? lbl("quarter_glass") : i === n - 1 ? lbl("window_front") : lbl("window_rear");
15165
15369
  },
15166
- { see: !!intr }
15370
+ {
15371
+ see: !!intr,
15372
+ // a fixed pane sits in a thin rubber flush with the body; the window of a door runs in a channel round its frame
15373
+ seal: function(i) {
15374
+ const xs = polys[i].map((q) => q[0]), mid = (Math.min(...xs) + Math.max(...xs)) / 2;
15375
+ return sealEdges && mid > sealEdges.C && mid < sealEdges.doorF ? DOOR_SEAL_R : FIXED_SEAL_R;
15376
+ }
15377
+ }
15167
15378
  );
15168
15379
  kit.glassQuad(c, qf, lbl("windshield"), { see: !!intr });
15169
15380
  kit.glassQuad(c, qr, lbl("rear_window"), { see: !!intr, mat: intr ? REARTINT : MT.glassDark });
@@ -15195,6 +15406,8 @@ var GameVehiclesFleet = (() => {
15195
15406
  rb: gh.rb,
15196
15407
  rt: gh.rt,
15197
15408
  roof: gh.roof + 0.02,
15409
+ roofRear: (gh.roofR || gh.roof) + 0.02,
15410
+ roofCrown: gh.crown || 0,
15198
15411
  belt: gh.belt,
15199
15412
  floor: s.bottomY + 0.02,
15200
15413
  seatH: 0.12,
@@ -15213,7 +15426,7 @@ var GameVehiclesFleet = (() => {
15213
15426
  (s.arches || []).forEach(function(a) {
15214
15427
  fa = Math.max(fa, a[0]);
15215
15428
  });
15216
- const hood = kit.makeHood(c, lowMesh.userData.cut.hood, { x0: hx0, col: s.col });
15429
+ const hood = kit.makeHood(c, lowMesh.userData.cut.hood, { x0: hx0, col: s.col, gap: HOOD_GAP });
15217
15430
  if (hood)
15218
15431
  kit.engineBay(c, {
15219
15432
  x0: hx0 + 0.02,
@@ -15247,6 +15460,7 @@ var GameVehiclesFleet = (() => {
15247
15460
  );
15248
15461
  const Wf = mkWarp(wo);
15249
15462
  const S = mkSurf(lowMesh, W);
15463
+ if (c.hood && hoodO) hoodGap(c, S, hx0, hx1, zH, gapMaterial(s.col));
15250
15464
  details(c, s, Wf, S);
15251
15465
  applyWarp(c, Wf);
15252
15466
  return m;
@@ -15258,7 +15472,7 @@ var GameVehiclesFleet = (() => {
15258
15472
  }, rx = function(y) {
15259
15473
  return profX(it, y, false);
15260
15474
  };
15261
- const I = { fx: fx2, rx, W, hw, by, gh, T, Wf, S };
15475
+ const I = { fx: fx2, rx, W, hw, by, gh, T, Wf, S, gap: gapMaterial(s.col) };
15262
15476
  I.fxB = S.endX(1, by + 0.2);
15263
15477
  I.rxB = S.endX(-1, by + 0.2);
15264
15478
  const K = mkKit(c, S, I);
@@ -15287,20 +15501,22 @@ var GameVehiclesFleet = (() => {
15287
15501
  K.plate(-1, s.plateR || (bR.y0 + bR.y1) / 2 + 0.03, { off: s.plateROnBumper === false ? 4e-3 : 0.018 });
15288
15502
  const tang = Math.atan(gh.Wg / 2 * gh.k / (T.top - T.belt));
15289
15503
  [1, -1].forEach(function(sd) {
15290
- const bar = function(px, width) {
15291
- const ry = roofAt(gh, px), yc = (gh.belt + ry) / 2 + 5e-3, hh = ry - gh.belt - 0.1;
15292
- 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;
15504
+ const bar = function(px, width, span) {
15505
+ const ry = roofAt(gh, px), yc = span ? (span[0] + span[1]) / 2 : (gh.belt + ry) / 2 + 5e-3, hh = span ? span[1] - span[0] + 2 * DIVISION_OVER : ry - gh.belt - 0.1;
15506
+ 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] });
15507
+ m2.castShadow = false;
15508
+ return m2;
15293
15509
  };
15294
15510
  (s.blackPillars || []).forEach((px) => bar(px, 0.118));
15295
- (glassDivisions.get(c) ?? []).forEach((px) => bar(px, 2 * DIVISION_HALF - 2e-3));
15511
+ (glassDivisions.get(c) ?? []).forEach(({ at, span }) => {
15512
+ bar(at, 2 * DIVISION_HALF - 2e-3, span).userData.doorChannel = true;
15513
+ });
15296
15514
  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;
15297
15515
  c.roundBox(0.16, 0.05, 0.08, 0.02, MT.trim, mx + 0.03, my - 0.04, sd * (mz0 + 0.03));
15298
15516
  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 } });
15299
15517
  c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
15300
15518
  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));
15301
- (s.seams || []).forEach(function(x) {
15302
- 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));
15303
- });
15519
+ if (s.fuelDoor && sd === s.fuelDoor[2]) fuelDoorGap(c, S, sd, s.fuelDoor[0], s.fuelDoor[1], I.gap);
15304
15520
  (s.handles || []).forEach(function(x) {
15305
15521
  c.roundBox(
15306
15522
  0.15,
@@ -15315,7 +15531,8 @@ var GameVehiclesFleet = (() => {
15315
15531
  });
15316
15532
  if (s.arches && s.arches.length > 1) {
15317
15533
  const x0 = s.arches[1][0] + s.arches[1][2] + 0.02, x1 = s.arches[0][0] - s.arches[0][2] - 0.02;
15318
- c.roundBox(x1 - x0, 0.08, 0.035, 0.015, MT.trim, (x0 + x1) / 2, by + 0.05, sd * (hw - 8e-3));
15534
+ const mouldingG = sideGrid(S, sd, { x0, x1, y0: by + 5e-3, y1: by + 0.12 });
15535
+ markRaised(c, K.skin(mouldingG, MT.trim, { yb: by + 0.01, yt: by + 0.09, off: 0.012, thick: 0.03, nv: 2, crease: 30, shadow: true }));
15319
15536
  if (s.clad)
15320
15537
  s.arches.forEach(function(a) {
15321
15538
  const a0 = Math.asin(clamp((by - a[1]) / a[2], -1, 1)), tor = c.add(new THREE.TorusGeometry(a[2] + 0.02, 0.035, 6, 26, PI - 2 * a0), MT.trim, a[0], a[1], sd * (hw - 0.01));
@@ -15368,6 +15585,20 @@ var GameVehiclesFleet = (() => {
15368
15585
  });
15369
15586
  underbody(c, s, I);
15370
15587
  if (s.extra) s.extra(c, I);
15588
+ c.vehicle.updateMatrixWorld(true);
15589
+ [1, -1].forEach(function(sd) {
15590
+ const side = bodySide(THREE, c, S, sd);
15591
+ const edges = doorEdgesOf(gh, s.wheels ?? []);
15592
+ (s.seams || []).forEach(function(x) {
15593
+ const pts = shutLinePoints(side, seamOnDoorEdge(x, edges), by + 0.11, gh.belt - 0.03);
15594
+ if (pts.length < 3) return;
15595
+ const seam = markFinishDetail(c.tube(pts, SHUT_LINE_RADIUS, I.gap ?? MT.dark, { seg: 72, rs: 5 }));
15596
+ seam.castShadow = false;
15597
+ seam.userData.doorSeam = true;
15598
+ seam.userData.gap = true;
15599
+ c.deform.push(seam);
15600
+ });
15601
+ });
15371
15602
  if (!c.parts.some(function(p) {
15372
15603
  return p.kind === "engine";
15373
15604
  }))
@@ -15441,6 +15672,59 @@ var GameVehiclesFleet = (() => {
15441
15672
  c.cylinder(0.07, 0.055, 0.1, MT.steel, x, y, z, "x");
15442
15673
  c.cylinder(0.06, 0.06, 0.012, MT.head, x + 0.055, y, z, "x");
15443
15674
  }
15675
+ const GAP_R = 2e-3;
15676
+ const FIXED_SEAL_R = 4e-3;
15677
+ const DOOR_SEAL_R = 6e-3;
15678
+ const GAP_SHADE = 0.45;
15679
+ const gapMaterials = /* @__PURE__ */ new Map();
15680
+ function gapMaterial(col) {
15681
+ const hex = "#" + new THREE.Color(col).multiplyScalar(GAP_SHADE).getHexString();
15682
+ const known = gapMaterials.get(hex);
15683
+ if (known) return known;
15684
+ const made = CM(hex, { roughness: 0.6 }) ?? MT.dark;
15685
+ gapMaterials.set(hex, made);
15686
+ return made;
15687
+ }
15688
+ const HOOD_GAP = 4 * GAP_R;
15689
+ function hoodGap(c, S, x0, x1, zH, mat) {
15690
+ const onTop = (x, z) => {
15691
+ const h = S.hit(new V3(x, 3, z), new V3(0, -1, 0));
15692
+ return h ? h.p.clone().addScaledVector(h.n, 1e-3) : new V3(x, 0, z);
15693
+ };
15694
+ const steps = Math.max(4, Math.ceil((x1 - x0) / 0.04));
15695
+ const across = Math.max(4, Math.ceil(2 * zH / 0.04));
15696
+ const line = [];
15697
+ for (let k = 0; k <= steps; k++) line.push(onTop(x0 + (x1 - x0) * k / steps, zH));
15698
+ for (let k = 1; k < across; k++) line.push(onTop(x1, zH - 2 * zH * k / across));
15699
+ for (let k = steps; k >= 0; k--) line.push(onTop(x0 + (x1 - x0) * k / steps, -zH));
15700
+ const t = c.tube(line, GAP_R, mat, { seg: line.length * 2, rs: 4 });
15701
+ t.castShadow = false;
15702
+ t.userData.gap = true;
15703
+ return t;
15704
+ }
15705
+ const FUEL_DOOR_W = 0.13;
15706
+ const FUEL_DOOR_H = 0.11;
15707
+ const FUEL_DOOR_R = 0.02;
15708
+ function fuelDoorGap(c, S, sd, x, y, mat) {
15709
+ const pts = [];
15710
+ const hx = FUEL_DOOR_W / 2 - FUEL_DOOR_R, hy = FUEL_DOOR_H / 2 - FUEL_DOOR_R;
15711
+ const corners = [
15712
+ [hx, hy, 0],
15713
+ [-hx, hy, 0.5 * PI],
15714
+ [-hx, -hy, PI],
15715
+ [hx, -hy, 1.5 * PI]
15716
+ ];
15717
+ corners.forEach(function([cx, cy, a0]) {
15718
+ for (let k = 0; k <= 4; k++) {
15719
+ const a = a0 + k / 4 * 0.5 * PI, px = x + cx + FUEL_DOOR_R * Math.cos(a), py = y + cy + FUEL_DOOR_R * Math.sin(a), h = S.hit(new V3(px, py, sd * (S.hw + 1)), new V3(0, 0, -sd), "M");
15720
+ pts.push(h ? h.p.clone().addScaledVector(h.n, 1e-3) : new V3(px, py, sd * S.hw));
15721
+ }
15722
+ });
15723
+ const t = c.tube(pts, GAP_R, mat, { closed: true, seg: pts.length * 2, rs: 4 });
15724
+ t.castShadow = false;
15725
+ t.userData.gap = true;
15726
+ return t;
15727
+ }
15444
15728
  function sm(t) {
15445
15729
  t = clamp(t, 0, 1);
15446
15730
  return t * t * (3 - 2 * t);
@@ -15487,36 +15771,23 @@ var GameVehiclesFleet = (() => {
15487
15771
  });
15488
15772
  const h = o.h || 0.03, Gd = sideGrid(I.S, sd, { x0, x1, y0: lo - h - 0.03, y1: hi + 0.03 });
15489
15773
  function yAt(u) {
15490
- const x = x0 + (x1 - x0) * u;
15491
- for (let i = 0; i < pts.length - 1; i++) {
15492
- const a = pts[i], b = pts[i + 1];
15493
- if ((x - a[0]) * (x - b[0]) <= 0) {
15494
- const t = (x - a[0]) / (b[0] - a[0] || 1);
15495
- return a[1] + (b[1] - a[1]) * sm(t);
15496
- }
15497
- }
15498
- return pts[pts.length - 1][1];
15774
+ return creaseHeightAt(pts, x0 + (x1 - x0) * u);
15499
15775
  }
15500
- I.K.skin(Gd, o.mat || c.paint(o.col), {
15776
+ const fold = I.K.skin(Gd, o.mat || c.paint(o.col), {
15501
15777
  yb: function(u) {
15502
15778
  return yAt(u) - h;
15503
15779
  },
15504
15780
  yt: yAt,
15505
- off: o.off || 6e-3,
15506
- thick: 9e-3,
15507
- nv: 2,
15781
+ off: o.off || 2e-3,
15782
+ ridge: { at: CREASE_FOLD_AT, lift: CREASE_FOLD_LIFT },
15783
+ crease: 30,
15784
+ nv: 5,
15508
15785
  u0: o.u0 || 0.01,
15509
15786
  u1: o.u1 || 0.99
15510
15787
  });
15511
- const l = [];
15512
- for (let k = 0; k <= 30; k++) {
15513
- const u = (o.u0 || 0.01) + k / 30 * ((o.u1 || 0.99) - (o.u0 || 0.01));
15514
- l.push([u, yAt(u) - h - 1e-3]);
15515
- }
15516
- lineOn(c, Gd, l, 3e-3, o.shade || SHADE, 3e-3);
15788
+ markRaised(c, markFinishDetail(fold));
15517
15789
  return Gd;
15518
15790
  }
15519
- const SHADE = CM("#000000", { roughness: 1, transparent: true, opacity: 0.45, depthWrite: false });
15520
15791
  function dloChrome(c, I, sd, pts, r) {
15521
15792
  const gh = I.gh, T = I.T, P = pts.map(function(q) {
15522
15793
  return [q[0], q[1], sd * (halfAt(gh.Wg, T, q[1]) + 0.012)];
@@ -16574,12 +16845,10 @@ var GameVehiclesFleet = (() => {
16574
16845
  I,
16575
16846
  sd,
16576
16847
  [
16577
- [1, 0.47],
16578
- [0, 0.5],
16579
- [-0.9, 0.6],
16580
- [-1.2, 0.66]
16848
+ [0.86, 0.52],
16849
+ [-0.98, 0.52]
16581
16850
  ],
16582
- { col: "#8b939a", h: 0.035 }
16851
+ { col: "#8b939a", h: 0.03 }
16583
16852
  );
16584
16853
  });
16585
16854
  }
@@ -24407,6 +24676,7 @@ var GameVehiclesFleet = (() => {
24407
24676
  tl: P.tl,
24408
24677
  grille: P.grille,
24409
24678
  seams: P.seams,
24679
+ shell: shellM,
24410
24680
  handles: P.handles,
24411
24681
  wheels: [
24412
24682
  [A.xf, P.wr, 0.24, { rim: P.rim }],