@adatechnology/game-vehicles 0.7.2 → 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/chunk-AQFQ246K.js +571 -0
- package/dist/chunk-AQFQ246K.js.map +1 -0
- package/dist/index.d.ts +56 -2
- package/dist/index.global.js +599 -35
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +46 -16
- package/dist/index.js.map +1 -1
- package/dist/worker-kinds-DlhpT_p3.d.ts +90 -0
- package/dist/worker-kinds.d.ts +2 -0
- package/dist/worker-kinds.js +9 -0
- package/dist/worker-kinds.js.map +1 -0
- package/package.json +9 -5
package/dist/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
FLAT_PAD,
|
|
3
|
+
FLOATING_AREA,
|
|
4
|
+
MAX_HULL_POINTS,
|
|
5
|
+
__publicField,
|
|
6
|
+
convexFaces,
|
|
7
|
+
hullOf,
|
|
8
|
+
hullPlanKind,
|
|
9
|
+
hullVolume,
|
|
10
|
+
leavesOf,
|
|
11
|
+
newHullPlan,
|
|
12
|
+
planDivision,
|
|
13
|
+
planHulls,
|
|
14
|
+
protrusionsOf,
|
|
15
|
+
reducePoints,
|
|
16
|
+
unitsOf
|
|
17
|
+
} from "./chunk-AQFQ246K.js";
|
|
4
18
|
|
|
5
19
|
// src/kit.ts
|
|
6
20
|
import { shapeGeometries } from "@adatechnology/game-shapes-three";
|
|
@@ -2774,6 +2788,7 @@ function installLights(kit) {
|
|
|
2774
2788
|
kit.halo = halo;
|
|
2775
2789
|
function lampKit(g, d, inner, lens, lensMat, refl) {
|
|
2776
2790
|
refl = refl || MATERIALS.reflector;
|
|
2791
|
+
let nProj = 0;
|
|
2777
2792
|
return {
|
|
2778
2793
|
housing: function(w, h, y, z, geoFn) {
|
|
2779
2794
|
const geo = roundedBoxGeometry(d, h, w, Math.min(0.03, h * 0.4));
|
|
@@ -2794,7 +2809,7 @@ function installLights(kit) {
|
|
|
2794
2809
|
return m;
|
|
2795
2810
|
},
|
|
2796
2811
|
proj: function(y, z, r, mat) {
|
|
2797
|
-
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);
|
|
2798
2813
|
bz.rotation.z = -PI / 2;
|
|
2799
2814
|
if (refl !== MATERIALS.reflector) inner.push(bz);
|
|
2800
2815
|
const e = gm(g, new THREE.SphereGeometry(r, 14, 10), mat, d / 2 - 0.022, y, z);
|
|
@@ -2974,10 +2989,10 @@ function installLights(kit) {
|
|
|
2974
2989
|
(parent || c.vehicle).add(g);
|
|
2975
2990
|
const d1 = gm(g, new THREE.CylinderGeometry(r, r, 0.012, 24), MATERIALS.chrome);
|
|
2976
2991
|
d1.rotation.z = PI / 2;
|
|
2977
|
-
const d2 = gm(g, new THREE.CylinderGeometry(r * 0.78, r * 0.78, 0.
|
|
2992
|
+
const d2 = gm(g, new THREE.CylinderGeometry(r * 0.78, r * 0.78, 0.018, 24), MATERIALS.trim);
|
|
2978
2993
|
d2.rotation.z = PI / 2;
|
|
2979
|
-
gm(g, roundedBoxGeometry(0.
|
|
2980
|
-
gm(g, roundedBoxGeometry(0.
|
|
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;
|
|
2981
2996
|
return g;
|
|
2982
2997
|
};
|
|
2983
2998
|
kit.grille = function(c, o) {
|
|
@@ -3030,7 +3045,7 @@ function installLights(kit) {
|
|
|
3030
3045
|
g.children.forEach(function(m) {
|
|
3031
3046
|
m.castShadow = true;
|
|
3032
3047
|
});
|
|
3033
|
-
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);
|
|
3034
3049
|
return g;
|
|
3035
3050
|
};
|
|
3036
3051
|
const shared = { lampGroup, gm, wedgeY, haloTex, glowTexture, haloMats, halo, lampKit };
|
|
@@ -3277,7 +3292,7 @@ function installInterior(kit) {
|
|
|
3277
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" });
|
|
3278
3293
|
const trimLen = Math.min(0.8, (o.rowPitch ?? 0.88) - 0.06);
|
|
3279
3294
|
[-1, 1].forEach(function(s) {
|
|
3280
|
-
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));
|
|
3281
3296
|
c.roundBox(0.3, 0.05, 0.07, 0.02, fab, x + 0.16, fl + seatH + 0.16, s * (zi - 0.015));
|
|
3282
3297
|
c.roundBox(0.08, 0.025, 0.02, 8e-3, MATERIALS.chrome, x + 0.36, belt - 0.11, s * (zi - 5e-3));
|
|
3283
3298
|
});
|
|
@@ -3702,15 +3717,15 @@ function installHood(kit) {
|
|
|
3702
3717
|
const cx = (x0 + x1) / 2;
|
|
3703
3718
|
const paint = c.paint(o.col || c.meta.color || "#666");
|
|
3704
3719
|
const out = {};
|
|
3705
|
-
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);
|
|
3706
3721
|
c.roundBox(0.03, H + 0.04, 2 * zw, 0.01, MATERIALS.bay, x0 + 0.015, fl + H / 2, 0);
|
|
3707
3722
|
[1, -1].forEach(function(s) {
|
|
3708
|
-
c.roundBox(L, H * 0.75, 0.03, 0.01, MATERIALS.bay,
|
|
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);
|
|
3709
3724
|
});
|
|
3710
3725
|
const rx = x1 - 0.06;
|
|
3711
3726
|
const rh = H * 0.82;
|
|
3712
3727
|
const rad = c.roundBox(0.05, rh, zw * 1.5, 0.012, MATERIALS.radiator, rx, fl + rh / 2 + 0.02, 0);
|
|
3713
|
-
for (let f = 0; f < 6; f++) c.roundBox(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);
|
|
3714
3729
|
c.roundBox(0.07, 0.04, zw * 1.5, 0.015, MATERIALS.plastic, rx, fl + rh + 0.03, 0);
|
|
3715
3730
|
out.rad = new V3(rx, fl + rh / 2, 0);
|
|
3716
3731
|
const fanR = Math.min(rh * 0.42, zw * 0.45);
|
|
@@ -3749,8 +3764,9 @@ function installHood(kit) {
|
|
|
3749
3764
|
}
|
|
3750
3765
|
function battery(x, y, z, sc) {
|
|
3751
3766
|
sc = sc || 1;
|
|
3767
|
+
x = Math.max(x, x0 + 0.034 + 0.1 * sc);
|
|
3752
3768
|
c.roundBox(0.2 * sc, 0.15 * sc, 0.15 * sc, 0.015, makeMaterial("#1a1b1c", { roughness: 0.5 }), x, y, z);
|
|
3753
|
-
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);
|
|
3754
3770
|
c.cylinder(0.016, 0.018, 0.03, MATERIALS.postRed, x + 0.06 * sc, y + 0.09 * sc, z + 0.045 * sc);
|
|
3755
3771
|
c.cylinder(0.016, 0.018, 0.03, MATERIALS.postBlack, x + 0.06 * sc, y + 0.09 * sc, z - 0.045 * sc);
|
|
3756
3772
|
c.tube(
|
|
@@ -3769,7 +3785,7 @@ function installHood(kit) {
|
|
|
3769
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);
|
|
3770
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);
|
|
3771
3787
|
c.roundBox(0.12, 0.07, 0.13, 0.015, MATERIALS.plastic, x0 + 0.18, uy - 0.02, -zw * 0.78);
|
|
3772
|
-
c.roundBox(0.
|
|
3788
|
+
c.roundBox(0.116, 6e-3, 0.126, 3e-3, MATERIALS.dark, x0 + 0.18, uy + 0.017, -zw * 0.78);
|
|
3773
3789
|
if (mot === "electric") {
|
|
3774
3790
|
const fx0 = x0 + L * 0.4;
|
|
3775
3791
|
const fx1 = x1 - 0.14;
|
|
@@ -3922,7 +3938,7 @@ function installHood(kit) {
|
|
|
3922
3938
|
const afx = x1 - L * 0.32;
|
|
3923
3939
|
const afy = Math.min(top - 0.07, fl + H * 0.7);
|
|
3924
3940
|
c.roundBox(0.22, 0.1, 0.26, 0.03, MATERIALS.plastic, afx, afy, zw * 0.5);
|
|
3925
|
-
c.roundBox(0.
|
|
3941
|
+
c.roundBox(0.224, 0.012, 0.264, 4e-3, MATERIALS.dark, afx, afy + 0.01, zw * 0.5);
|
|
3926
3942
|
c.tube(
|
|
3927
3943
|
[
|
|
3928
3944
|
[afx - 0.11, afy, zw * 0.4],
|
|
@@ -4262,7 +4278,7 @@ function installCar(kit) {
|
|
|
4262
4278
|
const gr = Object.assign({ style: "bars", w: W * 0.44, h: Math.max(0.08, hy - bumperY - 0.12) }, s.grille || {});
|
|
4263
4279
|
const gy = gr.y || (bumperY + hy) / 2 + 0.02;
|
|
4264
4280
|
const gx = I.profX(it, gy, true);
|
|
4265
|
-
kit.grille(c, { style: gr.style, x: gx + 0.
|
|
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 });
|
|
4266
4282
|
} else kit.emblem(c, I.profX(it, hy + 0.02, true) + 0.055, hy + 0.02, 0, 0.04);
|
|
4267
4283
|
const tl = Object.assign({ style: "wrap", w: s.tailW || 0.3, h: s.tailH || 0.14, in: 0.05 }, s.tl || {});
|
|
4268
4284
|
const ty = tl.y || s.tailLightY || s.tailY - 0.05;
|
|
@@ -15946,9 +15962,12 @@ export {
|
|
|
15946
15962
|
DOOR_SHELL_DEPTH,
|
|
15947
15963
|
DOOR_SHELL_MAX_DEPTH,
|
|
15948
15964
|
ENTRY_DUCK_FACTOR,
|
|
15965
|
+
FLAT_PAD,
|
|
15966
|
+
FLOATING_AREA,
|
|
15949
15967
|
JOINT_RULES,
|
|
15950
15968
|
LEGACY_STATES,
|
|
15951
15969
|
LEGACY_ZONE_IDS,
|
|
15970
|
+
MAX_HULL_POINTS,
|
|
15952
15971
|
PLUME_PUFFS,
|
|
15953
15972
|
RAIN_MOVE_STEP,
|
|
15954
15973
|
RAIN_OPENING_DIAMETER,
|
|
@@ -15964,6 +15983,7 @@ export {
|
|
|
15964
15983
|
cabinEnclosure,
|
|
15965
15984
|
cabinMinimumOf,
|
|
15966
15985
|
clamp,
|
|
15986
|
+
convexFaces,
|
|
15967
15987
|
crackedGlassMaterial,
|
|
15968
15988
|
crashDeltaV,
|
|
15969
15989
|
crashVehicle,
|
|
@@ -15979,11 +15999,20 @@ export {
|
|
|
15979
15999
|
engineBayVent,
|
|
15980
16000
|
format,
|
|
15981
16001
|
hash,
|
|
16002
|
+
hullOf,
|
|
16003
|
+
hullPlanKind,
|
|
16004
|
+
hullVolume,
|
|
16005
|
+
leavesOf,
|
|
15982
16006
|
legacyGlassId,
|
|
15983
16007
|
legacyLightId,
|
|
15984
16008
|
legacyZoneId,
|
|
15985
16009
|
listLocales,
|
|
16010
|
+
newHullPlan,
|
|
15986
16011
|
openEdgeCount,
|
|
16012
|
+
planDivision,
|
|
16013
|
+
planHulls,
|
|
16014
|
+
protrusionsOf,
|
|
16015
|
+
reducePoints,
|
|
15987
16016
|
registerLegacySeeds,
|
|
15988
16017
|
registerLocale,
|
|
15989
16018
|
resolveStrings,
|
|
@@ -15995,6 +16024,7 @@ export {
|
|
|
15995
16024
|
strHash,
|
|
15996
16025
|
strayLampsOf,
|
|
15997
16026
|
swingOf,
|
|
16027
|
+
unitsOf,
|
|
15998
16028
|
wrapThreeForLod
|
|
15999
16029
|
};
|
|
16000
16030
|
//# sourceMappingURL=index.js.map
|