@adatechnology/game-urban-three 0.3.5 → 0.3.7
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.global.js +50 -28
- package/dist/index.global.js.map +1 -1
- package/package.json +6 -6
package/dist/index.global.js
CHANGED
|
@@ -17309,7 +17309,7 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
17309
17309
|
c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
|
|
17310
17310
|
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));
|
|
17311
17311
|
(s.seams || []).forEach(function(q) {
|
|
17312
|
-
const x =
|
|
17312
|
+
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;
|
|
17313
17313
|
c.roundBox(8e-3, y1 - y0, 6e-3, 3e-3, MT.dark, x, (y0 + y1) / 2, sd * (hw + 1e-3));
|
|
17314
17314
|
});
|
|
17315
17315
|
(s.handles || []).forEach(function(x) {
|
|
@@ -27860,7 +27860,7 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
27860
27860
|
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 });
|
|
27861
27861
|
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 });
|
|
27862
27862
|
}
|
|
27863
|
-
const f = sd > 0 ? "+z" : "-z", pt = Gd.at(
|
|
27863
|
+
const f = sd > 0 ? "+z" : "-z", pt = Gd.at(0.5, 0.62).p;
|
|
27864
27864
|
if (highwayPolice)
|
|
27865
27865
|
c2.text(trl("texts.federal_highway_police"), 1.9, 0.13, -0.32, 0.6, sd * (Math.abs(pt.z) + 0.012), f, {
|
|
27866
27866
|
fg: blueP,
|
|
@@ -28942,7 +28942,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
28942
28942
|
const fw = kit.spokedWheel(c, 0.78, 0.325, 0.06, { spokes: 40, knobby: true, disc: true, label: trl("labels.front_tire") });
|
|
28943
28943
|
const rw = kit.spokedWheel(c, -0.72, 0.318, 0.08, { spokes: 40, knobby: true, label: trl("labels.rear_tire") });
|
|
28944
28944
|
[fw, rw].forEach(function(g) {
|
|
28945
|
-
g.children.forEach(function(
|
|
28945
|
+
g.children.forEach(function(o) {
|
|
28946
|
+
const ch = o;
|
|
28946
28947
|
if (ch.geometry && ch.geometry.type === "TorusGeometry" && ch.material === MT.chrome) ch.material = rimGold;
|
|
28947
28948
|
});
|
|
28948
28949
|
});
|
|
@@ -31463,13 +31464,9 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
31463
31464
|
}
|
|
31464
31465
|
);
|
|
31465
31466
|
}
|
|
31466
|
-
function
|
|
31467
|
-
const kit = fx.kit;
|
|
31467
|
+
function createPlanesKit(kit) {
|
|
31468
31468
|
const THREE = kit.THREE;
|
|
31469
|
-
const
|
|
31470
|
-
const trl = fx.t;
|
|
31471
|
-
const lbl = fx.label;
|
|
31472
|
-
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
|
|
31469
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial;
|
|
31473
31470
|
function pose3(Af, ra, Tf, rt) {
|
|
31474
31471
|
let lo = 0, hi = 0.5, TH = 0;
|
|
31475
31472
|
function f(t) {
|
|
@@ -31618,7 +31615,7 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
31618
31615
|
m.rotation.y += -s * Math.atan2(a - b, w);
|
|
31619
31616
|
return m;
|
|
31620
31617
|
}
|
|
31621
|
-
|
|
31618
|
+
return {
|
|
31622
31619
|
pose3,
|
|
31623
31620
|
starDecal,
|
|
31624
31621
|
rrect,
|
|
@@ -31632,6 +31629,17 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
31632
31629
|
liner,
|
|
31633
31630
|
sideText
|
|
31634
31631
|
};
|
|
31632
|
+
}
|
|
31633
|
+
function installPlanesExtra(fx) {
|
|
31634
|
+
const kit = fx.kit;
|
|
31635
|
+
const THREE = kit.THREE;
|
|
31636
|
+
const shared2 = fx.shared;
|
|
31637
|
+
const trl = fx.t;
|
|
31638
|
+
const lbl = fx.label;
|
|
31639
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
|
|
31640
|
+
const GH = createPlanesKit(kit);
|
|
31641
|
+
shared2.GH = GH;
|
|
31642
|
+
const { pose3, starDecal, rrect, polysSdf, pod, fSkin, fGlass, liner, sideText } = GH;
|
|
31635
31643
|
fx.register(
|
|
31636
31644
|
{
|
|
31637
31645
|
key: "tandem_trainer",
|
|
@@ -33621,7 +33629,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
33621
33629
|
if (msh && msh.parent) warp(msh);
|
|
33622
33630
|
});
|
|
33623
33631
|
const bb = new THREE.Box3(), cen = new V3(), sz = new V3();
|
|
33624
|
-
c.vehicle.children.slice().forEach(function(
|
|
33632
|
+
c.vehicle.children.slice().forEach(function(o3) {
|
|
33633
|
+
const ob = o3;
|
|
33625
33634
|
if (skip.has(ob) || warpSet.has(ob)) return;
|
|
33626
33635
|
if (ob.isMesh) {
|
|
33627
33636
|
const g = ob.geometry;
|
|
@@ -33836,7 +33845,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
33836
33845
|
}
|
|
33837
33846
|
function plateOutside(c) {
|
|
33838
33847
|
const m = c.meta;
|
|
33839
|
-
c.vehicle.children.forEach(function(
|
|
33848
|
+
c.vehicle.children.forEach(function(o3) {
|
|
33849
|
+
const o = o3;
|
|
33840
33850
|
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)
|
|
33841
33851
|
o.position.x = Math.min(o.position.x, m.rear - BV * 0.5) - BV * 0.62;
|
|
33842
33852
|
});
|
|
@@ -34006,7 +34016,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
34006
34016
|
}
|
|
34007
34017
|
c.root.updateMatrixWorld(true);
|
|
34008
34018
|
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();
|
|
34009
|
-
c.vehicle.traverse(function(
|
|
34019
|
+
c.vehicle.traverse(function(o3) {
|
|
34020
|
+
const ob = o3;
|
|
34010
34021
|
if (!ob.isMesh || done.has(ob.geometry)) return;
|
|
34011
34022
|
done.add(ob.geometry);
|
|
34012
34023
|
rel.multiplyMatrices(gInv, ob.matrixWorld);
|
|
@@ -34072,7 +34083,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
34072
34083
|
c.lights.forEach(function(L) {
|
|
34073
34084
|
if (!L.group || L.group.userData.recessed) return;
|
|
34074
34085
|
L.group.userData.recessed = true;
|
|
34075
|
-
L.group.children.slice().forEach(function(
|
|
34086
|
+
L.group.children.slice().forEach(function(o3) {
|
|
34087
|
+
const h = o3;
|
|
34076
34088
|
if (!h.isMesh || h.material !== MT.housing || h.geometry.type !== "BoxGeometry" || Math.abs(h.position.x) > 1e-3) return;
|
|
34077
34089
|
h.geometry.computeBoundingBox();
|
|
34078
34090
|
const bb = h.geometry.boundingBox, d = bb.max.x - bb.min.x;
|
|
@@ -34103,7 +34115,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
34103
34115
|
const cols = [m.color, m.roofCol].filter(Boolean).map(function(h) {
|
|
34104
34116
|
return new THREE.Color(h).getHex();
|
|
34105
34117
|
});
|
|
34106
|
-
c.vehicle.children.forEach(function(
|
|
34118
|
+
c.vehicle.children.forEach(function(o3) {
|
|
34119
|
+
const o = o3;
|
|
34107
34120
|
if (!o.isMesh || gl.has(o) || o.geometry.type !== "BoxGeometry" || o.material === MT.trim || o.material === MT.chrome || o.material.transparent)
|
|
34108
34121
|
return;
|
|
34109
34122
|
if (o.material.color && cols.indexOf(o.material.color.getHex()) >= 0) return;
|
|
@@ -34947,7 +34960,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
34947
34960
|
},
|
|
34948
34961
|
post: function(c2, _m) {
|
|
34949
34962
|
const gfx = fX(s, 0.8) + 0.04;
|
|
34950
|
-
c2.vehicle.children.forEach(function(
|
|
34963
|
+
c2.vehicle.children.forEach(function(o3) {
|
|
34964
|
+
const o = o3;
|
|
34951
34965
|
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)
|
|
34952
34966
|
o.position.x = Math.max(o.position.x, gfx);
|
|
34953
34967
|
});
|
|
@@ -35282,7 +35296,7 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
35282
35296
|
kit.sideWindows(c, [cab], W, T, function() {
|
|
35283
35297
|
return lbl("cab_window");
|
|
35284
35298
|
});
|
|
35285
|
-
winS.forEach(function(w
|
|
35299
|
+
winS.forEach(function(w) {
|
|
35286
35300
|
kit.sideWindows(
|
|
35287
35301
|
c,
|
|
35288
35302
|
[w.p],
|
|
@@ -35475,7 +35489,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
35475
35489
|
fxKey: "lid",
|
|
35476
35490
|
dir: "front"
|
|
35477
35491
|
});
|
|
35478
|
-
c.vehicle.children.forEach(function(
|
|
35492
|
+
c.vehicle.children.forEach(function(o3) {
|
|
35493
|
+
const o = o3;
|
|
35479
35494
|
if (o.isMesh && o.geometry.type === "PlaneGeometry" && o.material.map && o.material.map.image && o.material.map.image.width === 400 && o.position.x < 0)
|
|
35480
35495
|
o.position.y = 0.84;
|
|
35481
35496
|
});
|
|
@@ -35526,7 +35541,7 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
35526
35541
|
grille: { style: "truck", w: 0.84, h: 0.28, y: 0.86 },
|
|
35527
35542
|
seams: [1.62, 0.44],
|
|
35528
35543
|
handles: [0.6],
|
|
35529
|
-
extra: function(c2, m
|
|
35544
|
+
extra: function(c2, m) {
|
|
35530
35545
|
const fx2 = kit.profX(m.vanLow, 0.86, true);
|
|
35531
35546
|
kit.emblem(c2, fx2 + 0.1, 0.86, 0, 0.1);
|
|
35532
35547
|
const bfx = kit.profX(m.vanLow, 0.56, true);
|
|
@@ -35557,7 +35572,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
35557
35572
|
[cx0 + 0.9, 0.82, -0.3, "#7a5c3a"],
|
|
35558
35573
|
[cx0 + 0.6, 1.18, -0.3, "#8a6a44"],
|
|
35559
35574
|
[cx0 + 1.6, 0.82, 0, "#6d5232"]
|
|
35560
|
-
].forEach(function(
|
|
35575
|
+
].forEach(function(q) {
|
|
35576
|
+
const b = q;
|
|
35561
35577
|
c2.roundBox(0.5, 0.4, 0.5, 0.02, CM(b[3], { roughness: 0.9 }), b[0], b[1], b[2]);
|
|
35562
35578
|
});
|
|
35563
35579
|
c2.part("cargo", trl("labels.cargo_box"), null, new V3(m.rear + 1.4, 1.2, 0), 1.3);
|
|
@@ -35842,13 +35858,9 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
35842
35858
|
}
|
|
35843
35859
|
);
|
|
35844
35860
|
}
|
|
35845
|
-
function
|
|
35846
|
-
const kit = fx.kit;
|
|
35861
|
+
function createWaterAirKit(kit) {
|
|
35847
35862
|
const THREE = kit.THREE;
|
|
35848
|
-
const
|
|
35849
|
-
const trl = fx.t;
|
|
35850
|
-
const lbl = fx.label;
|
|
35851
|
-
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, G = kit.geo, DS = THREE.DoubleSide, clamp5 = kit.clamp;
|
|
35863
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, G = kit.geo, clamp5 = kit.clamp;
|
|
35852
35864
|
function colorize(geo, fn) {
|
|
35853
35865
|
const p = geo.attributes.position, col = new Float32Array(p.count * 3);
|
|
35854
35866
|
for (let i = 0; i < p.count; i++) {
|
|
@@ -36318,7 +36330,8 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
36318
36330
|
function bake(c, grp) {
|
|
36319
36331
|
grp.updateMatrix();
|
|
36320
36332
|
const M = grp.matrix;
|
|
36321
|
-
grp.children.slice().forEach(function(
|
|
36333
|
+
grp.children.slice().forEach(function(o3) {
|
|
36334
|
+
const o = o3;
|
|
36322
36335
|
o.updateMatrix();
|
|
36323
36336
|
const m = new THREE.Matrix4().multiplyMatrices(M, o.matrix);
|
|
36324
36337
|
grp.remove(o);
|
|
@@ -36520,7 +36533,7 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
36520
36533
|
t.rotation.y += s > 0 ? -Math.atan(m) : Math.atan(m);
|
|
36521
36534
|
return t;
|
|
36522
36535
|
}
|
|
36523
|
-
|
|
36536
|
+
return {
|
|
36524
36537
|
colorize,
|
|
36525
36538
|
tab,
|
|
36526
36539
|
tabL,
|
|
@@ -36558,6 +36571,15 @@ gl_Position = projectionMatrix * mvPosition;
|
|
|
36558
36571
|
pedals,
|
|
36559
36572
|
NAV
|
|
36560
36573
|
};
|
|
36574
|
+
}
|
|
36575
|
+
function installWaterAir(fx) {
|
|
36576
|
+
const kit = fx.kit;
|
|
36577
|
+
const THREE = kit.THREE;
|
|
36578
|
+
const shared2 = fx.shared;
|
|
36579
|
+
const trl = fx.t;
|
|
36580
|
+
const lbl = fx.label;
|
|
36581
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, DS = THREE.DoubleSide;
|
|
36582
|
+
shared2.EA = createWaterAirKit(kit);
|
|
36561
36583
|
fx.register(
|
|
36562
36584
|
{
|
|
36563
36585
|
key: "river_skiff",
|