@adatechnology/game-vehicles 0.8.0 → 0.8.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.d.ts CHANGED
@@ -542,6 +542,7 @@ type GrilleSpec = {
542
542
  h?: number;
543
543
  y?: number;
544
544
  emblem?: boolean;
545
+ emblemBack?: number;
545
546
  };
546
547
  /** The spec of `kit.car` (see the comment above it). */
547
548
  type CarSpec = {
@@ -914,7 +915,8 @@ type GrilleOptions = {
914
915
  h?: number;
915
916
  style?: 'bars' | 'mesh' | 'big' | 'seven' | 'closed' | 'truck';
916
917
  col?: ColorRepresentation;
917
- emblem?: boolean;
918
+ emblem?: boolean; /** metres the badge sits behind its usual place on the grille (a car whose foremost point is the badge keeps its measured length) */
919
+ emblemBack?: number;
918
920
  };
919
921
  declare function installLights(kit: Kit): {
920
922
  lampGroup: (c: BuildContext, x: number, y: number, z: number, rotY: number) => three.Group<three.Object3DEventMap>;
@@ -98,7 +98,7 @@ var GameVehicles = (() => {
98
98
  wrapThreeForLod: () => wrapThreeForLod
99
99
  });
100
100
 
101
- // ../game-shapes/dist/chunk-E3X7UDDV.js
101
+ // ../game-shapes/dist/chunk-QETSTM6M.js
102
102
  function canonicalJson(value) {
103
103
  if (value === null) return "null";
104
104
  if (typeof value === "number") return Object.is(value, -0) ? "-0" : Number.isFinite(value) ? String(value) : JSON.stringify(String(value));
@@ -4669,6 +4669,7 @@ var GameVehicles = (() => {
4669
4669
  kit.halo = halo;
4670
4670
  function lampKit(g, d, inner, lens, lensMat, refl) {
4671
4671
  refl = refl || MATERIALS.reflector;
4672
+ let nProj = 0;
4672
4673
  return {
4673
4674
  housing: function(w, h, y, z, geoFn) {
4674
4675
  const geo = roundedBoxGeometry(d, h, w, Math.min(0.03, h * 0.4));
@@ -4689,7 +4690,7 @@ var GameVehicles = (() => {
4689
4690
  return m;
4690
4691
  },
4691
4692
  proj: function(y, z, r, mat) {
4692
- const bz = gm(g, new THREE.CylinderGeometry(r * 1.3, r * 1.45, 0.03, 18), refl, d / 2 - 0.03, y, z);
4693
+ const bz = gm(g, new THREE.CylinderGeometry(r * 1.3, r * 1.45, 0.03, 18), refl, d / 2 - 0.03 - nProj++ * 2e-3, y, z);
4693
4694
  bz.rotation.z = -PI / 2;
4694
4695
  if (refl !== MATERIALS.reflector) inner.push(bz);
4695
4696
  const e = gm(g, new THREE.SphereGeometry(r, 14, 10), mat, d / 2 - 0.022, y, z);
@@ -4869,10 +4870,10 @@ var GameVehicles = (() => {
4869
4870
  (parent || c.vehicle).add(g);
4870
4871
  const d1 = gm(g, new THREE.CylinderGeometry(r, r, 0.012, 24), MATERIALS.chrome);
4871
4872
  d1.rotation.z = PI / 2;
4872
- const d2 = gm(g, new THREE.CylinderGeometry(r * 0.78, r * 0.78, 0.014, 24), MATERIALS.trim);
4873
+ const d2 = gm(g, new THREE.CylinderGeometry(r * 0.78, r * 0.78, 0.018, 24), MATERIALS.trim);
4873
4874
  d2.rotation.z = PI / 2;
4874
- gm(g, roundedBoxGeometry(0.016, r * 0.32, r * 1.4, 5e-3), MATERIALS.chrome);
4875
- gm(g, roundedBoxGeometry(0.016, r * 1, r * 0.22, 5e-3), MATERIALS.chrome, 0, 0, r * 0.25).rotation.x = 0.5;
4875
+ gm(g, roundedBoxGeometry(0.024, r * 0.32, r * 1.4, 5e-3), MATERIALS.chrome);
4876
+ gm(g, roundedBoxGeometry(0.03, r * 1, r * 0.22, 5e-3), MATERIALS.chrome, 0, 0, r * 0.25).rotation.x = 0.5;
4876
4877
  return g;
4877
4878
  };
4878
4879
  kit.grille = function(c, o) {
@@ -4925,7 +4926,7 @@ var GameVehicles = (() => {
4925
4926
  g.children.forEach(function(m) {
4926
4927
  m.castShadow = true;
4927
4928
  });
4928
- if (o.emblem !== false) kit.emblem(c, 0.05, st === "closed" ? h * 0.12 : 0, 0, Math.min(0.05, h * 0.3), g);
4929
+ if (o.emblem !== false) kit.emblem(c, 0.05 - (o.emblemBack ?? 0), st === "closed" ? h * 0.12 : 0, 0, Math.min(0.05, h * 0.3), g);
4929
4930
  return g;
4930
4931
  };
4931
4932
  const shared = { lampGroup, gm, wedgeY, haloTex, glowTexture, haloMats, halo, lampKit };
@@ -5172,7 +5173,7 @@ var GameVehicles = (() => {
5172
5173
  } else kit.seat(c, x, fl, 0, { w: zi * 2 - 0.1, n: r === 2 ? 2 : 3, mat: fab, back, lean, h: seatH * 0.95, role: "rear" });
5173
5174
  const trimLen = Math.min(0.8, (o.rowPitch ?? 0.88) - 0.06);
5174
5175
  [-1, 1].forEach(function(s) {
5175
- c.roundBox(trimLen, belt - fl - 0.08, 0.035, 0.015, trim, x + 0.12, (belt + fl) / 2 + 0.02, s * (zi + 0.02));
5176
+ c.roundBox(trimLen, belt - fl - 0.08, 0.035, 0.015, trim, x + 0.12, (belt + fl) / 2 + 0.02, s * (zi + 0.02 + r % 2 * 2e-3));
5176
5177
  c.roundBox(0.3, 0.05, 0.07, 0.02, fab, x + 0.16, fl + seatH + 0.16, s * (zi - 0.015));
5177
5178
  c.roundBox(0.08, 0.025, 0.02, 8e-3, MATERIALS.chrome, x + 0.36, belt - 0.11, s * (zi - 5e-3));
5178
5179
  });
@@ -5597,15 +5598,15 @@ var GameVehicles = (() => {
5597
5598
  const cx = (x0 + x1) / 2;
5598
5599
  const paint = c.paint(o.col || c.meta.color || "#666");
5599
5600
  const out = {};
5600
- c.roundBox(L, 0.03, 2 * zw, 0.01, MATERIALS.bay, cx, fl, 0);
5601
+ c.roundBox(L - 0.03, 0.03, 2 * zw, 0.01, MATERIALS.bay, cx + 0.015, fl, 0);
5601
5602
  c.roundBox(0.03, H + 0.04, 2 * zw, 0.01, MATERIALS.bay, x0 + 0.015, fl + H / 2, 0);
5602
5603
  [1, -1].forEach(function(s) {
5603
- c.roundBox(L, H * 0.75, 0.03, 0.01, MATERIALS.bay, cx, fl + H * 0.37, s * zw);
5604
+ c.roundBox(L - 0.034, H * 0.75, 0.03, 0.01, MATERIALS.bay, x0 + 0.03 + (L - 0.034) / 2, fl + H * 0.37, s * zw);
5604
5605
  });
5605
5606
  const rx = x1 - 0.06;
5606
5607
  const rh = H * 0.82;
5607
5608
  const rad = c.roundBox(0.05, rh, zw * 1.5, 0.012, MATERIALS.radiator, rx, fl + rh / 2 + 0.02, 0);
5608
- for (let f = 0; f < 6; f++) c.roundBox(0.054, 6e-3, zw * 1.46, 2e-3, MATERIALS.steel, rx, fl + 0.06 + f * (rh - 0.06) / 6, 0);
5609
+ for (let f = 0; f < 6; f++) c.roundBox(0.062, 6e-3, zw * 1.46, 2e-3, MATERIALS.steel, rx, fl + 0.06 + f * (rh - 0.06) / 6, 0);
5609
5610
  c.roundBox(0.07, 0.04, zw * 1.5, 0.015, MATERIALS.plastic, rx, fl + rh + 0.03, 0);
5610
5611
  out.rad = new V3(rx, fl + rh / 2, 0);
5611
5612
  const fanR = Math.min(rh * 0.42, zw * 0.45);
@@ -5644,8 +5645,9 @@ var GameVehicles = (() => {
5644
5645
  }
5645
5646
  function battery(x, y, z, sc) {
5646
5647
  sc = sc || 1;
5648
+ x = Math.max(x, x0 + 0.034 + 0.1 * sc);
5647
5649
  c.roundBox(0.2 * sc, 0.15 * sc, 0.15 * sc, 0.015, makeMaterial("#1a1b1c", { roughness: 0.5 }), x, y, z);
5648
- c.roundBox(0.2 * sc, 0.012, 0.15 * sc, 5e-3, makeMaterial("#2e3a6a", { roughness: 0.5 }), x, y + 0.04 * sc, z);
5650
+ c.roundBox(0.2 * sc + 8e-3, 0.012, 0.15 * sc + 8e-3, 5e-3, makeMaterial("#2e3a6a", { roughness: 0.5 }), x, y + 0.04 * sc, z);
5649
5651
  c.cylinder(0.016, 0.018, 0.03, MATERIALS.postRed, x + 0.06 * sc, y + 0.09 * sc, z + 0.045 * sc);
5650
5652
  c.cylinder(0.016, 0.018, 0.03, MATERIALS.postBlack, x + 0.06 * sc, y + 0.09 * sc, z - 0.045 * sc);
5651
5653
  c.tube(
@@ -5664,7 +5666,7 @@ var GameVehicles = (() => {
5664
5666
  reservoir(x0 + 0.12, uy - 0.04, -zw * 0.55, 0.07, 0.06, 0.07, MATERIALS.coolant, makeMaterial("#c9b26a", { roughness: 0.3 }), MATERIALS.yellow);
5665
5667
  reservoir(x1 - 0.2, fl + H * 0.45, zw * 0.72, 0.12, 0.13, 0.1, MATERIALS.washer, makeMaterial("#3f8fc0", { roughness: 0.3 }), MATERIALS.capBlue);
5666
5668
  c.roundBox(0.12, 0.07, 0.13, 0.015, MATERIALS.plastic, x0 + 0.18, uy - 0.02, -zw * 0.78);
5667
- c.roundBox(0.12, 6e-3, 0.13, 3e-3, MATERIALS.dark, x0 + 0.18, uy + 0.017, -zw * 0.78);
5669
+ c.roundBox(0.116, 6e-3, 0.126, 3e-3, MATERIALS.dark, x0 + 0.18, uy + 0.017, -zw * 0.78);
5668
5670
  if (mot === "electric") {
5669
5671
  const fx0 = x0 + L * 0.4;
5670
5672
  const fx1 = x1 - 0.14;
@@ -5817,7 +5819,7 @@ var GameVehicles = (() => {
5817
5819
  const afx = x1 - L * 0.32;
5818
5820
  const afy = Math.min(top - 0.07, fl + H * 0.7);
5819
5821
  c.roundBox(0.22, 0.1, 0.26, 0.03, MATERIALS.plastic, afx, afy, zw * 0.5);
5820
- c.roundBox(0.22, 0.012, 0.26, 4e-3, MATERIALS.dark, afx, afy + 0.01, zw * 0.5);
5822
+ c.roundBox(0.224, 0.012, 0.264, 4e-3, MATERIALS.dark, afx, afy + 0.01, zw * 0.5);
5821
5823
  c.tube(
5822
5824
  [
5823
5825
  [afx - 0.11, afy, zw * 0.4],
@@ -6157,7 +6159,7 @@ var GameVehicles = (() => {
6157
6159
  const gr = Object.assign({ style: "bars", w: W * 0.44, h: Math.max(0.08, hy - bumperY - 0.12) }, s.grille || {});
6158
6160
  const gy = gr.y || (bumperY + hy) / 2 + 0.02;
6159
6161
  const gx = I.profX(it, gy, true);
6160
- kit.grille(c, { style: gr.style, x: gx + 0.025, y: gy, w: gr.w, h: gr.h, col: s.col, emblem: gr.emblem });
6162
+ kit.grille(c, { style: gr.style, x: gx + 0.027, y: gy, w: gr.w, h: gr.h, col: s.col, emblem: gr.emblem, emblemBack: gr.emblemBack });
6161
6163
  } else kit.emblem(c, I.profX(it, hy + 0.02, true) + 0.055, hy + 0.02, 0, 0.04);
6162
6164
  const tl = Object.assign({ style: "wrap", w: s.tailW || 0.3, h: s.tailH || 0.14, in: 0.05 }, s.tl || {});
6163
6165
  const ty = tl.y || s.tailLightY || s.tailY - 0.05;