@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.js CHANGED
@@ -2788,6 +2788,7 @@ function installLights(kit) {
2788
2788
  kit.halo = halo;
2789
2789
  function lampKit(g, d, inner, lens, lensMat, refl) {
2790
2790
  refl = refl || MATERIALS.reflector;
2791
+ let nProj = 0;
2791
2792
  return {
2792
2793
  housing: function(w, h, y, z, geoFn) {
2793
2794
  const geo = roundedBoxGeometry(d, h, w, Math.min(0.03, h * 0.4));
@@ -2808,7 +2809,7 @@ function installLights(kit) {
2808
2809
  return m;
2809
2810
  },
2810
2811
  proj: function(y, z, r, mat) {
2811
- const bz = gm(g, new THREE.CylinderGeometry(r * 1.3, r * 1.45, 0.03, 18), refl, d / 2 - 0.03, y, z);
2812
+ 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);
2812
2813
  bz.rotation.z = -PI / 2;
2813
2814
  if (refl !== MATERIALS.reflector) inner.push(bz);
2814
2815
  const e = gm(g, new THREE.SphereGeometry(r, 14, 10), mat, d / 2 - 0.022, y, z);
@@ -2988,10 +2989,10 @@ function installLights(kit) {
2988
2989
  (parent || c.vehicle).add(g);
2989
2990
  const d1 = gm(g, new THREE.CylinderGeometry(r, r, 0.012, 24), MATERIALS.chrome);
2990
2991
  d1.rotation.z = PI / 2;
2991
- const d2 = gm(g, new THREE.CylinderGeometry(r * 0.78, r * 0.78, 0.014, 24), MATERIALS.trim);
2992
+ const d2 = gm(g, new THREE.CylinderGeometry(r * 0.78, r * 0.78, 0.018, 24), MATERIALS.trim);
2992
2993
  d2.rotation.z = PI / 2;
2993
- gm(g, roundedBoxGeometry(0.016, r * 0.32, r * 1.4, 5e-3), MATERIALS.chrome);
2994
- gm(g, roundedBoxGeometry(0.016, r * 1, r * 0.22, 5e-3), MATERIALS.chrome, 0, 0, r * 0.25).rotation.x = 0.5;
2994
+ gm(g, roundedBoxGeometry(0.024, r * 0.32, r * 1.4, 5e-3), MATERIALS.chrome);
2995
+ gm(g, roundedBoxGeometry(0.03, r * 1, r * 0.22, 5e-3), MATERIALS.chrome, 0, 0, r * 0.25).rotation.x = 0.5;
2995
2996
  return g;
2996
2997
  };
2997
2998
  kit.grille = function(c, o) {
@@ -3044,7 +3045,7 @@ function installLights(kit) {
3044
3045
  g.children.forEach(function(m) {
3045
3046
  m.castShadow = true;
3046
3047
  });
3047
- if (o.emblem !== false) kit.emblem(c, 0.05, st === "closed" ? h * 0.12 : 0, 0, Math.min(0.05, h * 0.3), g);
3048
+ 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);
3048
3049
  return g;
3049
3050
  };
3050
3051
  const shared = { lampGroup, gm, wedgeY, haloTex, glowTexture, haloMats, halo, lampKit };
@@ -3291,7 +3292,7 @@ function installInterior(kit) {
3291
3292
  } 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" });
3292
3293
  const trimLen = Math.min(0.8, (o.rowPitch ?? 0.88) - 0.06);
3293
3294
  [-1, 1].forEach(function(s) {
3294
- c.roundBox(trimLen, belt - fl - 0.08, 0.035, 0.015, trim, x + 0.12, (belt + fl) / 2 + 0.02, s * (zi + 0.02));
3295
+ 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));
3295
3296
  c.roundBox(0.3, 0.05, 0.07, 0.02, fab, x + 0.16, fl + seatH + 0.16, s * (zi - 0.015));
3296
3297
  c.roundBox(0.08, 0.025, 0.02, 8e-3, MATERIALS.chrome, x + 0.36, belt - 0.11, s * (zi - 5e-3));
3297
3298
  });
@@ -3716,15 +3717,15 @@ function installHood(kit) {
3716
3717
  const cx = (x0 + x1) / 2;
3717
3718
  const paint = c.paint(o.col || c.meta.color || "#666");
3718
3719
  const out = {};
3719
- c.roundBox(L, 0.03, 2 * zw, 0.01, MATERIALS.bay, cx, fl, 0);
3720
+ c.roundBox(L - 0.03, 0.03, 2 * zw, 0.01, MATERIALS.bay, cx + 0.015, fl, 0);
3720
3721
  c.roundBox(0.03, H + 0.04, 2 * zw, 0.01, MATERIALS.bay, x0 + 0.015, fl + H / 2, 0);
3721
3722
  [1, -1].forEach(function(s) {
3722
- c.roundBox(L, H * 0.75, 0.03, 0.01, MATERIALS.bay, cx, fl + H * 0.37, s * zw);
3723
+ 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);
3723
3724
  });
3724
3725
  const rx = x1 - 0.06;
3725
3726
  const rh = H * 0.82;
3726
3727
  const rad = c.roundBox(0.05, rh, zw * 1.5, 0.012, MATERIALS.radiator, rx, fl + rh / 2 + 0.02, 0);
3727
- 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);
3728
+ 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);
3728
3729
  c.roundBox(0.07, 0.04, zw * 1.5, 0.015, MATERIALS.plastic, rx, fl + rh + 0.03, 0);
3729
3730
  out.rad = new V3(rx, fl + rh / 2, 0);
3730
3731
  const fanR = Math.min(rh * 0.42, zw * 0.45);
@@ -3763,8 +3764,9 @@ function installHood(kit) {
3763
3764
  }
3764
3765
  function battery(x, y, z, sc) {
3765
3766
  sc = sc || 1;
3767
+ x = Math.max(x, x0 + 0.034 + 0.1 * sc);
3766
3768
  c.roundBox(0.2 * sc, 0.15 * sc, 0.15 * sc, 0.015, makeMaterial("#1a1b1c", { roughness: 0.5 }), x, y, z);
3767
- c.roundBox(0.2 * sc, 0.012, 0.15 * sc, 5e-3, makeMaterial("#2e3a6a", { roughness: 0.5 }), x, y + 0.04 * sc, z);
3769
+ 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);
3768
3770
  c.cylinder(0.016, 0.018, 0.03, MATERIALS.postRed, x + 0.06 * sc, y + 0.09 * sc, z + 0.045 * sc);
3769
3771
  c.cylinder(0.016, 0.018, 0.03, MATERIALS.postBlack, x + 0.06 * sc, y + 0.09 * sc, z - 0.045 * sc);
3770
3772
  c.tube(
@@ -3783,7 +3785,7 @@ function installHood(kit) {
3783
3785
  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);
3784
3786
  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);
3785
3787
  c.roundBox(0.12, 0.07, 0.13, 0.015, MATERIALS.plastic, x0 + 0.18, uy - 0.02, -zw * 0.78);
3786
- c.roundBox(0.12, 6e-3, 0.13, 3e-3, MATERIALS.dark, x0 + 0.18, uy + 0.017, -zw * 0.78);
3788
+ c.roundBox(0.116, 6e-3, 0.126, 3e-3, MATERIALS.dark, x0 + 0.18, uy + 0.017, -zw * 0.78);
3787
3789
  if (mot === "electric") {
3788
3790
  const fx0 = x0 + L * 0.4;
3789
3791
  const fx1 = x1 - 0.14;
@@ -3936,7 +3938,7 @@ function installHood(kit) {
3936
3938
  const afx = x1 - L * 0.32;
3937
3939
  const afy = Math.min(top - 0.07, fl + H * 0.7);
3938
3940
  c.roundBox(0.22, 0.1, 0.26, 0.03, MATERIALS.plastic, afx, afy, zw * 0.5);
3939
- c.roundBox(0.22, 0.012, 0.26, 4e-3, MATERIALS.dark, afx, afy + 0.01, zw * 0.5);
3941
+ c.roundBox(0.224, 0.012, 0.264, 4e-3, MATERIALS.dark, afx, afy + 0.01, zw * 0.5);
3940
3942
  c.tube(
3941
3943
  [
3942
3944
  [afx - 0.11, afy, zw * 0.4],
@@ -4276,7 +4278,7 @@ function installCar(kit) {
4276
4278
  const gr = Object.assign({ style: "bars", w: W * 0.44, h: Math.max(0.08, hy - bumperY - 0.12) }, s.grille || {});
4277
4279
  const gy = gr.y || (bumperY + hy) / 2 + 0.02;
4278
4280
  const gx = I.profX(it, gy, true);
4279
- kit.grille(c, { style: gr.style, x: gx + 0.025, y: gy, w: gr.w, h: gr.h, col: s.col, emblem: gr.emblem });
4281
+ 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 });
4280
4282
  } else kit.emblem(c, I.profX(it, hy + 0.02, true) + 0.055, hy + 0.02, 0, 0.04);
4281
4283
  const tl = Object.assign({ style: "wrap", w: s.tailW || 0.3, h: s.tailH || 0.14, in: 0.05 }, s.tl || {});
4282
4284
  const ty = tl.y || s.tailLightY || s.tailY - 0.05;