@adatechnology/game-urban 0.3.4 → 0.3.6
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 +3 -3
package/dist/index.global.js
CHANGED
|
@@ -10090,7 +10090,7 @@ var GameUrban = (() => {
|
|
|
10090
10090
|
c.roundBox(0.02, 0.09, 0.16, 0.02, MT.chrome, mx - 0.065, my + 0.02, sd * (mz0 + 0.14));
|
|
10091
10091
|
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));
|
|
10092
10092
|
(s.seams || []).forEach(function(q) {
|
|
10093
|
-
const x =
|
|
10093
|
+
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;
|
|
10094
10094
|
c.roundBox(8e-3, y1 - y0, 6e-3, 3e-3, MT.dark, x, (y0 + y1) / 2, sd * (hw + 1e-3));
|
|
10095
10095
|
});
|
|
10096
10096
|
(s.handles || []).forEach(function(x) {
|
|
@@ -20641,7 +20641,7 @@ var GameUrban = (() => {
|
|
|
20641
20641
|
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 });
|
|
20642
20642
|
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 });
|
|
20643
20643
|
}
|
|
20644
|
-
const f = sd > 0 ? "+z" : "-z", pt = Gd.at(
|
|
20644
|
+
const f = sd > 0 ? "+z" : "-z", pt = Gd.at(0.5, 0.62).p;
|
|
20645
20645
|
if (highwayPolice)
|
|
20646
20646
|
c2.text(trl("texts.federal_highway_police"), 1.9, 0.13, -0.32, 0.6, sd * (Math.abs(pt.z) + 0.012), f, {
|
|
20647
20647
|
fg: blueP,
|
|
@@ -21723,7 +21723,8 @@ var GameUrban = (() => {
|
|
|
21723
21723
|
const fw = kit.spokedWheel(c, 0.78, 0.325, 0.06, { spokes: 40, knobby: true, disc: true, label: trl("labels.front_tire") });
|
|
21724
21724
|
const rw = kit.spokedWheel(c, -0.72, 0.318, 0.08, { spokes: 40, knobby: true, label: trl("labels.rear_tire") });
|
|
21725
21725
|
[fw, rw].forEach(function(g) {
|
|
21726
|
-
g.children.forEach(function(
|
|
21726
|
+
g.children.forEach(function(o) {
|
|
21727
|
+
const ch = o;
|
|
21727
21728
|
if (ch.geometry && ch.geometry.type === "TorusGeometry" && ch.material === MT.chrome) ch.material = rimGold;
|
|
21728
21729
|
});
|
|
21729
21730
|
});
|
|
@@ -24244,13 +24245,9 @@ var GameUrban = (() => {
|
|
|
24244
24245
|
}
|
|
24245
24246
|
);
|
|
24246
24247
|
}
|
|
24247
|
-
function
|
|
24248
|
-
const kit = fx.kit;
|
|
24248
|
+
function createPlanesKit(kit) {
|
|
24249
24249
|
const THREE = kit.THREE;
|
|
24250
|
-
const
|
|
24251
|
-
const trl = fx.t;
|
|
24252
|
-
const lbl = fx.label;
|
|
24253
|
-
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
|
|
24250
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial;
|
|
24254
24251
|
function pose3(Af, ra, Tf, rt) {
|
|
24255
24252
|
let lo = 0, hi = 0.5, TH = 0;
|
|
24256
24253
|
function f(t) {
|
|
@@ -24399,7 +24396,7 @@ var GameUrban = (() => {
|
|
|
24399
24396
|
m.rotation.y += -s * Math.atan2(a - b, w);
|
|
24400
24397
|
return m;
|
|
24401
24398
|
}
|
|
24402
|
-
|
|
24399
|
+
return {
|
|
24403
24400
|
pose3,
|
|
24404
24401
|
starDecal,
|
|
24405
24402
|
rrect,
|
|
@@ -24413,6 +24410,17 @@ var GameUrban = (() => {
|
|
|
24413
24410
|
liner,
|
|
24414
24411
|
sideText
|
|
24415
24412
|
};
|
|
24413
|
+
}
|
|
24414
|
+
function installPlanesExtra(fx) {
|
|
24415
|
+
const kit = fx.kit;
|
|
24416
|
+
const THREE = kit.THREE;
|
|
24417
|
+
const shared = fx.shared;
|
|
24418
|
+
const trl = fx.t;
|
|
24419
|
+
const lbl = fx.label;
|
|
24420
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _G = kit.geo, _DS = THREE.DoubleSide;
|
|
24421
|
+
const GH = createPlanesKit(kit);
|
|
24422
|
+
shared.GH = GH;
|
|
24423
|
+
const { pose3, starDecal, rrect, polysSdf, pod, fSkin, fGlass, liner, sideText } = GH;
|
|
24416
24424
|
fx.register(
|
|
24417
24425
|
{
|
|
24418
24426
|
key: "tandem_trainer",
|
|
@@ -26402,7 +26410,8 @@ var GameUrban = (() => {
|
|
|
26402
26410
|
if (msh && msh.parent) warp(msh);
|
|
26403
26411
|
});
|
|
26404
26412
|
const bb = new THREE.Box3(), cen = new V3(), sz = new V3();
|
|
26405
|
-
c.vehicle.children.slice().forEach(function(
|
|
26413
|
+
c.vehicle.children.slice().forEach(function(o3) {
|
|
26414
|
+
const ob = o3;
|
|
26406
26415
|
if (skip.has(ob) || warpSet.has(ob)) return;
|
|
26407
26416
|
if (ob.isMesh) {
|
|
26408
26417
|
const g = ob.geometry;
|
|
@@ -26617,7 +26626,8 @@ var GameUrban = (() => {
|
|
|
26617
26626
|
}
|
|
26618
26627
|
function plateOutside(c) {
|
|
26619
26628
|
const m = c.meta;
|
|
26620
|
-
c.vehicle.children.forEach(function(
|
|
26629
|
+
c.vehicle.children.forEach(function(o3) {
|
|
26630
|
+
const o = o3;
|
|
26621
26631
|
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)
|
|
26622
26632
|
o.position.x = Math.min(o.position.x, m.rear - BV * 0.5) - BV * 0.62;
|
|
26623
26633
|
});
|
|
@@ -26787,7 +26797,8 @@ var GameUrban = (() => {
|
|
|
26787
26797
|
}
|
|
26788
26798
|
c.root.updateMatrixWorld(true);
|
|
26789
26799
|
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();
|
|
26790
|
-
c.vehicle.traverse(function(
|
|
26800
|
+
c.vehicle.traverse(function(o3) {
|
|
26801
|
+
const ob = o3;
|
|
26791
26802
|
if (!ob.isMesh || done.has(ob.geometry)) return;
|
|
26792
26803
|
done.add(ob.geometry);
|
|
26793
26804
|
rel.multiplyMatrices(gInv, ob.matrixWorld);
|
|
@@ -26853,7 +26864,8 @@ var GameUrban = (() => {
|
|
|
26853
26864
|
c.lights.forEach(function(L) {
|
|
26854
26865
|
if (!L.group || L.group.userData.recessed) return;
|
|
26855
26866
|
L.group.userData.recessed = true;
|
|
26856
|
-
L.group.children.slice().forEach(function(
|
|
26867
|
+
L.group.children.slice().forEach(function(o3) {
|
|
26868
|
+
const h = o3;
|
|
26857
26869
|
if (!h.isMesh || h.material !== MT.housing || h.geometry.type !== "BoxGeometry" || Math.abs(h.position.x) > 1e-3) return;
|
|
26858
26870
|
h.geometry.computeBoundingBox();
|
|
26859
26871
|
const bb = h.geometry.boundingBox, d = bb.max.x - bb.min.x;
|
|
@@ -26884,7 +26896,8 @@ var GameUrban = (() => {
|
|
|
26884
26896
|
const cols = [m.color, m.roofCol].filter(Boolean).map(function(h) {
|
|
26885
26897
|
return new THREE.Color(h).getHex();
|
|
26886
26898
|
});
|
|
26887
|
-
c.vehicle.children.forEach(function(
|
|
26899
|
+
c.vehicle.children.forEach(function(o3) {
|
|
26900
|
+
const o = o3;
|
|
26888
26901
|
if (!o.isMesh || gl.has(o) || o.geometry.type !== "BoxGeometry" || o.material === MT.trim || o.material === MT.chrome || o.material.transparent)
|
|
26889
26902
|
return;
|
|
26890
26903
|
if (o.material.color && cols.indexOf(o.material.color.getHex()) >= 0) return;
|
|
@@ -27728,7 +27741,8 @@ var GameUrban = (() => {
|
|
|
27728
27741
|
},
|
|
27729
27742
|
post: function(c2, _m) {
|
|
27730
27743
|
const gfx = fX(s, 0.8) + 0.04;
|
|
27731
|
-
c2.vehicle.children.forEach(function(
|
|
27744
|
+
c2.vehicle.children.forEach(function(o3) {
|
|
27745
|
+
const o = o3;
|
|
27732
27746
|
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)
|
|
27733
27747
|
o.position.x = Math.max(o.position.x, gfx);
|
|
27734
27748
|
});
|
|
@@ -28063,7 +28077,7 @@ var GameUrban = (() => {
|
|
|
28063
28077
|
kit.sideWindows(c, [cab], W, T, function() {
|
|
28064
28078
|
return lbl("cab_window");
|
|
28065
28079
|
});
|
|
28066
|
-
winS.forEach(function(w
|
|
28080
|
+
winS.forEach(function(w) {
|
|
28067
28081
|
kit.sideWindows(
|
|
28068
28082
|
c,
|
|
28069
28083
|
[w.p],
|
|
@@ -28256,7 +28270,8 @@ var GameUrban = (() => {
|
|
|
28256
28270
|
fxKey: "lid",
|
|
28257
28271
|
dir: "front"
|
|
28258
28272
|
});
|
|
28259
|
-
c.vehicle.children.forEach(function(
|
|
28273
|
+
c.vehicle.children.forEach(function(o3) {
|
|
28274
|
+
const o = o3;
|
|
28260
28275
|
if (o.isMesh && o.geometry.type === "PlaneGeometry" && o.material.map && o.material.map.image && o.material.map.image.width === 400 && o.position.x < 0)
|
|
28261
28276
|
o.position.y = 0.84;
|
|
28262
28277
|
});
|
|
@@ -28307,7 +28322,7 @@ var GameUrban = (() => {
|
|
|
28307
28322
|
grille: { style: "truck", w: 0.84, h: 0.28, y: 0.86 },
|
|
28308
28323
|
seams: [1.62, 0.44],
|
|
28309
28324
|
handles: [0.6],
|
|
28310
|
-
extra: function(c2, m
|
|
28325
|
+
extra: function(c2, m) {
|
|
28311
28326
|
const fx2 = kit.profX(m.vanLow, 0.86, true);
|
|
28312
28327
|
kit.emblem(c2, fx2 + 0.1, 0.86, 0, 0.1);
|
|
28313
28328
|
const bfx = kit.profX(m.vanLow, 0.56, true);
|
|
@@ -28338,7 +28353,8 @@ var GameUrban = (() => {
|
|
|
28338
28353
|
[cx0 + 0.9, 0.82, -0.3, "#7a5c3a"],
|
|
28339
28354
|
[cx0 + 0.6, 1.18, -0.3, "#8a6a44"],
|
|
28340
28355
|
[cx0 + 1.6, 0.82, 0, "#6d5232"]
|
|
28341
|
-
].forEach(function(
|
|
28356
|
+
].forEach(function(q) {
|
|
28357
|
+
const b = q;
|
|
28342
28358
|
c2.roundBox(0.5, 0.4, 0.5, 0.02, CM(b[3], { roughness: 0.9 }), b[0], b[1], b[2]);
|
|
28343
28359
|
});
|
|
28344
28360
|
c2.part("cargo", trl("labels.cargo_box"), null, new V3(m.rear + 1.4, 1.2, 0), 1.3);
|
|
@@ -28623,13 +28639,9 @@ var GameUrban = (() => {
|
|
|
28623
28639
|
}
|
|
28624
28640
|
);
|
|
28625
28641
|
}
|
|
28626
|
-
function
|
|
28627
|
-
const kit = fx.kit;
|
|
28642
|
+
function createWaterAirKit(kit) {
|
|
28628
28643
|
const THREE = kit.THREE;
|
|
28629
|
-
const
|
|
28630
|
-
const trl = fx.t;
|
|
28631
|
-
const lbl = fx.label;
|
|
28632
|
-
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, G = kit.geo, DS = THREE.DoubleSide, clamp3 = kit.clamp;
|
|
28644
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, G = kit.geo, clamp3 = kit.clamp;
|
|
28633
28645
|
function colorize(geo, fn) {
|
|
28634
28646
|
const p = geo.attributes.position, col = new Float32Array(p.count * 3);
|
|
28635
28647
|
for (let i = 0; i < p.count; i++) {
|
|
@@ -29099,7 +29111,8 @@ var GameUrban = (() => {
|
|
|
29099
29111
|
function bake(c, grp) {
|
|
29100
29112
|
grp.updateMatrix();
|
|
29101
29113
|
const M = grp.matrix;
|
|
29102
|
-
grp.children.slice().forEach(function(
|
|
29114
|
+
grp.children.slice().forEach(function(o3) {
|
|
29115
|
+
const o = o3;
|
|
29103
29116
|
o.updateMatrix();
|
|
29104
29117
|
const m = new THREE.Matrix4().multiplyMatrices(M, o.matrix);
|
|
29105
29118
|
grp.remove(o);
|
|
@@ -29301,7 +29314,7 @@ var GameUrban = (() => {
|
|
|
29301
29314
|
t.rotation.y += s > 0 ? -Math.atan(m) : Math.atan(m);
|
|
29302
29315
|
return t;
|
|
29303
29316
|
}
|
|
29304
|
-
|
|
29317
|
+
return {
|
|
29305
29318
|
colorize,
|
|
29306
29319
|
tab,
|
|
29307
29320
|
tabL,
|
|
@@ -29339,6 +29352,15 @@ var GameUrban = (() => {
|
|
|
29339
29352
|
pedals,
|
|
29340
29353
|
NAV
|
|
29341
29354
|
};
|
|
29355
|
+
}
|
|
29356
|
+
function installWaterAir(fx) {
|
|
29357
|
+
const kit = fx.kit;
|
|
29358
|
+
const THREE = kit.THREE;
|
|
29359
|
+
const shared = fx.shared;
|
|
29360
|
+
const trl = fx.t;
|
|
29361
|
+
const lbl = fx.label;
|
|
29362
|
+
const V3 = kit.V3, PI = Math.PI, MT = kit.materials, CM = kit.makeMaterial, _paintCol = kit.paintColor, DS = THREE.DoubleSide;
|
|
29363
|
+
shared.EA = createWaterAirKit(kit);
|
|
29342
29364
|
fx.register(
|
|
29343
29365
|
{
|
|
29344
29366
|
key: "river_skiff",
|