@adatechnology/game-vehicles-three 0.8.1 → 0.8.2
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-NPS4X64L.js → chunk-C7FZFX3K.js} +7 -4
- package/dist/chunk-C7FZFX3K.js.map +1 -0
- package/dist/index.global.js +56 -31
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/package.json +7 -7
- package/dist/chunk-NPS4X64L.js.map +0 -1
package/dist/index.global.js
CHANGED
|
@@ -5985,7 +5985,7 @@ var GameVehiclesThree = (() => {
|
|
|
5985
5985
|
c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
|
|
5986
5986
|
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));
|
|
5987
5987
|
(s.seams || []).forEach(function(q) {
|
|
5988
|
-
const x =
|
|
5988
|
+
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;
|
|
5989
5989
|
c.roundBox(8e-3, y1 - y0, 6e-3, 3e-3, MT.dark, x, (y0 + y1) / 2, sd * (hw + 1e-3));
|
|
5990
5990
|
});
|
|
5991
5991
|
(s.handles || []).forEach(function(x) {
|
|
@@ -16536,7 +16536,7 @@ var GameVehiclesThree = (() => {
|
|
|
16536
16536
|
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 });
|
|
16537
16537
|
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 });
|
|
16538
16538
|
}
|
|
16539
|
-
const f = sd > 0 ? "+z" : "-z", pt = Gd.at(
|
|
16539
|
+
const f = sd > 0 ? "+z" : "-z", pt = Gd.at(0.5, 0.62).p;
|
|
16540
16540
|
if (highwayPolice)
|
|
16541
16541
|
c2.text(trl("texts.federal_highway_police"), 1.9, 0.13, -0.32, 0.6, sd * (Math.abs(pt.z) + 0.012), f, {
|
|
16542
16542
|
fg: blueP,
|
|
@@ -17618,7 +17618,8 @@ var GameVehiclesThree = (() => {
|
|
|
17618
17618
|
const fw = kit.spokedWheel(c, 0.78, 0.325, 0.06, { spokes: 40, knobby: true, disc: true, label: trl("labels.front_tire") });
|
|
17619
17619
|
const rw = kit.spokedWheel(c, -0.72, 0.318, 0.08, { spokes: 40, knobby: true, label: trl("labels.rear_tire") });
|
|
17620
17620
|
[fw, rw].forEach(function(g) {
|
|
17621
|
-
g.children.forEach(function(
|
|
17621
|
+
g.children.forEach(function(o) {
|
|
17622
|
+
const ch = o;
|
|
17622
17623
|
if (ch.geometry && ch.geometry.type === "TorusGeometry" && ch.material === MT.chrome) ch.material = rimGold;
|
|
17623
17624
|
});
|
|
17624
17625
|
});
|
|
@@ -20139,13 +20140,9 @@ var GameVehiclesThree = (() => {
|
|
|
20139
20140
|
}
|
|
20140
20141
|
);
|
|
20141
20142
|
}
|
|
20142
|
-
function
|
|
20143
|
-
const kit = fx.kit;
|
|
20143
|
+
function createPlanesKit(kit) {
|
|
20144
20144
|
const THREE = kit.THREE;
|
|
20145
|
-
const
|
|
20146
|
-
const trl = fx.t;
|
|
20147
|
-
const lbl = fx.label;
|
|
20148
|
-
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
|
|
20145
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial;
|
|
20149
20146
|
function pose3(Af, ra, Tf, rt) {
|
|
20150
20147
|
let lo = 0, hi = 0.5, TH = 0;
|
|
20151
20148
|
function f(t) {
|
|
@@ -20294,7 +20291,7 @@ var GameVehiclesThree = (() => {
|
|
|
20294
20291
|
m.rotation.y += -s * Math.atan2(a - b, w);
|
|
20295
20292
|
return m;
|
|
20296
20293
|
}
|
|
20297
|
-
|
|
20294
|
+
return {
|
|
20298
20295
|
pose3,
|
|
20299
20296
|
starDecal,
|
|
20300
20297
|
rrect,
|
|
@@ -20308,6 +20305,17 @@ var GameVehiclesThree = (() => {
|
|
|
20308
20305
|
liner,
|
|
20309
20306
|
sideText
|
|
20310
20307
|
};
|
|
20308
|
+
}
|
|
20309
|
+
function installPlanesExtra(fx) {
|
|
20310
|
+
const kit = fx.kit;
|
|
20311
|
+
const THREE = kit.THREE;
|
|
20312
|
+
const shared2 = fx.shared;
|
|
20313
|
+
const trl = fx.t;
|
|
20314
|
+
const lbl = fx.label;
|
|
20315
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
|
|
20316
|
+
const GH = createPlanesKit(kit);
|
|
20317
|
+
shared2.GH = GH;
|
|
20318
|
+
const { pose3, starDecal, rrect, polysSdf, pod, fSkin, fGlass, liner, sideText } = GH;
|
|
20311
20319
|
fx.register(
|
|
20312
20320
|
{
|
|
20313
20321
|
key: "tandem_trainer",
|
|
@@ -22297,7 +22305,8 @@ var GameVehiclesThree = (() => {
|
|
|
22297
22305
|
if (msh && msh.parent) warp(msh);
|
|
22298
22306
|
});
|
|
22299
22307
|
const bb = new THREE.Box3(), cen = new V3(), sz = new V3();
|
|
22300
|
-
c.vehicle.children.slice().forEach(function(
|
|
22308
|
+
c.vehicle.children.slice().forEach(function(o3) {
|
|
22309
|
+
const ob = o3;
|
|
22301
22310
|
if (skip.has(ob) || warpSet.has(ob)) return;
|
|
22302
22311
|
if (ob.isMesh) {
|
|
22303
22312
|
const g = ob.geometry;
|
|
@@ -22512,7 +22521,8 @@ var GameVehiclesThree = (() => {
|
|
|
22512
22521
|
}
|
|
22513
22522
|
function plateOutside(c) {
|
|
22514
22523
|
const m = c.meta;
|
|
22515
|
-
c.vehicle.children.forEach(function(
|
|
22524
|
+
c.vehicle.children.forEach(function(o3) {
|
|
22525
|
+
const o = o3;
|
|
22516
22526
|
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)
|
|
22517
22527
|
o.position.x = Math.min(o.position.x, m.rear - BV * 0.5) - BV * 0.62;
|
|
22518
22528
|
});
|
|
@@ -22682,7 +22692,8 @@ var GameVehiclesThree = (() => {
|
|
|
22682
22692
|
}
|
|
22683
22693
|
c.root.updateMatrixWorld(true);
|
|
22684
22694
|
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();
|
|
22685
|
-
c.vehicle.traverse(function(
|
|
22695
|
+
c.vehicle.traverse(function(o3) {
|
|
22696
|
+
const ob = o3;
|
|
22686
22697
|
if (!ob.isMesh || done.has(ob.geometry)) return;
|
|
22687
22698
|
done.add(ob.geometry);
|
|
22688
22699
|
rel.multiplyMatrices(gInv, ob.matrixWorld);
|
|
@@ -22748,7 +22759,8 @@ var GameVehiclesThree = (() => {
|
|
|
22748
22759
|
c.lights.forEach(function(L) {
|
|
22749
22760
|
if (!L.group || L.group.userData.recessed) return;
|
|
22750
22761
|
L.group.userData.recessed = true;
|
|
22751
|
-
L.group.children.slice().forEach(function(
|
|
22762
|
+
L.group.children.slice().forEach(function(o3) {
|
|
22763
|
+
const h = o3;
|
|
22752
22764
|
if (!h.isMesh || h.material !== MT.housing || h.geometry.type !== "BoxGeometry" || Math.abs(h.position.x) > 1e-3) return;
|
|
22753
22765
|
h.geometry.computeBoundingBox();
|
|
22754
22766
|
const bb = h.geometry.boundingBox, d = bb.max.x - bb.min.x;
|
|
@@ -22779,7 +22791,8 @@ var GameVehiclesThree = (() => {
|
|
|
22779
22791
|
const cols = [m.color, m.roofCol].filter(Boolean).map(function(h) {
|
|
22780
22792
|
return new THREE.Color(h).getHex();
|
|
22781
22793
|
});
|
|
22782
|
-
c.vehicle.children.forEach(function(
|
|
22794
|
+
c.vehicle.children.forEach(function(o3) {
|
|
22795
|
+
const o = o3;
|
|
22783
22796
|
if (!o.isMesh || gl.has(o) || o.geometry.type !== "BoxGeometry" || o.material === MT.trim || o.material === MT.chrome || o.material.transparent)
|
|
22784
22797
|
return;
|
|
22785
22798
|
if (o.material.color && cols.indexOf(o.material.color.getHex()) >= 0) return;
|
|
@@ -23623,7 +23636,8 @@ var GameVehiclesThree = (() => {
|
|
|
23623
23636
|
},
|
|
23624
23637
|
post: function(c2, _m) {
|
|
23625
23638
|
const gfx = fX(s, 0.8) + 0.04;
|
|
23626
|
-
c2.vehicle.children.forEach(function(
|
|
23639
|
+
c2.vehicle.children.forEach(function(o3) {
|
|
23640
|
+
const o = o3;
|
|
23627
23641
|
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)
|
|
23628
23642
|
o.position.x = Math.max(o.position.x, gfx);
|
|
23629
23643
|
});
|
|
@@ -23958,7 +23972,7 @@ var GameVehiclesThree = (() => {
|
|
|
23958
23972
|
kit.sideWindows(c, [cab], W, T, function() {
|
|
23959
23973
|
return lbl("cab_window");
|
|
23960
23974
|
});
|
|
23961
|
-
winS.forEach(function(w
|
|
23975
|
+
winS.forEach(function(w) {
|
|
23962
23976
|
kit.sideWindows(
|
|
23963
23977
|
c,
|
|
23964
23978
|
[w.p],
|
|
@@ -24151,7 +24165,8 @@ var GameVehiclesThree = (() => {
|
|
|
24151
24165
|
fxKey: "lid",
|
|
24152
24166
|
dir: "front"
|
|
24153
24167
|
});
|
|
24154
|
-
c.vehicle.children.forEach(function(
|
|
24168
|
+
c.vehicle.children.forEach(function(o3) {
|
|
24169
|
+
const o = o3;
|
|
24155
24170
|
if (o.isMesh && o.geometry.type === "PlaneGeometry" && o.material.map && o.material.map.image && o.material.map.image.width === 400 && o.position.x < 0)
|
|
24156
24171
|
o.position.y = 0.84;
|
|
24157
24172
|
});
|
|
@@ -24202,7 +24217,7 @@ var GameVehiclesThree = (() => {
|
|
|
24202
24217
|
grille: { style: "truck", w: 0.84, h: 0.28, y: 0.86 },
|
|
24203
24218
|
seams: [1.62, 0.44],
|
|
24204
24219
|
handles: [0.6],
|
|
24205
|
-
extra: function(c2, m
|
|
24220
|
+
extra: function(c2, m) {
|
|
24206
24221
|
const fx2 = kit.profX(m.vanLow, 0.86, true);
|
|
24207
24222
|
kit.emblem(c2, fx2 + 0.1, 0.86, 0, 0.1);
|
|
24208
24223
|
const bfx = kit.profX(m.vanLow, 0.56, true);
|
|
@@ -24233,7 +24248,8 @@ var GameVehiclesThree = (() => {
|
|
|
24233
24248
|
[cx0 + 0.9, 0.82, -0.3, "#7a5c3a"],
|
|
24234
24249
|
[cx0 + 0.6, 1.18, -0.3, "#8a6a44"],
|
|
24235
24250
|
[cx0 + 1.6, 0.82, 0, "#6d5232"]
|
|
24236
|
-
].forEach(function(
|
|
24251
|
+
].forEach(function(q) {
|
|
24252
|
+
const b = q;
|
|
24237
24253
|
c2.roundBox(0.5, 0.4, 0.5, 0.02, CM(b[3], { roughness: 0.9 }), b[0], b[1], b[2]);
|
|
24238
24254
|
});
|
|
24239
24255
|
c2.part("cargo", trl("labels.cargo_box"), null, new V3(m.rear + 1.4, 1.2, 0), 1.3);
|
|
@@ -24518,13 +24534,9 @@ var GameVehiclesThree = (() => {
|
|
|
24518
24534
|
}
|
|
24519
24535
|
);
|
|
24520
24536
|
}
|
|
24521
|
-
function
|
|
24522
|
-
const kit = fx.kit;
|
|
24537
|
+
function createWaterAirKit(kit) {
|
|
24523
24538
|
const THREE = kit.THREE;
|
|
24524
|
-
const
|
|
24525
|
-
const trl = fx.t;
|
|
24526
|
-
const lbl = fx.label;
|
|
24527
|
-
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, G2 = kit.geo, DS = THREE.DoubleSide, clamp6 = kit.clamp;
|
|
24539
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, G2 = kit.geo, clamp6 = kit.clamp;
|
|
24528
24540
|
function colorize(geo, fn) {
|
|
24529
24541
|
const p = geo.attributes.position, col = new Float32Array(p.count * 3);
|
|
24530
24542
|
for (let i = 0; i < p.count; i++) {
|
|
@@ -24994,7 +25006,8 @@ var GameVehiclesThree = (() => {
|
|
|
24994
25006
|
function bake(c, grp) {
|
|
24995
25007
|
grp.updateMatrix();
|
|
24996
25008
|
const M = grp.matrix;
|
|
24997
|
-
grp.children.slice().forEach(function(
|
|
25009
|
+
grp.children.slice().forEach(function(o3) {
|
|
25010
|
+
const o = o3;
|
|
24998
25011
|
o.updateMatrix();
|
|
24999
25012
|
const m = new THREE.Matrix4().multiplyMatrices(M, o.matrix);
|
|
25000
25013
|
grp.remove(o);
|
|
@@ -25196,7 +25209,7 @@ var GameVehiclesThree = (() => {
|
|
|
25196
25209
|
t.rotation.y += s > 0 ? -Math.atan(m) : Math.atan(m);
|
|
25197
25210
|
return t;
|
|
25198
25211
|
}
|
|
25199
|
-
|
|
25212
|
+
return {
|
|
25200
25213
|
colorize,
|
|
25201
25214
|
tab,
|
|
25202
25215
|
tabL,
|
|
@@ -25234,6 +25247,15 @@ var GameVehiclesThree = (() => {
|
|
|
25234
25247
|
pedals,
|
|
25235
25248
|
NAV
|
|
25236
25249
|
};
|
|
25250
|
+
}
|
|
25251
|
+
function installWaterAir(fx) {
|
|
25252
|
+
const kit = fx.kit;
|
|
25253
|
+
const THREE = kit.THREE;
|
|
25254
|
+
const shared2 = fx.shared;
|
|
25255
|
+
const trl = fx.t;
|
|
25256
|
+
const lbl = fx.label;
|
|
25257
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, DS = THREE.DoubleSide;
|
|
25258
|
+
shared2.EA = createWaterAirKit(kit);
|
|
25237
25259
|
fx.register(
|
|
25238
25260
|
{
|
|
25239
25261
|
key: "river_skiff",
|
|
@@ -48438,7 +48460,8 @@ var GameVehiclesThree = (() => {
|
|
|
48438
48460
|
const primary = primaryPaint(entry.item.vehicle);
|
|
48439
48461
|
if (!primary) return;
|
|
48440
48462
|
entry.paint = primary.clone();
|
|
48441
|
-
vehicle.vehicle.traverse((
|
|
48463
|
+
vehicle.vehicle.traverse((obj) => {
|
|
48464
|
+
const mesh2 = obj;
|
|
48442
48465
|
if (!mesh2.isMesh) return;
|
|
48443
48466
|
if (Array.isArray(mesh2.material)) mesh2.material = mesh2.material.map((m) => m === primary ? entry.paint : m);
|
|
48444
48467
|
else if (mesh2.material === primary) mesh2.material = entry.paint;
|
|
@@ -48548,7 +48571,8 @@ var GameVehiclesThree = (() => {
|
|
|
48548
48571
|
const low = new three.Box3();
|
|
48549
48572
|
const piece = new three.Box3();
|
|
48550
48573
|
const matrix = new three.Matrix4();
|
|
48551
|
-
entry.root.traverse((
|
|
48574
|
+
entry.root.traverse((obj) => {
|
|
48575
|
+
const mesh2 = obj;
|
|
48552
48576
|
if (!mesh2.isMesh || !mesh2.geometry || mesh2.userData.ghost) return;
|
|
48553
48577
|
for (let p = mesh2; p; p = p.parent) if (p.visible === false) return;
|
|
48554
48578
|
if (mesh2.userData.helper) return;
|
|
@@ -48795,7 +48819,8 @@ var GameVehiclesThree = (() => {
|
|
|
48795
48819
|
let drawCalls = 0;
|
|
48796
48820
|
let triangles = 0;
|
|
48797
48821
|
for (const entry of placed.values()) {
|
|
48798
|
-
entry.root.traverse((
|
|
48822
|
+
entry.root.traverse((obj) => {
|
|
48823
|
+
const mesh2 = obj;
|
|
48799
48824
|
if (!mesh2.isMesh || mesh2.userData.helper) return;
|
|
48800
48825
|
for (let p = mesh2; p; p = p.parent) if (p.visible === false) return;
|
|
48801
48826
|
drawCalls += 1;
|