@adatechnology/game-vehicles-fleet 5.0.0 → 6.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.
@@ -21,6 +21,7 @@ var GameVehiclesFleet = (() => {
21
21
  // src/index.ts
22
22
  var index_exports = {};
23
23
  __export(index_exports, {
24
+ FLEET_FOUR_WHEEL_DRIVE: () => FLEET_FOUR_WHEEL_DRIVE,
24
25
  agricultural: () => agricultural,
25
26
  air: () => air,
26
27
  allFleetDims: () => allFleetDims,
@@ -32,8 +33,10 @@ var GameVehiclesFleet = (() => {
32
33
  fleetCard: () => fleetCard,
33
34
  fleetDims: () => fleetDims,
34
35
  fleetGroupIds: () => fleetGroupIds,
36
+ fleetGroupOf: () => fleetGroupOf,
35
37
  fleetGroups: () => fleetGroups,
36
38
  fleetPack: () => fleetPack,
39
+ fleetProvingSubject: () => fleetProvingSubject,
37
40
  fleetStats: () => fleetStats,
38
41
  fleetVehicleIds: () => fleetVehicleIds,
39
42
  heavy: () => heavy,
@@ -5056,6 +5059,20 @@ var GameVehiclesFleet = (() => {
5056
5059
  );
5057
5060
  }
5058
5061
 
5062
+ // src/vehicles/moving-parts.ts
5063
+ var WIPER_SWEEP = 1.5;
5064
+ function tagWiper(params) {
5065
+ var _a;
5066
+ const tag = { arm: params.index, sweep: WIPER_SWEEP, spindle: [params.spindle.x, params.spindle.y, params.spindle.z], axis: [params.normal.x, params.normal.y, params.normal.z] };
5067
+ (_a = params.context).wipers ?? (_a.wipers = []);
5068
+ for (const part of params.parts) params.context.wipers.push({ part, tag });
5069
+ }
5070
+ function markSunroof(pane, slide) {
5071
+ pane.name = "sunroof";
5072
+ pane.userData.sunroof = { slide };
5073
+ return pane;
5074
+ }
5075
+
5059
5076
  // src/vehicles/cars-extra.ts
5060
5077
  function installCarsExtra(fx) {
5061
5078
  const kit = fx.kit;
@@ -5553,7 +5570,7 @@ var GameVehiclesFleet = (() => {
5553
5570
  off: 3e-3,
5554
5571
  nv: 4
5555
5572
  });
5556
- skin(c, Gd, o.refl || REFL, { u0: pu, u1: 1 - pu, yb, yt, off: 6e-3, nv: 4 });
5573
+ const reflector = skin(c, Gd, o.refl || REFL, { u0: pu, u1: 1 - pu, yb, yt, off: 6e-3, nv: 4 });
5557
5574
  (o.proj || []).forEach(function(q) {
5558
5575
  const r = sh(q[0]), y = (r[0] + r[1]) / 2 + (q[1] || 0), s = Gd.at(q[0], y), rad = q[2] || Math.min(0.034, (r[1] - r[0]) * 0.4);
5559
5576
  const cup = onSurf(c.cylinder(rad * 1.35, rad * 1.2, 0.012, LH, 0, 0, 0), s, 8e-3);
@@ -5584,7 +5601,7 @@ var GameVehiclesFleet = (() => {
5584
5601
  lens.push(ln);
5585
5602
  if (!inner.length) inner.push(ln);
5586
5603
  const cs = Gd.at(0.5, (rg[0] + rg[1]) / 2).p;
5587
- regLight(c, "headlight", o.label || (sd > 0 ? trl("labels.right_headlight") : trl("labels.left_headlight")), inner, lens, cs);
5604
+ Object.assign(regLight(c, "headlight", o.label || (sd > 0 ? trl("labels.right_headlight") : trl("labels.left_headlight")), inner, lens, cs), { reflector: [reflector] });
5588
5605
  return Gd;
5589
5606
  };
5590
5607
  K.tail = function(sd, o) {
@@ -5925,7 +5942,7 @@ var GameVehiclesFleet = (() => {
5925
5942
  c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
5926
5943
  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));
5927
5944
  (s.seams || []).forEach(function(q) {
5928
- const x = q.length ? q[0] : q, y0 = q.length ? q[1] : by + 0.09, y1 = q.length ? q[2] : gh.belt - 0.03;
5945
+ 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;
5929
5946
  c.roundBox(8e-3, y1 - y0, 6e-3, 3e-3, MT.dark, x, (y0 + y1) / 2, sd * (hw + 1e-3));
5930
5947
  });
5931
5948
  (s.handles || []).forEach(function(x) {
@@ -5970,12 +5987,18 @@ var GameVehiclesFleet = (() => {
5970
5987
  (s.wiper === 1 ? [[0.12, 0.66, -0.5]] : [
5971
5988
  [-0.3, 0.42, -0.36],
5972
5989
  [0.2, 0.42, -0.36]
5973
- ]).forEach(function(q) {
5990
+ ]).forEach(function(q, index) {
5974
5991
  const p0 = new V3(gh.fb, gh.belt, q[0]).addScaledVector(wd, 0.07).addScaledVector(wn, 0.035), p1 = p0.clone().addScaledVector(wd, q[1] * 0.42);
5975
5992
  p1.z += q[2];
5976
- c.rod(p0, p1, 9e-3, MT.trim);
5977
- c.cylinder(0.018, 0.018, 0.03, MT.trim, p0.x, p0.y, p0.z);
5993
+ const blade = c.rod(p0, p1, 9e-3, MT.trim);
5994
+ const cap = c.cylinder(0.018, 0.018, 0.03, MT.trim, p0.x, p0.y, p0.z);
5995
+ tagWiper({ context: c, parts: [blade, cap], spindle: p0, normal: wn, index });
5978
5996
  });
5997
+ if (s.sunroof) {
5998
+ const sx = gh.rt + (gh.ft - gh.rt) * 0.62, sl = 0.62, sw = 2 * (halfAt(gh.Wg, T, gh.roof) - 0.24), sy = roofAt(gh, sx), tilt = Math.atan2(roofAt(gh, sx + 0.3) - roofAt(gh, sx - 0.3), 0.6);
5999
+ c.roundBox(sl, 8e-3, sw, 0.01, PLASTIC, sx, sy + 4e-3, 0, { rot: [0, 0, tilt] }).castShadow = false;
6000
+ markSunroof(c.roundBox(sl + 0.03, 0.012, sw + 0.03, 0.01, MT.tint, sx, sy + 0.013, 0, { rot: [0, 0, tilt] }), sl * 0.85);
6001
+ }
5979
6002
  if (s.fin !== false)
5980
6003
  c.sphere(0.1, s.roofCol ? c.paint(s.roofCol) : GLOSS, gh.rt + 0.2, roofAt(gh, gh.rt + 0.2) + 0.045, 0, 1, 0.45, 0.28, {
5981
6004
  tl: PI / 2
@@ -6107,7 +6130,9 @@ var GameVehiclesFleet = (() => {
6107
6130
  function fogLamp(c, s, r) {
6108
6131
  onSurf(c.cylinder(r * 1.4, r * 1.4, 0.014, LH, 0, 0, 0), s, 6e-3).castShadow = false;
6109
6132
  onSurf(c.cylinder(r, r, 0.012, REFL, 0, 0, 0), s, 0.012).castShadow = false;
6110
- onSurf(c.sphere(r * 0.45, MT.head, 0, 0, 0, 1, 0.5, 1), s, 0.016).castShadow = false;
6133
+ const bulb = onSurf(c.sphere(r * 0.45, MT.head, 0, 0, 0, 1, 0.5, 1), s, 0.016);
6134
+ bulb.castShadow = false;
6135
+ (c.fogBulbs ?? (c.fogBulbs = [])).push(bulb);
6111
6136
  }
6112
6137
  function crease(c, I, sd, pts, o) {
6113
6138
  o = o || {};
@@ -6949,6 +6974,7 @@ var GameVehiclesFleet = (() => {
6949
6974
  function(c) {
6950
6975
  const hex = "#8c2b2b";
6951
6976
  car(c, {
6977
+ sunroof: fx.hasSunroof("turbo_hatch"),
6952
6978
  W: 1.751,
6953
6979
  col: hex,
6954
6980
  shelf: 0.42,
@@ -7226,6 +7252,7 @@ var GameVehiclesFleet = (() => {
7226
7252
  function(c) {
7227
7253
  const hex = "#5a5f66";
7228
7254
  car(c, {
7255
+ sunroof: fx.hasSunroof("fastback_sedan"),
7229
7256
  W: 1.799,
7230
7257
  col: hex,
7231
7258
  bottomY: 0.2,
@@ -7520,6 +7547,8 @@ var GameVehiclesFleet = (() => {
7520
7547
  fx.register(
7521
7548
  {
7522
7549
  key: "classic_six_sedan",
7550
+ // glass headlight lenses, as on cars of its time: they shatter (a modern car's are polycarbonate)
7551
+ headlightLens: "glass",
7523
7552
  group: "cars",
7524
7553
  name: trl("vehicles.classic_six_sedan.name"),
7525
7554
  inspired: trl("vehicles.classic_six_sedan.inspired"),
@@ -9386,6 +9415,7 @@ var GameVehiclesFleet = (() => {
9386
9415
  hood: true
9387
9416
  },
9388
9417
  function(c) {
9418
+ c.meta.armor = "III";
9389
9419
  const f = 3.75, W = 2.32, len = 1.85, ax = 2.5, wr = 0.506, ww = 0.28, col = "#56616b";
9390
9420
  c.meta.bullet = true;
9391
9421
  c.meta.cabLength = len + 0.15;
@@ -9458,8 +9488,10 @@ var GameVehiclesFleet = (() => {
9458
9488
  c.cylinder(0.36, 0.38, 0.1, plate, -1.3, 3.13, 0);
9459
9489
  c.cylinder(0.3, 0.3, 0.05, MT.steel, -1.3, 3.2, 0);
9460
9490
  c.roundBox(0.2, 0.08, 1.3, 0.03, MT.trim, bx0 - 0.25, 3.13, 0);
9461
- [-0.45, 0, 0.45].forEach(function(z) {
9462
- c.roundBox(0.14, 0.08, 0.3, 0.03, MT.amber, bx0 - 0.25, 3.2, z);
9491
+ [-0.45, 0, 0.45].forEach(function(z, i) {
9492
+ const lamp = c.roundBox(0.14, 0.08, 0.3, 0.03, MT.amber, bx0 - 0.25, 3.2, z);
9493
+ lamp.userData.lamp = "beacon";
9494
+ lamp.userData.beaconSide = i % 2;
9463
9495
  });
9464
9496
  c.rod(new V3(-2.5, 3.08, 0.6), new V3(-2.5, 3.6, 0.6), 8e-3, MT.trim);
9465
9497
  c.rod(new V3(-2.8, 3.08, -0.6), new V3(-2.8, 3.4, -0.6), 0.01, MT.trim);
@@ -14591,7 +14623,7 @@ var GameVehiclesFleet = (() => {
14591
14623
  off: 3e-3,
14592
14624
  nv: 4
14593
14625
  });
14594
- skin(c, Gd, o.refl || REFL, { u0: pu, u1: 1 - pu, yb, yt, off: 6e-3, nv: 4 });
14626
+ const reflector = skin(c, Gd, o.refl || REFL, { u0: pu, u1: 1 - pu, yb, yt, off: 6e-3, nv: 4 });
14595
14627
  (o.proj || []).forEach(function(q) {
14596
14628
  const r = sh(q[0]), y = (r[0] + r[1]) / 2 + (q[1] || 0), s = Gd.at(q[0], y), rad = q[2] || Math.min(0.034, (r[1] - r[0]) * 0.4);
14597
14629
  const cup = onSurf(c.cylinder(rad * 1.35, rad * 1.2, 0.012, LH, 0, 0, 0), s, 8e-3);
@@ -14622,7 +14654,7 @@ var GameVehiclesFleet = (() => {
14622
14654
  lens.push(ln);
14623
14655
  if (!inner.length) inner.push(ln);
14624
14656
  const cs = Gd.at(0.5, (rg[0] + rg[1]) / 2).p;
14625
- regLight(c, "headlight", o.label || (sd > 0 ? trl("labels.right_headlight") : trl("labels.left_headlight")), inner, lens, cs);
14657
+ Object.assign(regLight(c, "headlight", o.label || (sd > 0 ? trl("labels.right_headlight") : trl("labels.left_headlight")), inner, lens, cs), { reflector: [reflector] });
14626
14658
  return Gd;
14627
14659
  };
14628
14660
  K.tail = function(sd, o) {
@@ -14982,8 +15014,11 @@ var GameVehiclesFleet = (() => {
14982
15014
  );
14983
15015
  });
14984
15016
  const wy = gh.belt + 0.06, wx = gh.fb - 0.03;
14985
- [-0.3, 0.2].forEach(function(z) {
14986
- c.rod(new V3(wx + 0.02, wy, z + 0.02), new V3(wx - 0.13, wy + 0.13, z - 0.36), 9e-3, MT.trim);
15017
+ [-0.3, 0.2].forEach(function(z, index) {
15018
+ const spindle = new V3(wx + 0.02, wy, z + 0.02);
15019
+ const blade = c.rod(spindle, new V3(wx - 0.13, wy + 0.13, z - 0.36), 9e-3, MT.trim);
15020
+ const along = new V3(gh.ft - gh.fb, gh.roof - gh.belt, 0).normalize();
15021
+ tagWiper({ context: c, parts: [blade], spindle, normal: new V3(along.y, -along.x, 0), index });
14987
15022
  });
14988
15023
  if (s.fin !== false)
14989
15024
  c.sphere(0.1, s.roofCol ? c.paint(s.roofCol) : GLOSS, gh.rt + 0.2, roofAt(gh, gh.rt + 0.2) + 0.045, 0, 1, 0.45, 0.28, {
@@ -15116,7 +15151,9 @@ var GameVehiclesFleet = (() => {
15116
15151
  function fogLamp(c, s, r) {
15117
15152
  onSurf(c.cylinder(r * 1.4, r * 1.4, 0.014, LH, 0, 0, 0), s, 6e-3).castShadow = false;
15118
15153
  onSurf(c.cylinder(r, r, 0.012, REFL, 0, 0, 0), s, 0.012).castShadow = false;
15119
- onSurf(c.sphere(r * 0.45, MT.head, 0, 0, 0, 1, 0.5, 1), s, 0.016).castShadow = false;
15154
+ const bulb = onSurf(c.sphere(r * 0.45, MT.head, 0, 0, 0, 1, 0.5, 1), s, 0.016);
15155
+ bulb.castShadow = false;
15156
+ (c.fogBulbs ?? (c.fogBulbs = [])).push(bulb);
15120
15157
  }
15121
15158
  function crease(c, I, sd, pts, o) {
15122
15159
  o = o || {};
@@ -16464,7 +16501,7 @@ var GameVehiclesFleet = (() => {
16464
16501
  K.skin(Gs2, CM(blueP, { roughness: 0.45, metalness: 0.2 }), { yb: 0.775, yt: 0.83, off: 7e-3, nv: 1, u0: 0.01, u1: 0.99 });
16465
16502
  K.skin(Gs2, CM(yellowP, { roughness: 0.45, metalness: 0.2 }), { yb: 0.746, yt: 0.77, off: 7e-3, nv: 1, u0: 0.01, u1: 0.99 });
16466
16503
  }
16467
- const f = sd > 0 ? "+z" : "-z", pt = Gd.at(Gd.ux ? 0.5 : 0.5, 0.62).p;
16504
+ const f = sd > 0 ? "+z" : "-z", pt = Gd.at(0.5, 0.62).p;
16468
16505
  if (highwayPolice)
16469
16506
  c2.text(trl("texts.federal_highway_police"), 1.9, 0.13, -0.32, 0.6, sd * (Math.abs(pt.z) + 0.012), f, {
16470
16507
  fg: blueP,
@@ -16502,6 +16539,10 @@ var GameVehiclesFleet = (() => {
16502
16539
  }
16503
16540
  }
16504
16541
  });
16542
+ beacon[1].userData.lamp = "beacon";
16543
+ beacon[1].userData.beaconSide = 0;
16544
+ beacon[2].userData.lamp = "beacon";
16545
+ beacon[2].userData.beaconSide = 1;
16505
16546
  c2.meta.top = top + 0.15;
16506
16547
  c2.meta.roof.y = Math.max(c2.meta.roof.y, top + 0.15);
16507
16548
  const fx2 = I.fxB + 0.12, push = [];
@@ -17542,7 +17583,8 @@ var GameVehiclesFleet = (() => {
17542
17583
  const fw = kit.spokedWheel(c, 0.78, 0.325, 0.06, { spokes: 40, knobby: true, disc: true, label: trl("labels.front_tire") });
17543
17584
  const rw = kit.spokedWheel(c, -0.72, 0.318, 0.08, { spokes: 40, knobby: true, label: trl("labels.rear_tire") });
17544
17585
  [fw, rw].forEach(function(g) {
17545
- g.children.forEach(function(ch) {
17586
+ g.children.forEach(function(o) {
17587
+ const ch = o;
17546
17588
  if (ch.geometry && ch.geometry.type === "TorusGeometry" && ch.material === MT.chrome) ch.material = rimGold;
17547
17589
  });
17548
17590
  });
@@ -17804,7 +17846,9 @@ var GameVehiclesFleet = (() => {
17804
17846
  c.roundBox(0.5, 0.018, 6e-3, 2e-3, c.paint("#f2c21a"), -0.7, 0.825, z);
17805
17847
  c.text("PRF", 0.2, 0.08, -0.7, 0.73, z + s * 2e-3, f, { fg: "#1f3f8f", size: 0.85 });
17806
17848
  c.text(trl("texts.federal_highway_police"), 0.3, 0.035, 0.24, 1, s * 0.3, f, { fg: "#f4f2ea", w: 1024, h: 120, size: 0.8 });
17807
- c.roundBox(0.05, 0.05, 0.04, 0.012, s > 0 ? MT.blue : MT.tail, 0.62, 0.95, s * 0.3, { def: true });
17849
+ const flasher = c.roundBox(0.05, 0.05, 0.04, 0.012, s > 0 ? MT.blue : MT.tail, 0.62, 0.95, s * 0.3, { def: true });
17850
+ flasher.userData.lamp = "beacon";
17851
+ flasher.userData.beaconSide = s > 0 ? 1 : 0;
17808
17852
  });
17809
17853
  c.cylinder(0.04, 0.045, 0.06, MT.trim, 0.66, 0.66, 0.36, "x");
17810
17854
  }
@@ -18057,6 +18101,8 @@ var GameVehiclesFleet = (() => {
18057
18101
  fx.register(
18058
18102
  {
18059
18103
  key: "beetle",
18104
+ // glass headlight lenses, as on cars of its time: they shatter (a modern car's are polycarbonate)
18105
+ headlightLens: "glass",
18060
18106
  group: "cars",
18061
18107
  name: trl("vehicles.beetle.name"),
18062
18108
  inspired: trl("vehicles.beetle.inspired"),
@@ -20063,13 +20109,9 @@ var GameVehiclesFleet = (() => {
20063
20109
  }
20064
20110
 
20065
20111
  // src/vehicles/planes-extra.ts
20066
- function installPlanesExtra(fx) {
20067
- const kit = fx.kit;
20112
+ function createPlanesKit(kit) {
20068
20113
  const THREE = kit.THREE;
20069
- const shared = fx.shared;
20070
- const trl = fx.t;
20071
- const lbl = fx.label;
20072
- const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
20114
+ const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial;
20073
20115
  function pose3(Af, ra, Tf, rt) {
20074
20116
  let lo = 0, hi = 0.5, TH = 0;
20075
20117
  function f(t) {
@@ -20218,7 +20260,7 @@ var GameVehiclesFleet = (() => {
20218
20260
  m.rotation.y += -s * Math.atan2(a - b, w);
20219
20261
  return m;
20220
20262
  }
20221
- shared.GH = {
20263
+ return {
20222
20264
  pose3,
20223
20265
  starDecal,
20224
20266
  rrect,
@@ -20232,6 +20274,17 @@ var GameVehiclesFleet = (() => {
20232
20274
  liner,
20233
20275
  sideText
20234
20276
  };
20277
+ }
20278
+ function installPlanesExtra(fx) {
20279
+ const kit = fx.kit;
20280
+ const THREE = kit.THREE;
20281
+ const shared = fx.shared;
20282
+ const trl = fx.t;
20283
+ const lbl = fx.label;
20284
+ const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
20285
+ const GH = createPlanesKit(kit);
20286
+ shared.GH = GH;
20287
+ const { pose3, starDecal, rrect, polysSdf, pod, fSkin, fGlass, liner, sideText } = GH;
20235
20288
  fx.register(
20236
20289
  {
20237
20290
  key: "tandem_trainer",
@@ -22223,7 +22276,8 @@ var GameVehiclesFleet = (() => {
22223
22276
  if (msh && msh.parent) warp(msh);
22224
22277
  });
22225
22278
  const bb = new THREE.Box3(), cen = new V3(), sz = new V3();
22226
- c.vehicle.children.slice().forEach(function(ob) {
22279
+ c.vehicle.children.slice().forEach(function(o3) {
22280
+ const ob = o3;
22227
22281
  if (skip.has(ob) || warpSet.has(ob)) return;
22228
22282
  if (ob.isMesh) {
22229
22283
  const g = ob.geometry;
@@ -22331,7 +22385,7 @@ var GameVehiclesFleet = (() => {
22331
22385
  const x = kit.profX(s.lower, s.bottomY + 0.14, true) + 0.09;
22332
22386
  [1, -1].forEach(function(sd) {
22333
22387
  c.roundBox(0.04, r * 2.6, r * 3.2, 0.015, MT.housing, x, y, sd * z);
22334
- kit.headlight(c, {
22388
+ const lamp = kit.headlight(c, {
22335
22389
  style: "round",
22336
22390
  x: x + 0.01,
22337
22391
  y,
@@ -22343,6 +22397,7 @@ var GameVehiclesFleet = (() => {
22343
22397
  label: sd > 0 ? trl("labels.right_fog_light") : trl("labels.left_fog_light"),
22344
22398
  reach: 0.5
22345
22399
  });
22400
+ lamp.fog = true;
22346
22401
  });
22347
22402
  }
22348
22403
  function roofBars(c, z, h, r) {
@@ -22437,7 +22492,8 @@ var GameVehiclesFleet = (() => {
22437
22492
  }
22438
22493
  function plateOutside(c) {
22439
22494
  const m = c.meta;
22440
- c.vehicle.children.forEach(function(o) {
22495
+ c.vehicle.children.forEach(function(o3) {
22496
+ const o = o3;
22441
22497
  if (o.isMesh && o.geometry.type === "PlaneGeometry" && Math.abs(o.rotation.y + PI / 2) < 0.01 && o.position.x < m.rear + 0.2 && o.material.map && o.material.map.image && o.material.map.image.width === 400)
22442
22498
  o.position.x = Math.min(o.position.x, m.rear - BV * 0.5) - BV * 0.62;
22443
22499
  });
@@ -22607,7 +22663,8 @@ var GameVehiclesFleet = (() => {
22607
22663
  }
22608
22664
  c.root.updateMatrixWorld(true);
22609
22665
  const gInv = new THREE.Matrix4().copy(c.vehicle.matrixWorld).invert(), rel = new THREE.Matrix4(), inv = new THREE.Matrix4(), v = new V3(), done = /* @__PURE__ */ new Set();
22610
- c.vehicle.traverse(function(ob) {
22666
+ c.vehicle.traverse(function(o3) {
22667
+ const ob = o3;
22611
22668
  if (!ob.isMesh || done.has(ob.geometry)) return;
22612
22669
  done.add(ob.geometry);
22613
22670
  rel.multiplyMatrices(gInv, ob.matrixWorld);
@@ -22673,7 +22730,8 @@ var GameVehiclesFleet = (() => {
22673
22730
  c.lights.forEach(function(L) {
22674
22731
  if (!L.group || L.group.userData.recessed) return;
22675
22732
  L.group.userData.recessed = true;
22676
- L.group.children.slice().forEach(function(h) {
22733
+ L.group.children.slice().forEach(function(o3) {
22734
+ const h = o3;
22677
22735
  if (!h.isMesh || h.material !== MT.housing || h.geometry.type !== "BoxGeometry" || Math.abs(h.position.x) > 1e-3) return;
22678
22736
  h.geometry.computeBoundingBox();
22679
22737
  const bb = h.geometry.boundingBox, d = bb.max.x - bb.min.x;
@@ -22704,7 +22762,8 @@ var GameVehiclesFleet = (() => {
22704
22762
  const cols = [m.color, m.roofCol].filter(Boolean).map(function(h) {
22705
22763
  return new THREE.Color(h).getHex();
22706
22764
  });
22707
- c.vehicle.children.forEach(function(o) {
22765
+ c.vehicle.children.forEach(function(o3) {
22766
+ const o = o3;
22708
22767
  if (!o.isMesh || gl.has(o) || o.geometry.type !== "BoxGeometry" || o.material === MT.trim || o.material === MT.chrome || o.material.transparent)
22709
22768
  return;
22710
22769
  if (o.material.color && cols.indexOf(o.material.color.getHex()) >= 0) return;
@@ -23548,7 +23607,8 @@ var GameVehiclesFleet = (() => {
23548
23607
  },
23549
23608
  post: function(c2, _m) {
23550
23609
  const gfx = fX(s, 0.8) + 0.04;
23551
- c2.vehicle.children.forEach(function(o) {
23610
+ c2.vehicle.children.forEach(function(o3) {
23611
+ const o = o3;
23552
23612
  if (o.isMesh && o.geometry.type === "PlaneGeometry" && Math.abs(o.rotation.y - PI / 2) < 0.01 && o.position.x > 1.5 && o.material.map && o.material.map.image && o.material.map.image.width === 400)
23553
23613
  o.position.x = Math.max(o.position.x, gfx);
23554
23614
  });
@@ -23883,7 +23943,7 @@ var GameVehiclesFleet = (() => {
23883
23943
  kit.sideWindows(c, [cab], W, T, function() {
23884
23944
  return lbl("cab_window");
23885
23945
  });
23886
- winS.forEach(function(w, _i) {
23946
+ winS.forEach(function(w) {
23887
23947
  kit.sideWindows(
23888
23948
  c,
23889
23949
  [w.p],
@@ -24076,7 +24136,8 @@ var GameVehiclesFleet = (() => {
24076
24136
  fxKey: "lid",
24077
24137
  dir: "front"
24078
24138
  });
24079
- c.vehicle.children.forEach(function(o) {
24139
+ c.vehicle.children.forEach(function(o3) {
24140
+ const o = o3;
24080
24141
  if (o.isMesh && o.geometry.type === "PlaneGeometry" && o.material.map && o.material.map.image && o.material.map.image.width === 400 && o.position.x < 0)
24081
24142
  o.position.y = 0.84;
24082
24143
  });
@@ -24127,7 +24188,7 @@ var GameVehiclesFleet = (() => {
24127
24188
  grille: { style: "truck", w: 0.84, h: 0.28, y: 0.86 },
24128
24189
  seams: [1.62, 0.44],
24129
24190
  handles: [0.6],
24130
- extra: function(c2, m, _A) {
24191
+ extra: function(c2, m) {
24131
24192
  const fx2 = kit.profX(m.vanLow, 0.86, true);
24132
24193
  kit.emblem(c2, fx2 + 0.1, 0.86, 0, 0.1);
24133
24194
  const bfx = kit.profX(m.vanLow, 0.56, true);
@@ -24158,7 +24219,8 @@ var GameVehiclesFleet = (() => {
24158
24219
  [cx0 + 0.9, 0.82, -0.3, "#7a5c3a"],
24159
24220
  [cx0 + 0.6, 1.18, -0.3, "#8a6a44"],
24160
24221
  [cx0 + 1.6, 0.82, 0, "#6d5232"]
24161
- ].forEach(function(b) {
24222
+ ].forEach(function(q) {
24223
+ const b = q;
24162
24224
  c2.roundBox(0.5, 0.4, 0.5, 0.02, CM(b[3], { roughness: 0.9 }), b[0], b[1], b[2]);
24163
24225
  });
24164
24226
  c2.part("cargo", trl("labels.cargo_box"), null, new V3(m.rear + 1.4, 1.2, 0), 1.3);
@@ -24338,18 +24400,19 @@ var GameVehiclesFleet = (() => {
24338
24400
  c2.roundBox(0.03, 0.12, 1.9, 0.01, rd, m.rear - 8e-3, 1.1, 0);
24339
24401
  const beaconBar = [c2.roundBox(0.3, 0.08, 1.5, 0.03, MT.trim, 0.6, m.top + 0.04, 0)];
24340
24402
  [-0.5, -0.17, 0.17, 0.5].forEach(function(z, i) {
24341
- beaconBar.push(
24342
- c2.roundBox(
24343
- 0.24,
24344
- 0.1,
24345
- 0.3,
24346
- 0.04,
24347
- i % 2 ? MT.tail : CM("#f2f2f2", { emissive: new THREE.Color("#ffffff"), emissiveIntensity: 0.6 }),
24348
- 0.6,
24349
- m.top + 0.13,
24350
- z
24351
- )
24403
+ const lamp = c2.roundBox(
24404
+ 0.24,
24405
+ 0.1,
24406
+ 0.3,
24407
+ 0.04,
24408
+ i % 2 ? MT.tail : CM("#f2f2f2", { emissive: new THREE.Color("#ffffff"), emissiveIntensity: 0.6 }),
24409
+ 0.6,
24410
+ m.top + 0.13,
24411
+ z
24352
24412
  );
24413
+ lamp.userData.lamp = "beacon";
24414
+ lamp.userData.beaconSide = z < 0 ? 0 : 1;
24415
+ beaconBar.push(lamp);
24353
24416
  });
24354
24417
  beaconBar.push(
24355
24418
  c2.roundBox(
@@ -24403,7 +24466,7 @@ var GameVehiclesFleet = (() => {
24403
24466
  c2.cylinder(0.03, 0.04, 0.08, MT.chrome, sx + 2.35, fl + 0.99, -0.75);
24404
24467
  c2.part("fuel_tank", trl("labels.oxygen_cylinder"), null, new V3(sx + 2.35, fl + 0.5, -0.75), 0.5);
24405
24468
  c2.roundBox(0.04, 0.26, 0.34, 0.02, MT.screen, 0.1, 1.7, 0.5);
24406
- const light = c2.roundBox(
24469
+ const lightPanel = c2.roundBox(
24407
24470
  2.3,
24408
24471
  0.02,
24409
24472
  W - 0.3,
@@ -24413,7 +24476,7 @@ var GameVehiclesFleet = (() => {
24413
24476
  m.top - 0.06,
24414
24477
  0
24415
24478
  );
24416
- light.castShadow = false;
24479
+ lightPanel.castShadow = false;
24417
24480
  m.roofItems = beaconBar;
24418
24481
  }
24419
24482
  });
@@ -24444,13 +24507,9 @@ var GameVehiclesFleet = (() => {
24444
24507
  }
24445
24508
 
24446
24509
  // src/vehicles/water-air.ts
24447
- function installWaterAir(fx) {
24448
- const kit = fx.kit;
24510
+ function createWaterAirKit(kit) {
24449
24511
  const THREE = kit.THREE;
24450
- const shared = fx.shared;
24451
- const trl = fx.t;
24452
- const lbl = fx.label;
24453
- const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, G = kit.geo, DS = THREE.DoubleSide, clamp = kit.clamp;
24512
+ const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, G = kit.geo, clamp = kit.clamp;
24454
24513
  function colorize(geo, fn) {
24455
24514
  const p = geo.attributes.position, col = new Float32Array(p.count * 3);
24456
24515
  for (let i = 0; i < p.count; i++) {
@@ -24920,7 +24979,8 @@ var GameVehiclesFleet = (() => {
24920
24979
  function bake(c, grp) {
24921
24980
  grp.updateMatrix();
24922
24981
  const M = grp.matrix;
24923
- grp.children.slice().forEach(function(o) {
24982
+ grp.children.slice().forEach(function(o3) {
24983
+ const o = o3;
24924
24984
  o.updateMatrix();
24925
24985
  const m = new THREE.Matrix4().multiplyMatrices(M, o.matrix);
24926
24986
  grp.remove(o);
@@ -25122,7 +25182,7 @@ var GameVehiclesFleet = (() => {
25122
25182
  t.rotation.y += s > 0 ? -Math.atan(m) : Math.atan(m);
25123
25183
  return t;
25124
25184
  }
25125
- shared.EA = {
25185
+ return {
25126
25186
  colorize,
25127
25187
  tab,
25128
25188
  tabL,
@@ -25160,6 +25220,15 @@ var GameVehiclesFleet = (() => {
25160
25220
  pedals,
25161
25221
  NAV
25162
25222
  };
25223
+ }
25224
+ function installWaterAir(fx) {
25225
+ const kit = fx.kit;
25226
+ const THREE = kit.THREE;
25227
+ const shared = fx.shared;
25228
+ const trl = fx.t;
25229
+ const lbl = fx.label;
25230
+ const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, DS = THREE.DoubleSide;
25231
+ shared.EA = createWaterAirKit(kit);
25163
25232
  fx.register(
25164
25233
  {
25165
25234
  key: "river_skiff",
@@ -27268,6 +27337,7 @@ var GameVehiclesFleet = (() => {
27268
27337
  shared,
27269
27338
  t,
27270
27339
  label: (key) => ({ key, label: t("labels." + key) }),
27340
+ hasSunroof: (key) => !!options.sunroofs?.includes(key),
27271
27341
  register(spec, build) {
27272
27342
  if (!groups.has(spec.group) || only && !only.has(spec.key) || skip.has(spec.key)) return;
27273
27343
  kit.register({ ...spec, seedKey: legacyVehicleSeeds[spec.key] }, build);
@@ -29523,6 +29593,29 @@ var GameVehiclesFleet = (() => {
29523
29593
  var cards = cards_pt_BR_default;
29524
29594
  var fleetStats = (id) => stats[id];
29525
29595
  var fleetCard = (id) => cards[id];
29596
+
29597
+ // src/proving.ts
29598
+ var FLEET_FOUR_WHEEL_DRIVE = ["light_4x4", "troop_truck", "apc_6x6", "armored_car_6x6", "battle_tank", "monster_truck", "midsize_pickup", "large_suv", "tractor", "quad_bike"];
29599
+ var fleetGroupOf = (id) => Object.entries(fleetGroups).find(([, ids]) => ids.includes(id))?.[0];
29600
+ function fleetProvingSubject(id, options = {}) {
29601
+ const stats2 = fleetStats(id);
29602
+ const dims = fleetDims(id);
29603
+ if (!stats2 || !dims) return null;
29604
+ const group = fleetGroupOf(id) ?? "cars";
29605
+ const density = { motorcycles: 90, cars: 88, suvs: 90, pickups: 95, vans: 80, heavy: 120, agricultural: 150, military: 260, water: 60, air: 40 };
29606
+ return {
29607
+ id,
29608
+ domain: group === "water" ? "water" : group === "air" ? "air" : "land",
29609
+ category: group,
29610
+ stats: { acceleration: stats2.acceleration, handling: stats2.handling, maxSpeedKmh: stats2.maxSpeedKmh },
29611
+ body: {
29612
+ mass: options.mass ?? Math.round((density[group] ?? 90) * dims.length * dims.width * dims.height),
29613
+ wheelbase: options.wheelbase ?? Math.round(dims.length * 0.6 * 100) / 100,
29614
+ track: options.track ?? Math.round(dims.width * 0.82 * 100) / 100,
29615
+ fourWheelDrive: options.fourWheelDrive ?? FLEET_FOUR_WHEEL_DRIVE.includes(id)
29616
+ }
29617
+ };
29618
+ }
29526
29619
  return __toCommonJS(index_exports);
29527
29620
  })();
29528
29621
  //# sourceMappingURL=index.global.js.map