@adatechnology/game-urban 0.3.12 → 0.4.0
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/README.md +87 -1
- package/dist/index.d.ts +28 -995
- package/dist/index.global.js +361 -153
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +86 -18
- package/dist/index.js.map +1 -1
- package/dist/networks/index.d.ts +488 -0
- package/dist/networks/index.js +1882 -0
- package/dist/networks/index.js.map +1 -0
- package/dist/types-CYeqw_58.d.ts +1027 -0
- package/package.json +11 -7
package/dist/index.global.js
CHANGED
|
@@ -45,6 +45,7 @@ var GameUrban = (() => {
|
|
|
45
45
|
TOWER_DEFAULTS: () => TOWER_DEFAULTS,
|
|
46
46
|
TOWER_PATTERNS: () => TOWER_PATTERNS,
|
|
47
47
|
TOWER_SAMPLE_CELLS: () => TOWER_SAMPLE_CELLS,
|
|
48
|
+
assertLampShares: () => assertLampShares,
|
|
48
49
|
clamp: () => clamp2,
|
|
49
50
|
composePattern: () => composePattern,
|
|
50
51
|
createCities: () => createCities,
|
|
@@ -75,9 +76,11 @@ var GameUrban = (() => {
|
|
|
75
76
|
drawWatchtower: () => drawWatchtower,
|
|
76
77
|
drawWires: () => drawWires,
|
|
77
78
|
fillBlock: () => fillBlock,
|
|
79
|
+
flickerPhaseOf: () => flickerPhaseOf,
|
|
78
80
|
hash2: () => hash2,
|
|
79
81
|
insideEllipse: () => insideEllipse,
|
|
80
82
|
insideRect: () => insideRect,
|
|
83
|
+
lampStateOf: () => lampStateOf,
|
|
81
84
|
lerp: () => lerp2,
|
|
82
85
|
patternMarker: () => patternMarker,
|
|
83
86
|
pickTowerPreset: () => pickTowerPreset,
|
|
@@ -98,21 +101,71 @@ var GameUrban = (() => {
|
|
|
98
101
|
}
|
|
99
102
|
var createLightBudget = createLightAllowance;
|
|
100
103
|
|
|
104
|
+
// src/lamps.ts
|
|
105
|
+
var UINT32 = 2 ** 32;
|
|
106
|
+
var PHASE_SALT = 1597463007;
|
|
107
|
+
var SEED_BITS = new DataView(new ArrayBuffer(8));
|
|
108
|
+
var hashLamp = (seed, x, z) => {
|
|
109
|
+
SEED_BITS.setFloat64(0, seed);
|
|
110
|
+
let h = 2166136261;
|
|
111
|
+
for (const value of [SEED_BITS.getUint32(0), SEED_BITS.getUint32(4), Math.round(x * 100), Math.round(z * 100)]) {
|
|
112
|
+
h ^= value & 65535;
|
|
113
|
+
h = Math.imul(h, 16777619);
|
|
114
|
+
h ^= value >>> 16 & 65535;
|
|
115
|
+
h = Math.imul(h, 16777619);
|
|
116
|
+
}
|
|
117
|
+
return (h >>> 0) / UINT32;
|
|
118
|
+
};
|
|
119
|
+
var flickerPhaseOf = (x, z) => hashLamp(PHASE_SALT, x, z) * 2 * Math.PI;
|
|
120
|
+
function assertLampShares(shares) {
|
|
121
|
+
const { lit, flicker } = shares;
|
|
122
|
+
if (!(lit >= 0 && lit <= 1)) throw new RangeError(`lamp shares: lit must be in [0, 1], got ${lit}`);
|
|
123
|
+
if (!(flicker >= 0 && flicker <= lit)) throw new RangeError(`lamp shares: flicker must be in [0, lit], got ${flicker}`);
|
|
124
|
+
}
|
|
125
|
+
function lampStateOf({ seed, x, z, shares }) {
|
|
126
|
+
assertLampShares(shares);
|
|
127
|
+
const roll = hashLamp(seed, x, z);
|
|
128
|
+
if (roll >= shares.lit) return { on: false, flicker: false };
|
|
129
|
+
return { on: true, flicker: roll >= shares.lit - shares.flicker };
|
|
130
|
+
}
|
|
131
|
+
|
|
101
132
|
// ../game-contracts/dist/index.js
|
|
102
133
|
var DEFAULT_BLAST_IMPULSE = { bodyArea: 0.7, lift: 0.15, minSpeed: 0.3, tntPerJoule: 0.24 / 2e5 };
|
|
103
134
|
var DEFAULT_COST_ALLOCATION_BYTES = 1024 * 1024;
|
|
104
135
|
var DEFERRED_QUEUE_ID = {
|
|
105
136
|
DESTRUCTION_EVENTS: "destruction.events",
|
|
106
137
|
BREACH_PAINT: "floorplan.breach-paint",
|
|
138
|
+
BREACH_CUT: "floorplan.breach-cut",
|
|
107
139
|
AUDIO_VOICES: "audio.voices",
|
|
108
|
-
VEHICLE_CREASE: "vehicles.crease"
|
|
140
|
+
VEHICLE_CREASE: "vehicles.crease",
|
|
141
|
+
AUDIO_OCCLUSION: "audio.occlusion",
|
|
142
|
+
FLUID_FILM: "fluids.film",
|
|
143
|
+
VEHICLE_LOD_BATCH: "vehicles.lod-batch",
|
|
144
|
+
SETTLED_BATCH: "destruction.settled-batch",
|
|
145
|
+
STATIC_BATCH: "render.static-batch",
|
|
146
|
+
ANIMALS_STATIC_BATCH: "animals.static-batch",
|
|
147
|
+
CHARACTERS_STATIC_BATCH: "characters.static-batch",
|
|
148
|
+
HOUSE_SHADOW_BATCH: "floorplan.shadow-batch",
|
|
149
|
+
DESTRUCTION_PREFIT: "destruction.prefit"
|
|
109
150
|
};
|
|
110
151
|
var DEFERRED_PRIORITY = {
|
|
111
152
|
[DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS]: { priority: 300, phase: "present" },
|
|
112
|
-
|
|
153
|
+
// every frame: the walls cut since the last frame are painted once each, and a hole must show in the frame of the blast
|
|
154
|
+
[DEFERRED_QUEUE_ID.BREACH_CUT]: { priority: 260, phase: "present", minEveryFrames: 1 },
|
|
155
|
+
[DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present", minEveryFrames: 1 },
|
|
113
156
|
[DEFERRED_QUEUE_ID.AUDIO_VOICES]: { priority: 200, phase: "idle", reserveMs: 1 },
|
|
114
|
-
[DEFERRED_QUEUE_ID.
|
|
157
|
+
[DEFERRED_QUEUE_ID.AUDIO_OCCLUSION]: { priority: 190, phase: "idle", minEveryFrames: 8 },
|
|
158
|
+
[DEFERRED_QUEUE_ID.FLUID_FILM]: { priority: 120, phase: "idle", minEveryFrames: 2 },
|
|
159
|
+
[DEFERRED_QUEUE_ID.VEHICLE_CREASE]: { priority: 100, phase: "idle" },
|
|
160
|
+
[DEFERRED_QUEUE_ID.VEHICLE_LOD_BATCH]: { priority: 90, phase: "idle", minEveryFrames: 4 },
|
|
161
|
+
[DEFERRED_QUEUE_ID.SETTLED_BATCH]: { priority: 70, phase: "idle", minEveryFrames: 8 },
|
|
162
|
+
[DEFERRED_QUEUE_ID.STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
163
|
+
[DEFERRED_QUEUE_ID.ANIMALS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
164
|
+
[DEFERRED_QUEUE_ID.CHARACTERS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
165
|
+
[DEFERRED_QUEUE_ID.HOUSE_SHADOW_BATCH]: { priority: 50, phase: "idle", minEveryFrames: 8 },
|
|
166
|
+
[DEFERRED_QUEUE_ID.DESTRUCTION_PREFIT]: { priority: 40, phase: "idle", minEveryFrames: 30 }
|
|
115
167
|
};
|
|
168
|
+
var MUST_DRAIN_QUEUE_IDS = /* @__PURE__ */ new Set([DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS, DEFERRED_QUEUE_ID.BREACH_CUT]);
|
|
116
169
|
var WARNED_KEY = /* @__PURE__ */ Symbol.for("@adatechnology/game-contracts.warned");
|
|
117
170
|
var warnedKeys = () => {
|
|
118
171
|
const holder = globalThis;
|
|
@@ -198,6 +251,22 @@ var GameUrban = (() => {
|
|
|
198
251
|
var FOOTSTEP_SOUND_IDS = SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstepSoundId(surface, gait)));
|
|
199
252
|
var LAND_SOUND_IDS = SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((landing) => `land_${surface}_${landing}`));
|
|
200
253
|
var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
|
|
254
|
+
var WORKER_KIND_ID = {
|
|
255
|
+
GROUND_TILES: "destruction.ground-tiles",
|
|
256
|
+
CROWD_PHYSICS: "crowd.physics",
|
|
257
|
+
PIECE_BOXES: "destruction.piece-boxes",
|
|
258
|
+
STATIC_COLLIDERS: "destruction.static-colliders",
|
|
259
|
+
SHAPES_GENERATE: "shapes.generate",
|
|
260
|
+
WORLD_REGION: "world.region"
|
|
261
|
+
};
|
|
262
|
+
var WORKER_KIND_DEFAULTS = {
|
|
263
|
+
[WORKER_KIND_ID.GROUND_TILES]: { lane: "sim", priority: 300, latencyFrames: 2, late: "sync" },
|
|
264
|
+
[WORKER_KIND_ID.CROWD_PHYSICS]: { lane: "sim", priority: 250, latencyFrames: 1, late: "sync" },
|
|
265
|
+
[WORKER_KIND_ID.PIECE_BOXES]: { lane: "sim", priority: 200, latencyFrames: 2, late: "sync" },
|
|
266
|
+
[WORKER_KIND_ID.STATIC_COLLIDERS]: { lane: "build", priority: 150, late: "sync" },
|
|
267
|
+
[WORKER_KIND_ID.SHAPES_GENERATE]: { lane: "build", priority: 100, late: "sync" },
|
|
268
|
+
[WORKER_KIND_ID.WORLD_REGION]: { lane: "background", priority: 10, latencyFrames: 10, late: "drop" }
|
|
269
|
+
};
|
|
201
270
|
|
|
202
271
|
// ../game-floorplan/dist/index.js
|
|
203
272
|
var createRegistries = () => ({
|
|
@@ -217,6 +286,7 @@ var GameUrban = (() => {
|
|
|
217
286
|
SEED_KEYS: { rooms: {}, items: {} },
|
|
218
287
|
stateDistribution: { weights: null, seedKey: "state" },
|
|
219
288
|
RESULT_EXTENSIONS: [],
|
|
289
|
+
OPTION_RESOLVERS: [],
|
|
220
290
|
FINDS_PROVIDERS: [],
|
|
221
291
|
VIEWER_LAYERS: [],
|
|
222
292
|
LOCALES: {},
|
|
@@ -303,6 +373,12 @@ var GameUrban = (() => {
|
|
|
303
373
|
function styleOf(id) {
|
|
304
374
|
return registries().STYLES[id] || registries().STYLES.budget || Object.values(registries().STYLES)[0];
|
|
305
375
|
}
|
|
376
|
+
function registerOptionResolver(name, resolve) {
|
|
377
|
+
const list = registries().OPTION_RESOLVERS;
|
|
378
|
+
const i = list.findIndex((x) => x.name === name);
|
|
379
|
+
if (i >= 0) list[i] = { name, resolve };
|
|
380
|
+
else list.push({ name, resolve });
|
|
381
|
+
}
|
|
306
382
|
function registerResultExtension(name, run, options = {}) {
|
|
307
383
|
const entry = { name, run, after: options.after || [], seedKey: options.seedKey ?? name };
|
|
308
384
|
const i = registries().RESULT_EXTENSIONS.findIndex((x) => x.name === name);
|
|
@@ -438,10 +514,25 @@ var GameUrban = (() => {
|
|
|
438
514
|
"outhouse"
|
|
439
515
|
]);
|
|
440
516
|
var CAR_CLEARANCE = { driver: 0.8, side: 0.6, end: 0.6 };
|
|
517
|
+
var active = WALL_THICKNESS;
|
|
518
|
+
var wallThickness = () => active;
|
|
519
|
+
var wallMargin = () => active / 2;
|
|
520
|
+
var wallThicknessFor = (tpl, op) => op.wallThickness ?? tpl.wallThickness ?? WALL_THICKNESS;
|
|
521
|
+
function withWallThickness(thickness, fn) {
|
|
522
|
+
const previous = active;
|
|
523
|
+
active = thickness;
|
|
524
|
+
try {
|
|
525
|
+
return fn();
|
|
526
|
+
} finally {
|
|
527
|
+
active = previous;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
var roomMargin = (room) => room.outdoor ? WALL_THICKNESS / 2 : wallMargin();
|
|
441
531
|
var r2 = (x) => Math.round(x * 100) / 100;
|
|
442
532
|
var clamp = (x, a, b) => Math.max(a, Math.min(b, x));
|
|
443
533
|
var overlaps = (a, b, e = EPS) => a[0] < b[2] - e && a[2] > b[0] + e && a[1] < b[3] - e && a[3] > b[1] + e;
|
|
444
|
-
var inner = (p) =>
|
|
534
|
+
var inner = (p) => insetBy(p, wallMargin());
|
|
535
|
+
var insetBy = (p, margin) => [p[0] + margin, p[1] + margin, p[2] - margin, p[3] - margin];
|
|
445
536
|
var eq = (a, b) => Math.abs(a - b) < TOL;
|
|
446
537
|
var inflate = (r, e) => [r[0] - e, r[1] - e, r[2] + e, r[3] + e];
|
|
447
538
|
var areaOf = (r) => (r[2] - r[0]) * (r[3] - r[1]);
|
|
@@ -514,7 +605,7 @@ var GameUrban = (() => {
|
|
|
514
605
|
const h = width / 2;
|
|
515
606
|
return axis === "u" ? [[u - h, v - depth, u + h, v], [u - h, v, u + h, v + depth]] : [[u - depth, v - h, u, v + h], [u, v - h, u + depth, v + h]];
|
|
516
607
|
}
|
|
517
|
-
var openingDepth = (width, leaf) => Math.max(0.9, leaf) +
|
|
608
|
+
var openingDepth = (width, leaf) => Math.max(0.9, leaf) + wallMargin();
|
|
518
609
|
function entryPoints(ab) {
|
|
519
610
|
return ab.axis === "u" ? [[ab.u, ab.v - 0.55], [ab.u, ab.v + 0.55]] : [[ab.u - 0.55, ab.v], [ab.u + 0.55, ab.v]];
|
|
520
611
|
}
|
|
@@ -538,7 +629,7 @@ var GameUrban = (() => {
|
|
|
538
629
|
};
|
|
539
630
|
}
|
|
540
631
|
function usableParts(room, extra) {
|
|
541
|
-
const m =
|
|
632
|
+
const m = roomMargin(room) + (extra || 0);
|
|
542
633
|
const out = [];
|
|
543
634
|
for (const p of room.parts) {
|
|
544
635
|
out.push([p[0] + m, p[1] + m, p[2] - m, p[3] - m]);
|
|
@@ -636,7 +727,7 @@ var GameUrban = (() => {
|
|
|
636
727
|
v0: g.axis === "u" ? g.pos : x,
|
|
637
728
|
u1: g.axis === "u" ? y : g.pos,
|
|
638
729
|
v1: g.axis === "u" ? g.pos : y,
|
|
639
|
-
thickness:
|
|
730
|
+
thickness: wallThickness(),
|
|
640
731
|
sides: [s.A, s.B],
|
|
641
732
|
exterior: s.A === "outside" || s.B === "outside",
|
|
642
733
|
type: railing ? "railing" : "wall",
|
|
@@ -656,7 +747,7 @@ var GameUrban = (() => {
|
|
|
656
747
|
const alongV = Math.abs(front[1]) === 1;
|
|
657
748
|
const [extentU, extentV] = extent([item.w, item.d], front);
|
|
658
749
|
const across = alongV ? extentU : extentV;
|
|
659
|
-
const
|
|
750
|
+
const along2 = alongV ? extentV : extentU;
|
|
660
751
|
const a = alongV ? 0 : 1;
|
|
661
752
|
const b = alongV ? 1 : 0;
|
|
662
753
|
const driverSign = alongV ? front[1] : -front[0];
|
|
@@ -666,7 +757,7 @@ var GameUrban = (() => {
|
|
|
666
757
|
const lo = zone[a] + lowClear;
|
|
667
758
|
const hi = zone[a + 2] - highClear - across;
|
|
668
759
|
const alongLo = zone[b] + car.end;
|
|
669
|
-
const alongHi = zone[b + 2] - car.end -
|
|
760
|
+
const alongHi = zone[b + 2] - car.end - along2;
|
|
670
761
|
if (hi < lo - 1e-6 || alongHi < alongLo - 1e-6) return [];
|
|
671
762
|
const preferred = (alongV ? slot.x : slot.z) - across / 2;
|
|
672
763
|
const alongStart = frontSign < 0 ? alongHi : alongLo;
|
|
@@ -674,8 +765,8 @@ var GameUrban = (() => {
|
|
|
674
765
|
for (let p = lo; p <= hi + 1e-6; p += STEP) positions.push(Math.min(p, hi));
|
|
675
766
|
positions.sort((x, y) => Math.abs(x - preferred) - Math.abs(y - preferred));
|
|
676
767
|
return positions.slice(0, MAX_CANDIDATES).map((p) => {
|
|
677
|
-
const rect = alongV ? [p, alongStart, p + across, alongStart +
|
|
678
|
-
const clear = alongV ? [p - lowClear, alongStart - car.end, p + across + highClear, alongStart +
|
|
768
|
+
const rect = alongV ? [p, alongStart, p + across, alongStart + along2] : [alongStart, p, alongStart + along2, p + across];
|
|
769
|
+
const clear = alongV ? [p - lowClear, alongStart - car.end, p + across + highClear, alongStart + along2 + car.end] : [alongStart - car.end, p - lowClear, alongStart + along2 + car.end, p + across + highClear];
|
|
679
770
|
return { rect, clear };
|
|
680
771
|
});
|
|
681
772
|
}
|
|
@@ -706,8 +797,9 @@ var GameUrban = (() => {
|
|
|
706
797
|
if (outside) n = [-n[0], -n[1]];
|
|
707
798
|
const u = j.u;
|
|
708
799
|
const v = j.v;
|
|
709
|
-
|
|
710
|
-
return n[
|
|
800
|
+
const MARGIN2 = wallMargin();
|
|
801
|
+
if (j.axis === "u") return n[1] > 0 ? [u - h, v - MARGIN2, u + h, v + depth] : [u - h, v - depth, u + h, v + MARGIN2];
|
|
802
|
+
return n[0] > 0 ? [u - MARGIN2, v - h, u + depth, v + h] : [u - depth, v - h, u + MARGIN2, v + h];
|
|
711
803
|
}
|
|
712
804
|
function blocksWindow(it, win, overheadOff) {
|
|
713
805
|
const height = Math.max(it.h, it.windowHeight || 0, it.overhead && !overheadOff ? OVERHEAD_TOP : 0);
|
|
@@ -739,14 +831,15 @@ var GameUrban = (() => {
|
|
|
739
831
|
const cache = plan.wallBodies = plan.wallBodies || {};
|
|
740
832
|
if (cache[floor]) return cache[floor];
|
|
741
833
|
const doors = plan.doors.filter((p) => p.floor === floor);
|
|
834
|
+
const MARGIN2 = plan.wallThickness / 2;
|
|
742
835
|
return cache[floor] = plan.walls.filter((p) => p.floor === floor && (p.type === "wall" || p.type === "railing")).map((p) => {
|
|
743
836
|
const a0 = p.axis === "u" ? p.u0 : p.v0;
|
|
744
837
|
const a1 = p.axis === "u" ? p.u1 : p.v1;
|
|
745
838
|
const pos = p.axis === "u" ? p.v0 : p.u0;
|
|
746
839
|
const atDoor = (x) => doors.some((q) => q.axis === p.axis && eq(q.pos, pos) && (eq(q.at - q.width / 2, x) || eq(q.at + q.width / 2, x)));
|
|
747
|
-
const e0 = atDoor(a0) ? 0 :
|
|
748
|
-
const e1 = atDoor(a1) ? 0 :
|
|
749
|
-
return p.axis === "u" ? [a0 - e0, pos -
|
|
840
|
+
const e0 = atDoor(a0) ? 0 : MARGIN2;
|
|
841
|
+
const e1 = atDoor(a1) ? 0 : MARGIN2;
|
|
842
|
+
return p.axis === "u" ? [a0 - e0, pos - MARGIN2, a1 + e1, pos + MARGIN2] : [pos - MARGIN2, a0 - e0, pos + MARGIN2, a1 + e1];
|
|
750
843
|
});
|
|
751
844
|
}
|
|
752
845
|
function createGrid(plan, room, ignored, radius = plan.playerRadius) {
|
|
@@ -1082,7 +1175,9 @@ var GameUrban = (() => {
|
|
|
1082
1175
|
palettePrefix: "paleta:"
|
|
1083
1176
|
};
|
|
1084
1177
|
var placementKit = {
|
|
1085
|
-
MARGIN
|
|
1178
|
+
get MARGIN() {
|
|
1179
|
+
return wallMargin();
|
|
1180
|
+
},
|
|
1086
1181
|
EPS,
|
|
1087
1182
|
r2,
|
|
1088
1183
|
clamp,
|
|
@@ -1523,6 +1618,7 @@ var GameUrban = (() => {
|
|
|
1523
1618
|
const FLOOR_DEFS = floorsOf(tpl, op);
|
|
1524
1619
|
const style = styleOf(styleId);
|
|
1525
1620
|
const plan = {
|
|
1621
|
+
wallThickness: wallThickness(),
|
|
1526
1622
|
w,
|
|
1527
1623
|
d,
|
|
1528
1624
|
tpl,
|
|
@@ -1995,7 +2091,7 @@ var GameUrban = (() => {
|
|
|
1995
2091
|
const key = registries().LIBRARY_ALIAS[name] || name;
|
|
1996
2092
|
const library = room.slots ? room.slots : registries().LIBRARIES[key];
|
|
1997
2093
|
if (!library) return [];
|
|
1998
|
-
const R =
|
|
2094
|
+
const R = insetBy(room.parts[0], roomMargin(room));
|
|
1999
2095
|
let defs = typeof library === "function" ? library({ w: R[2] - R[0], d: R[3] - R[1] }) : library.slice();
|
|
2000
2096
|
defs = defs.map((x) => Object.assign({}, x));
|
|
2001
2097
|
for (const id of room.without || []) defs = defs.filter((x) => x.id !== id);
|
|
@@ -2061,7 +2157,7 @@ var GameUrban = (() => {
|
|
|
2061
2157
|
}
|
|
2062
2158
|
const size = def.size;
|
|
2063
2159
|
const roomCenter = (() => {
|
|
2064
|
-
const R0 =
|
|
2160
|
+
const R0 = insetBy(room.parts[0], roomMargin(room));
|
|
2065
2161
|
return [(R0[0] + R0[2]) / 2, (R0[1] + R0[3]) / 2];
|
|
2066
2162
|
})();
|
|
2067
2163
|
const openings = openingsOfFloor(plan, room.floor);
|
|
@@ -2087,7 +2183,7 @@ var GameUrban = (() => {
|
|
|
2087
2183
|
};
|
|
2088
2184
|
const free = (rect) => !!def.floorFree || !zones.some((z) => overlaps(rect, z, room.type === "stairs" ? -0.011 : EPS));
|
|
2089
2185
|
const rule = def.facing || "center";
|
|
2090
|
-
let R =
|
|
2186
|
+
let R = insetBy(room.parts[Math.min(def.part || 0, room.parts.length - 1)], roomMargin(room));
|
|
2091
2187
|
if (def.anchor === "wall" || def.anchor === "window") {
|
|
2092
2188
|
let side = def.side;
|
|
2093
2189
|
let a = null;
|
|
@@ -2099,7 +2195,7 @@ var GameUrban = (() => {
|
|
|
2099
2195
|
const found2 = win;
|
|
2100
2196
|
side = room.outdoor ? SIDE_OPPOSITE[win.side] : WINDOW_SIDE[win.side];
|
|
2101
2197
|
const cand = room.parts.map(inner).find(
|
|
2102
|
-
(r) => (found2.axis === "u" ? found2.u >= r[0] - TOL && found2.u <= r[2] + TOL : found2.v >= r[1] - TOL && found2.v <= r[3] + TOL) && (side === "left" && eq(r[0], found2.pos +
|
|
2198
|
+
(r) => (found2.axis === "u" ? found2.u >= r[0] - TOL && found2.u <= r[2] + TOL : found2.v >= r[1] - TOL && found2.v <= r[3] + TOL) && (side === "left" && eq(r[0], found2.pos + roomMargin(room)) || side === "right" && eq(r[2], found2.pos - roomMargin(room)) || side === "front" && eq(r[1], found2.pos + roomMargin(room)) || side === "back" && eq(r[3], found2.pos - roomMargin(room)))
|
|
2103
2199
|
);
|
|
2104
2200
|
if (!cand) return invalid("window_outside_room");
|
|
2105
2201
|
R = cand;
|
|
@@ -2116,7 +2212,7 @@ var GameUrban = (() => {
|
|
|
2116
2212
|
const hw = Math.min(size[0], len) / 2;
|
|
2117
2213
|
const cell = (ac) => side === "left" ? [R[0], ac - hw, R[0] + depth, ac + hw] : side === "right" ? [R[2] - depth, ac - hw, R[2], ac + hw] : side === "front" ? [ac - hw, R[1], ac + hw, R[1] + depth] : [ac - hw, R[3] - depth, ac + hw, R[3]];
|
|
2118
2214
|
const nominal = a != null ? a : a0 + hw + (def.pos == null ? 0.5 : def.pos) * Math.max(0, len - 2 * hw) + (def.shift || 0);
|
|
2119
|
-
const wp = side === "left" ? R[0] -
|
|
2215
|
+
const wp = side === "left" ? R[0] - roomMargin(room) : side === "right" ? R[2] + roomMargin(room) : side === "front" ? R[1] - roomMargin(room) : R[3] + roomMargin(room);
|
|
2120
2216
|
const pa = clamp(nominal, a0 + hw, a1 - hw);
|
|
2121
2217
|
let found = null;
|
|
2122
2218
|
const steps = [0];
|
|
@@ -2155,7 +2251,7 @@ var GameUrban = (() => {
|
|
|
2155
2251
|
if (extentU > R[2] - R[0] + EPS || extentV > R[3] - R[1] + EPS) return invalid("larger_than_room");
|
|
2156
2252
|
const rect = [cornerU === "left" ? R[0] : R[2] - extentU, cornerV === "front" ? R[1] : R[3] - extentV, cornerU === "left" ? R[0] + extentU : R[2], cornerV === "front" ? R[1] + extentV : R[3]];
|
|
2157
2253
|
if (!free(rect)) return invalid("blocked_by_door");
|
|
2158
|
-
for (const sp of [[kx - normalU[0] * (
|
|
2254
|
+
for (const sp of [[kx - normalU[0] * (roomMargin(room) + 0.1), (rect[1] + rect[3]) / 2], [(rect[0] + rect[2]) / 2, kz - normalV[1] * (roomMargin(room) + 0.1)]]) if (isOpenSide(plan, room, sp[0], sp[1])) return invalid("open_wall");
|
|
2159
2255
|
return Object.assign(base, { x: r2((rect[0] + rect[2]) / 2), z: r2((rect[1] + rect[3]) / 2), frontU: f[0], frontV: f[1], ry: r2(Math.atan2(f[0], f[1])), w: size[0], d: size[1], aabb: rect.map(r2), _cell: { rect, f, enclosed: [cornerU, cornerV], R, size } });
|
|
2160
2256
|
}
|
|
2161
2257
|
if (def.anchor === "center") {
|
|
@@ -2195,7 +2291,10 @@ var GameUrban = (() => {
|
|
|
2195
2291
|
};
|
|
2196
2292
|
function slots(template, options) {
|
|
2197
2293
|
const tpl = templateOf(template);
|
|
2198
|
-
const o = options || {};
|
|
2294
|
+
const o = resolveOptions(tpl, options || {});
|
|
2295
|
+
return withWallThickness(wallThicknessFor(tpl, o), () => slotsWith(tpl, o));
|
|
2296
|
+
}
|
|
2297
|
+
function slotsWith(tpl, o) {
|
|
2199
2298
|
const plan = buildPlan(tpl, o.w, o.d, o);
|
|
2200
2299
|
const locale = o.locale || "en";
|
|
2201
2300
|
return resolveSlots(plan).map(cleanSlot).map((s) => s.reason ? Object.assign(s, { reason: translate("reasons", s.reason, locale) }) : s);
|
|
@@ -2238,7 +2337,11 @@ var GameUrban = (() => {
|
|
|
2238
2337
|
var loc = (key, locale, ns = "labels", vars) => key ? translate(ns, key, locale, vars) : key;
|
|
2239
2338
|
function generate(template, options) {
|
|
2240
2339
|
const tpl = templateOf(template);
|
|
2241
|
-
const o = options || {};
|
|
2340
|
+
const o = resolveOptions(tpl, options || {});
|
|
2341
|
+
return withWallThickness(wallThicknessFor(tpl, o), () => generateWith(tpl, o));
|
|
2342
|
+
}
|
|
2343
|
+
var resolveOptions = (tpl, options) => registries().OPTION_RESOLVERS.reduce((op, r) => r.resolve(tpl, op), options);
|
|
2344
|
+
function generateWith(tpl, o) {
|
|
2242
2345
|
const seed = o.seed == null ? 1 : o.seed;
|
|
2243
2346
|
const locale = o.locale || "en";
|
|
2244
2347
|
let op = Object.assign({}, o, { seed });
|
|
@@ -2621,6 +2724,7 @@ var GameUrban = (() => {
|
|
|
2621
2724
|
registerState: scoped(registerState),
|
|
2622
2725
|
setStateDistribution: scoped(setStateDistribution),
|
|
2623
2726
|
registerLocale: scoped(registerLocale),
|
|
2727
|
+
registerOptionResolver: scoped(registerOptionResolver),
|
|
2624
2728
|
registerResultExtension: scoped(registerResultExtension),
|
|
2625
2729
|
registerFindsProvider: scoped(registerFindsProvider),
|
|
2626
2730
|
findsFor: scoped(findsFor),
|
|
@@ -2887,6 +2991,7 @@ var GameUrban = (() => {
|
|
|
2887
2991
|
const box = (x, y, z, width, height, depth, color, o = {}) => {
|
|
2888
2992
|
const part = { shape: "box", parent: o.parent ?? ROOT2, x, y: y + height / 2, z, width, height, depth, color, emissive: o.emissive ?? false, ry: o.ry ?? 0, rz: o.rz ?? 0, radius: boxRadius(width, height, depth) };
|
|
2889
2993
|
if (o.style) part.style = o.style;
|
|
2994
|
+
if (o.flickerPhase !== void 0) part.flickerPhase = o.flickerPhase;
|
|
2890
2995
|
parts.push(part);
|
|
2891
2996
|
};
|
|
2892
2997
|
const cylinder = (x, y, z, radiusTop, radiusBottom, height, color, parent = ROOT2, segments = DEFAULT_CYLINDER_SEGMENTS, style) => {
|
|
@@ -2951,52 +3056,87 @@ var GameUrban = (() => {
|
|
|
2951
3056
|
return { random, pick, lights, parts, items, windows, group, box, cylinder, cone, prism, plane, vault, terrain, crown, line, label, light, spot, place, item, fence, add, scene };
|
|
2952
3057
|
}
|
|
2953
3058
|
|
|
3059
|
+
// src/networks/slots.ts
|
|
3060
|
+
var DEFAULT_POLE_SLOTS = {
|
|
3061
|
+
height: 11,
|
|
3062
|
+
embedment: 1.7,
|
|
3063
|
+
bands: { mv: [9, 9.25], transformer: [7.7, 8.7], lv: [7.1, 7.4], lighting: [6.5, 6.8], telecom: [5.7, 6.1] }
|
|
3064
|
+
};
|
|
3065
|
+
|
|
3066
|
+
// src/pole-distribution.ts
|
|
3067
|
+
var DISTRIBUTION = {
|
|
3068
|
+
mast: { radiusTop: 0.12, radiusBottom: 0.22, height: 9.3, color: 9079428, segments: 4 },
|
|
3069
|
+
arm: { reach: 1, y: 6.7, width: 2, height: 0.1, depth: 0.1, color: 6974054 },
|
|
3070
|
+
lamp: { reach: 2, y: 6.55, width: 0.5, height: 0.16, depth: 0.3 },
|
|
3071
|
+
lens: { lit: 16752704, unlit: 3815994 },
|
|
3072
|
+
light: { color: 16751168, intensity: 1.3, distance: 20, y: 6.4 },
|
|
3073
|
+
transformer: { offset: 0.45, y: 7.7, radius: 0.32, height: 1, color: 5922402, segments: 8 },
|
|
3074
|
+
slots: DEFAULT_POLE_SLOTS
|
|
3075
|
+
};
|
|
3076
|
+
|
|
2954
3077
|
// src/poles.ts
|
|
2955
3078
|
var on = (o) => o.on ?? true;
|
|
3079
|
+
var lensOf = (o, parent) => ({
|
|
3080
|
+
emissive: on(o),
|
|
3081
|
+
...parent === void 0 ? {} : { parent },
|
|
3082
|
+
...on(o) && o.flicker ? { flickerPhase: flickerPhaseOf(o.x, o.z) } : {}
|
|
3083
|
+
});
|
|
3084
|
+
var along = (o, reach) => ({ x: o.x + reach * Math.cos(o.ry ?? 0), z: o.z - reach * Math.sin(o.ry ?? 0) });
|
|
2956
3085
|
function drawMast(b, mast, x, z, parent = -1) {
|
|
2957
3086
|
b.cylinder(x, 0, z, mast.radiusTop, mast.radiusBottom, mast.height, mast.color, parent, mast.segments, mast.style);
|
|
2958
3087
|
}
|
|
2959
3088
|
function spendLight(b, light, x, z, o) {
|
|
2960
|
-
|
|
3089
|
+
const ry = o.ry ?? 0;
|
|
3090
|
+
const [reach, side] = [light.reach ?? 0, light.z ?? 0];
|
|
3091
|
+
if (on(o) && b.lights.take()) b.light({ x: x + reach * Math.cos(ry) + side * Math.sin(ry), y: light.y, z: z - reach * Math.sin(ry) + side * Math.cos(ry), color: light.color, intensity: light.intensity, distance: light.distance, flicker: o.flicker ?? false, ...o.flicker ? { flickerPhase: flickerPhaseOf(o.x, o.z) } : {} });
|
|
2961
3092
|
}
|
|
2962
3093
|
var doubleArm = (b, spec, o) => {
|
|
2963
3094
|
const group = b.group(o.x, 0, o.z, o.ry ?? 0);
|
|
2964
3095
|
drawMast(b, spec.mast, 0, 0, group);
|
|
2965
3096
|
for (const side of [-1, 1]) {
|
|
2966
3097
|
b.box(side * spec.arm.reach, spec.arm.y, 0, spec.arm.width, spec.arm.height, spec.arm.depth, spec.arm.color, { parent: group });
|
|
2967
|
-
b.box(side * spec.lamp.reach, spec.lamp.y, 0, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit,
|
|
3098
|
+
b.box(side * spec.lamp.reach, spec.lamp.y, 0, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit, lensOf(o, group));
|
|
2968
3099
|
}
|
|
2969
|
-
spendLight(b, spec.light, o.x, o.z, o);
|
|
3100
|
+
spendLight(b, spec.light, o.x, o.z, { ...o, ry: 0 });
|
|
2970
3101
|
};
|
|
2971
3102
|
var singleArm = (b, spec, o) => {
|
|
2972
3103
|
const dir = o.dir ?? 1;
|
|
3104
|
+
const ry = o.ry ?? 0;
|
|
3105
|
+
const arm = along(o, dir * spec.arm.reach);
|
|
3106
|
+
const lamp = along(o, dir * spec.lamp.reach);
|
|
3107
|
+
const drum = along(o, -dir * spec.transformer.offset);
|
|
2973
3108
|
drawMast(b, spec.mast, o.x, o.z);
|
|
2974
|
-
b.box(
|
|
2975
|
-
b.box(
|
|
2976
|
-
if (o.transformer) b.cylinder(
|
|
3109
|
+
b.box(arm.x, spec.arm.y, arm.z, spec.arm.width, spec.arm.height, spec.arm.depth, spec.arm.color, { ry });
|
|
3110
|
+
b.box(lamp.x, spec.lamp.y, lamp.z, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit, { ...lensOf(o), ry });
|
|
3111
|
+
if (o.transformer) b.cylinder(drum.x, spec.transformer.y, drum.z, spec.transformer.radius, spec.transformer.radius, spec.transformer.height, spec.transformer.color, -1, spec.transformer.segments);
|
|
2977
3112
|
spendLight(b, { ...spec.light, reach: dir * (spec.light.reach ?? spec.lamp.reach) }, o.x, o.z, o);
|
|
2978
3113
|
};
|
|
2979
3114
|
var lantern = (b, spec, o) => {
|
|
3115
|
+
const lamp = along(o, spec.lamp.reach);
|
|
2980
3116
|
drawMast(b, spec.mast, o.x, o.z);
|
|
2981
|
-
b.box(
|
|
3117
|
+
b.box(lamp.x, spec.lamp.y, lamp.z, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit, { ...lensOf(o), ry: o.ry ?? 0 });
|
|
2982
3118
|
b.cone(o.x, spec.cap.y, o.z, spec.cap.radius, spec.cap.height, spec.cap.color, -1, spec.cap.segments);
|
|
2983
3119
|
spendLight(b, spec.light, o.x, o.z, o);
|
|
2984
3120
|
};
|
|
2985
3121
|
var crossarm = (b, spec, o) => {
|
|
3122
|
+
const ry = o.ry ?? 0;
|
|
3123
|
+
const arm = along(o, spec.arm.reach);
|
|
3124
|
+
const lamp = along(o, spec.lamp.reach);
|
|
2986
3125
|
drawMast(b, spec.mast, o.x, o.z);
|
|
2987
|
-
b.box(
|
|
2988
|
-
b.box(
|
|
3126
|
+
b.box(arm.x, spec.arm.y, arm.z, spec.arm.width, spec.arm.height, spec.arm.depth, spec.arm.color, { ry });
|
|
3127
|
+
b.box(lamp.x, spec.lamp.y, lamp.z, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit, { ...lensOf(o), ry });
|
|
2989
3128
|
spendLight(b, { ...spec.light, reach: spec.light.reach ?? spec.lamp.reach }, o.x, o.z, o);
|
|
2990
3129
|
};
|
|
2991
3130
|
var floodTower = (b, spec, o) => {
|
|
2992
3131
|
for (const a of [-1, 1]) for (const c of [-1, 1]) b.box(o.x + a * spec.legs.offset, 0, o.z + c * spec.legs.offset, spec.legs.size, spec.legs.height, spec.legs.size, spec.legs.color);
|
|
2993
3132
|
b.box(o.x + spec.deck.reach, spec.deck.y, o.z, spec.deck.width, spec.deck.height, spec.deck.depth, spec.deck.color);
|
|
2994
3133
|
for (let index = 0; index < spec.heads.count; index++) {
|
|
2995
|
-
b.box(o.x + spec.heads.start + index * spec.heads.spacing, spec.heads.y, o.z + spec.heads.z, spec.heads.width, spec.heads.height, spec.heads.depth, on(o) ? spec.lens.lit : spec.lens.unlit,
|
|
3134
|
+
b.box(o.x + spec.heads.start + index * spec.heads.spacing, spec.heads.y, o.z + spec.heads.z, spec.heads.width, spec.heads.height, spec.heads.depth, on(o) ? spec.lens.lit : spec.lens.unlit, lensOf(o));
|
|
2996
3135
|
}
|
|
2997
3136
|
spendLight(b, spec.light, o.x, o.z, o);
|
|
2998
3137
|
};
|
|
2999
|
-
var
|
|
3138
|
+
var distribution = (b, spec, o) => singleArm(b, spec, o);
|
|
3139
|
+
var POLE_SHAPES = { double_arm: doubleArm, single_arm: singleArm, lantern, crossarm, flood_tower: floodTower, distribution };
|
|
3000
3140
|
var LED = {
|
|
3001
3141
|
mast: { radiusTop: 0.1, radiusBottom: 0.14, height: 9, color: 5593438, style: { metalness: 0.6, roughness: 0.5 } },
|
|
3002
3142
|
arm: { reach: 0.8, y: 8.8, width: 1.6, height: 0.1, depth: 0.12, color: 5593438 },
|
|
@@ -3038,7 +3178,8 @@ var GameUrban = (() => {
|
|
|
3038
3178
|
{ id: "concrete_arm", shape: "single_arm", spec: CONCRETE },
|
|
3039
3179
|
{ id: "cast_iron", shape: "lantern", spec: IRON },
|
|
3040
3180
|
{ id: "wood_crossarm", shape: "crossarm", spec: WOOD },
|
|
3041
|
-
{ id: "flood_tower", shape: "flood_tower", spec: FLOOD }
|
|
3181
|
+
{ id: "flood_tower", shape: "flood_tower", spec: FLOOD },
|
|
3182
|
+
{ id: "concrete_distribution", shape: "distribution", spec: DISTRIBUTION }
|
|
3042
3183
|
];
|
|
3043
3184
|
|
|
3044
3185
|
// src/streets.ts
|
|
@@ -3049,9 +3190,9 @@ var GameUrban = (() => {
|
|
|
3049
3190
|
var DEFAULT_GROUND_SIZE = 600;
|
|
3050
3191
|
var roadStyle = (o) => ({ ...DEFAULT_ROAD_STYLE, ...o?.road, dash: { ...DEFAULT_ROAD_STYLE.dash, ...o?.road?.dash } });
|
|
3051
3192
|
var walkStyle = (o) => ({ ...DEFAULT_WALK_STYLE, ...o?.walk });
|
|
3052
|
-
function drawRoad(b, x, z, w, l,
|
|
3193
|
+
function drawRoad(b, x, z, w, l, along2, options) {
|
|
3053
3194
|
const style = roadStyle(options);
|
|
3054
|
-
const alongX =
|
|
3195
|
+
const alongX = along2 === "x";
|
|
3055
3196
|
b.plane(x, ROAD_LEVEL, z, alongX ? l : w, alongX ? w : l, style.color);
|
|
3056
3197
|
const { dash } = style;
|
|
3057
3198
|
for (let u = -l / 2 + dash.first; u < l / 2; u += dash.every) {
|
|
@@ -3262,12 +3403,12 @@ var GameUrban = (() => {
|
|
|
3262
3403
|
for (const side of [-1.5, 1.5]) b.box(x + side, 8.2, z, 0.15, 1.6, 0.15, palette2.deck);
|
|
3263
3404
|
if (searchlight) b.spot({ x, y: 9, z, color: 15134463, intensity: 2.4, distance: 70, decay: 1.2, angle: 0.35, penumbra: 0.5, target: { x: x + 20, y: 0, z: z + 20 }, sweep: { speed: 0.5, radius: 25 } });
|
|
3264
3405
|
}
|
|
3265
|
-
function drawSandbags(b, x, z, length,
|
|
3406
|
+
function drawSandbags(b, x, z, length, along2, rows = 3, c) {
|
|
3266
3407
|
const color = colors(c).sandbags;
|
|
3267
3408
|
for (let r = 0; r < rows; r++) {
|
|
3268
3409
|
for (let i = 0; i < length / SANDBAG_LENGTH; i++) {
|
|
3269
3410
|
const u = -length / 2 + 0.28 + i * SANDBAG_LENGTH + r % 2 * 0.28;
|
|
3270
|
-
b.item(
|
|
3411
|
+
b.item(along2 === "x" ? x + u : x, r * 0.21, along2 === "x" ? z : z + u, along2 === "x" ? 0.55 : 0.32, 0.22, along2 === "x" ? 0.32 : 0.55, color);
|
|
3271
3412
|
}
|
|
3272
3413
|
}
|
|
3273
3414
|
}
|
|
@@ -4272,7 +4413,7 @@ var GameUrban = (() => {
|
|
|
4272
4413
|
const core = {
|
|
4273
4414
|
poles,
|
|
4274
4415
|
streets: {
|
|
4275
|
-
road: (b, x, z, w, l,
|
|
4416
|
+
road: (b, x, z, w, l, along2) => drawRoad(b, x, z, w, l, along2, options.streets),
|
|
4276
4417
|
walk: (b, x, z, w, d) => drawWalk(b, x, z, w, d, options.streets),
|
|
4277
4418
|
ground: drawGround,
|
|
4278
4419
|
grid: (b, g) => drawStreetGrid(b, g.block, g.count, g.width, options.streets)
|
|
@@ -4289,7 +4430,7 @@ var GameUrban = (() => {
|
|
|
4289
4430
|
tree: (b, x, z, scale) => drawTree(b, x, z, scale, propColors),
|
|
4290
4431
|
container: drawContainer,
|
|
4291
4432
|
watchtower: (b, x, z, searchlight) => drawWatchtower(b, x, z, searchlight, propColors),
|
|
4292
|
-
sandbags: (b, x, z, length,
|
|
4433
|
+
sandbags: (b, x, z, length, along2, rows) => drawSandbags(b, x, z, length, along2, rows, propColors),
|
|
4293
4434
|
label: (b, x, z, title, subtitle) => drawStripLabel(b, x, z, title, subtitle, propColors),
|
|
4294
4435
|
wires: (b, points, y, color) => drawWires(b, points, y, color, propColors)
|
|
4295
4436
|
}
|
|
@@ -7961,6 +8102,32 @@ var GameUrban = (() => {
|
|
|
7961
8102
|
}
|
|
7962
8103
|
];
|
|
7963
8104
|
}
|
|
8105
|
+
var THICKNESS_STEP = 0.0625;
|
|
8106
|
+
var THINNEST = 0.15;
|
|
8107
|
+
var CLEARANCE = 15e-4;
|
|
8108
|
+
var SPOKE_HALF_THICKNESS = 0.02;
|
|
8109
|
+
var DISH_HALF_THICKNESS = 0.025;
|
|
8110
|
+
function sharesPlaneWithDish(reach, scale) {
|
|
8111
|
+
const dishReach = reach * 0.9;
|
|
8112
|
+
const outer = Math.abs(reach + SPOKE_HALF_THICKNESS * scale - (dishReach + DISH_HALF_THICKNESS));
|
|
8113
|
+
const inner2 = Math.abs(reach - SPOKE_HALF_THICKNESS * scale - (dishReach - DISH_HALF_THICKNESS));
|
|
8114
|
+
return outer < CLEARANCE || inner2 < CLEARANCE;
|
|
8115
|
+
}
|
|
8116
|
+
function separateSpokes(context) {
|
|
8117
|
+
for (const wheel of context.wheels) {
|
|
8118
|
+
let previous = 1 + THICKNESS_STEP;
|
|
8119
|
+
for (const child of wheel.children) {
|
|
8120
|
+
const mesh = child;
|
|
8121
|
+
const type = mesh.geometry?.type;
|
|
8122
|
+
if (!mesh.isMesh || type !== "BufferGeometry" && type !== "BoxGeometry" || mesh.position.z === 0) continue;
|
|
8123
|
+
const reach = Math.abs(mesh.position.z);
|
|
8124
|
+
let scale = previous - THICKNESS_STEP;
|
|
8125
|
+
while (sharesPlaneWithDish(reach, scale) && scale > THINNEST) scale -= THICKNESS_STEP / 2;
|
|
8126
|
+
mesh.scale.z = Math.max(scale, THINNEST);
|
|
8127
|
+
previous = scale;
|
|
8128
|
+
}
|
|
8129
|
+
}
|
|
8130
|
+
}
|
|
7964
8131
|
function installBoatsExtra(fx) {
|
|
7965
8132
|
const kit = fx.kit;
|
|
7966
8133
|
const THREE = kit.THREE;
|
|
@@ -8394,12 +8561,12 @@ var GameUrban = (() => {
|
|
|
8394
8561
|
cs.castShadow = false;
|
|
8395
8562
|
[1, -1].forEach(function(s) {
|
|
8396
8563
|
c.roundBox(2.6, 0.06, 0.42, 0.02, teak, -2.45, 0.86, s * 0.82);
|
|
8397
|
-
c.roundBox(2.6, 0.
|
|
8564
|
+
c.roundBox(2.6, 0.376, 0.06, 0.02, white, -2.45, 0.671, s * 0.6);
|
|
8398
8565
|
c.roundBox(2.8, 0.22, 0.05, 0.02, white, -2.4, 1.02, s * (H.sheerAt(-2.4).z - 0.32));
|
|
8399
8566
|
c.cylinder(0.06, 0.07, 0.11, MT.chrome, -1.6, 1.15, s * 1.06);
|
|
8400
8567
|
c.cylinder(0.035, 0.035, 0.02, MT.chrome, -1.6, 1.21, s * 1.06);
|
|
8401
8568
|
});
|
|
8402
|
-
c.roundBox(0.3, 0.
|
|
8569
|
+
c.roundBox(0.3, 0.376, 1.2, 0.03, white, -3.75, 0.671, 0);
|
|
8403
8570
|
c.seatTops.push({ x: -2.6, y: 0.9, z: 0.82, w: 0.42, l: 2.4 }, { x: -2.6, y: 0.9, z: -0.82, w: 0.42, l: 2.4 });
|
|
8404
8571
|
const trST = [
|
|
8405
8572
|
[-1.1, 0.8, 1.56, 2, 6],
|
|
@@ -8808,9 +8975,9 @@ var GameUrban = (() => {
|
|
|
8808
8975
|
});
|
|
8809
8976
|
c.roundBox(1.6, 0.03, 0.1, 0.01, MT.wood, 0.3, 0.05, 0.38, { rot: [0.2, 0, 0] });
|
|
8810
8977
|
c.roundBox(1.6, 0.03, 0.1, 0.01, MT.wood, 0.3, 0.06, 0.28, { rot: [0.2, 0, 0] });
|
|
8811
|
-
c.roundBox(0.36, 0.24, 0.26, 0.03, CM("#ffffff", { roughness: 0.5 }), 1.25, 0.
|
|
8978
|
+
c.roundBox(0.36, 0.24, 0.26, 0.03, CM("#ffffff", { roughness: 0.5 }), 1.25, 0.142, 0.15);
|
|
8812
8979
|
c.roundBox(0.1, 0.03, 0.02, 5e-3, CM("#d01c1c"), 1.25, 0.2, 0.282);
|
|
8813
|
-
c.roundBox(0.03, 0.1, 0.02, 5e-3, CM("#d01c1c"), 1.25, 0.2, 0.
|
|
8980
|
+
c.roundBox(0.03, 0.1, 0.02, 5e-3, CM("#d01c1c"), 1.25, 0.2, 0.284);
|
|
8814
8981
|
const buoy = c.add(new THREE.TorusGeometry(0.24, 0.06, 10, 24), CM("#f0f0ea", { roughness: 0.6 }), 1.1, 0.1, -0.2);
|
|
8815
8982
|
buoy.rotation.x = PI / 2;
|
|
8816
8983
|
const motor = EA.outboard(c, -1.99, 0.55, 0, { k: 1, tiller: true, label: "40", col: "#1d1f22" });
|
|
@@ -8946,7 +9113,7 @@ var GameUrban = (() => {
|
|
|
8946
9113
|
return Math.min(0.06 - y, x - x0 - 0.04);
|
|
8947
9114
|
}),
|
|
8948
9115
|
CM("#1d2023", { roughness: 0.6 }),
|
|
8949
|
-
{ sz: 1.004, dy: 3e-3 }
|
|
9116
|
+
{ sz: 1.004, dy: 3e-3, ends: false }
|
|
8950
9117
|
);
|
|
8951
9118
|
EA.sheerTube(c, H, x0 + 0.02, 6.2, 0.07, blk, { dy: -0.1, dz: 0.02 });
|
|
8952
9119
|
const deck = c.add(EA.deckGeo(H, x0 + 0.02, 6.32, { n: 40, m: 10, crown: 0.05 }), deckC);
|
|
@@ -12037,7 +12204,7 @@ var GameUrban = (() => {
|
|
|
12037
12204
|
[0.62, 0.48, -0.48, -0.62].forEach(function(z) {
|
|
12038
12205
|
const s = dg.at(dg.uz(z), 0.25);
|
|
12039
12206
|
c2.cylinder(0.045, 0.045, 0.1, EXH, s.p.x - 0.02, 0.25, z, "x");
|
|
12040
|
-
c2.cylinder(0.036, 0.036, 0.
|
|
12207
|
+
c2.cylinder(0.036, 0.036, 0.106, MT.dark, s.p.x - 0.02, 0.25, z, "x");
|
|
12041
12208
|
});
|
|
12042
12209
|
const lip = K.grid(-1, 0, { z1: 0.7, y0: 0.88, y1: 0.97, du: 0.03, dv: 0.02 });
|
|
12043
12210
|
K.skin(lip, GLOSS, { u0: 0.05, u1: 0.95, yb: 0.925, yt: 0.955, off: 0.016, thick: 0.02, nv: 2 });
|
|
@@ -12140,9 +12307,9 @@ var GameUrban = (() => {
|
|
|
12140
12307
|
c.cylinder(0.08, 0.065, 0.12, MT.steel, x, y, z, "x");
|
|
12141
12308
|
c.cylinder(0.07, 0.07, 0.012, MT.head, x + 0.065, y, z, "x");
|
|
12142
12309
|
}
|
|
12143
|
-
function sandbags(c, x0, x1, y, z,
|
|
12310
|
+
function sandbags(c, x0, x1, y, z, along2) {
|
|
12144
12311
|
const bag = CM("#6e6248", { roughness: 0.95 });
|
|
12145
|
-
if (
|
|
12312
|
+
if (along2 === "z") {
|
|
12146
12313
|
for (let zz = x0; zz <= x1 + 1e-6; zz += 0.42) {
|
|
12147
12314
|
c.roundBox(0.3, 0.16, 0.4, 0.07, bag, z, y, zz);
|
|
12148
12315
|
c.roundBox(0.3, 0.16, 0.4, 0.07, bag, z, y + 0.15, zz + 0.2 > x1 ? zz : zz + 0.2);
|
|
@@ -12450,7 +12617,7 @@ var GameUrban = (() => {
|
|
|
12450
12617
|
side: s,
|
|
12451
12618
|
noPart: true
|
|
12452
12619
|
});
|
|
12453
|
-
c.roundBox(0.03, 0.12, 0.42, 0.02, MT.dark, bx + 0.
|
|
12620
|
+
c.roundBox(0.03, 0.12, 0.42, 0.02, MT.dark, bx + 0.119, by - bh * 0.3, s * 0.35);
|
|
12454
12621
|
});
|
|
12455
12622
|
}
|
|
12456
12623
|
c.roundBox(0.06, 0.06, 0.12, 0.02, MT.steel, bx + 0.13, by - bh * 0.35, 0);
|
|
@@ -12553,7 +12720,7 @@ var GameUrban = (() => {
|
|
|
12553
12720
|
-(W - 0.2) / 2 + (k + 0.5) * (W - 0.2) / 8
|
|
12554
12721
|
);
|
|
12555
12722
|
[1, -1].forEach(function(s) {
|
|
12556
|
-
c.roundBox(0.06, 0.32, 0.06, 0.01, MT.trim, rear + 0.
|
|
12723
|
+
c.roundBox(0.06, 0.32, 0.06, 0.01, MT.trim, rear + 0.118, ry - 0.2, s * 0.43);
|
|
12557
12724
|
});
|
|
12558
12725
|
m.rearBumper = bar;
|
|
12559
12726
|
c.part("bumper", trl("labels.rear_bumper"), bar, new V3(rear, 0.52, 0), 1);
|
|
@@ -13615,7 +13782,7 @@ var GameUrban = (() => {
|
|
|
13615
13782
|
});
|
|
13616
13783
|
const vg = c.roundBox(0.32, 0.2, 0.03, 0.03, MT.armorGlass, 1.3, 2.45, zs);
|
|
13617
13784
|
kit.asGlass(c, vg, s > 0 ? lbl("right_armored_viewport") : lbl("left_armored_viewport"), "laminated");
|
|
13618
|
-
c.roundBox(0.4, 0.28, 0.02, 0.03, plate, 1.3, 2.45, zs - s *
|
|
13785
|
+
c.roundBox(0.4, 0.28, 0.02, 0.03, plate, 1.3, 2.45, zs - s * 8e-3);
|
|
13619
13786
|
for (let x = rear + 0.2; x < bx0; x += 0.3) {
|
|
13620
13787
|
c.sphere(0.018, MT.steel, x, 1.2, zs);
|
|
13621
13788
|
c.sphere(0.018, MT.steel, x, 2.98, zs);
|
|
@@ -13724,7 +13891,7 @@ var GameUrban = (() => {
|
|
|
13724
13891
|
const hx0 = 0.02, hx1 = 1.84 + FX, hy = 1.48;
|
|
13725
13892
|
[1, -1].forEach(function(s) {
|
|
13726
13893
|
c.roundBox(hx1 - hx0, 0.38, 0.035, 0.02, paint, (hx0 + hx1) / 2, 1.22, s * 0.36, { def: true });
|
|
13727
|
-
for (let j = 0; j < 5; j++) c.roundBox(0.22, 0.025, 0.012, 8e-3, MT.dark, 0.75 + j * 0.16, 1.24, s * 0.38);
|
|
13894
|
+
for (let j = 0; j < 5; j++) c.roundBox(0.22, 0.025, 0.012, 8e-3, MT.dark, 0.75 + j * 0.16, 1.24, s * (0.38 + j % 2 * 3e-3));
|
|
13728
13895
|
c.roundBox(1, 0.03, 0.02, 0.01, CM("#e9e6dd"), 0.55, 1.36, s * 0.38);
|
|
13729
13896
|
c.text("275", 0.3, 0.14, 0.32, 1.2, s * 0.384, s > 0 ? "+z" : "-z", { fg: "#f2efe6" });
|
|
13730
13897
|
});
|
|
@@ -14198,7 +14365,7 @@ var GameUrban = (() => {
|
|
|
14198
14365
|
const hs = c.add(
|
|
14199
14366
|
EA.foilGeo(
|
|
14200
14367
|
[
|
|
14201
|
-
{ p: [-3.9, 1.44,
|
|
14368
|
+
{ p: [-3.9, 1.44, s * 2e-3], c: 0.3, t: 0.1 },
|
|
14202
14369
|
{ p: [-3.95, 1.44, s * 0.42], c: 0.22, t: 0.09 }
|
|
14203
14370
|
],
|
|
14204
14371
|
{ up: "y", n: 8 }
|
|
@@ -14437,7 +14604,7 @@ var GameUrban = (() => {
|
|
|
14437
14604
|
},
|
|
14438
14605
|
lbl("chin_windows"),
|
|
14439
14606
|
"tempered",
|
|
14440
|
-
{ pos: new V3(2.3, 0.88, 0) }
|
|
14607
|
+
{ pos: new V3(2.3, 0.88, 0), k: 0.988 }
|
|
14441
14608
|
);
|
|
14442
14609
|
[1, -1].forEach(function(s) {
|
|
14443
14610
|
EA.fuseGlass(
|
|
@@ -14537,7 +14704,7 @@ var GameUrban = (() => {
|
|
|
14537
14704
|
tipCol: "#e6e4dd",
|
|
14538
14705
|
phase: 0.25
|
|
14539
14706
|
});
|
|
14540
|
-
c.roundBox(0.5, 0.12, 0.16, 0.05, MT.steel, 0, 2.
|
|
14707
|
+
c.roundBox(0.5, 0.12, 0.16, 0.05, MT.steel, 0, 2.797, 0);
|
|
14541
14708
|
const bm = boom(
|
|
14542
14709
|
c,
|
|
14543
14710
|
EA,
|
|
@@ -14571,7 +14738,7 @@ var GameUrban = (() => {
|
|
|
14571
14738
|
const hs = c.add(
|
|
14572
14739
|
EA.foilGeo(
|
|
14573
14740
|
[
|
|
14574
|
-
{ p: [-4.05, 1.68,
|
|
14741
|
+
{ p: [-4.05, 1.68, s * 2e-3], c: 0.42, t: 0.12, cam: -0.04 },
|
|
14575
14742
|
{ p: [-4.1, 1.68, s * 0.99], c: 0.38, t: 0.11, cam: -0.04 }
|
|
14576
14743
|
],
|
|
14577
14744
|
{ up: "y", n: 8 }
|
|
@@ -14820,7 +14987,7 @@ var GameUrban = (() => {
|
|
|
14820
14987
|
},
|
|
14821
14988
|
lbl("chin_windows"),
|
|
14822
14989
|
"tempered",
|
|
14823
|
-
{ pos: new V3(3.05, 0.95, 0) }
|
|
14990
|
+
{ pos: new V3(3.05, 0.95, 0), k: 0.988 }
|
|
14824
14991
|
);
|
|
14825
14992
|
[1, -1].forEach(function(s) {
|
|
14826
14993
|
EA.fuseGlass(c, ST, EA.sideKeepP(fdP, 0.6, s), s > 0 ? lbl("co_pilot_door_window") : lbl("pilot_door_window"), "tempered", {
|
|
@@ -14985,7 +15152,7 @@ var GameUrban = (() => {
|
|
|
14985
15152
|
const hs = c.add(
|
|
14986
15153
|
EA.foilGeo(
|
|
14987
15154
|
[
|
|
14988
|
-
{ p: [-5.75, 2.1,
|
|
15155
|
+
{ p: [-5.75, 2.1, s * 2e-3], c: 0.62, t: 0.12, cam: -0.03 },
|
|
14989
15156
|
{ p: [-5.85, 2.1, s * 1.05], c: 0.52, t: 0.11, cam: -0.03 }
|
|
14990
15157
|
],
|
|
14991
15158
|
{ up: "y", n: 8 }
|
|
@@ -15398,7 +15565,7 @@ var GameUrban = (() => {
|
|
|
15398
15565
|
EA.colorize(
|
|
15399
15566
|
EA.foilGeo(
|
|
15400
15567
|
[
|
|
15401
|
-
{ p: [-8.3, 2.75,
|
|
15568
|
+
{ p: [-8.3, 2.75, s * 2e-3], c: 1, t: 0.1 },
|
|
15402
15569
|
{ p: [-8.5, 2.75, s * 1.85], c: 0.7, t: 0.09 }
|
|
15403
15570
|
],
|
|
15404
15571
|
{ up: "y", n: 8 }
|
|
@@ -15841,13 +16008,13 @@ var GameUrban = (() => {
|
|
|
15841
16008
|
});
|
|
15842
16009
|
return out;
|
|
15843
16010
|
}
|
|
15844
|
-
function sandbags(c, x0, x1, y, z,
|
|
16011
|
+
function sandbags(c, x0, x1, y, z, along2, rows) {
|
|
15845
16012
|
rows = rows || 2;
|
|
15846
16013
|
for (let r = 0; r < rows; r++) {
|
|
15847
16014
|
const off = r % 2 ? 0.2 : 0;
|
|
15848
16015
|
for (let t = x0 + off; t <= x1 + 1e-6; t += 0.42) {
|
|
15849
16016
|
const j = kit.hash(t, r, z) - 0.5;
|
|
15850
|
-
if (
|
|
16017
|
+
if (along2 === "z") c.roundBox(0.32, 0.16, 0.42, 0.07, BAG, z, y + r * 0.14, t, { rot: [0, j * 0.2, 0] });
|
|
15851
16018
|
else c.roundBox(0.42, 0.16, 0.32, 0.07, BAG, t, y + r * 0.14, z, { rot: [0, j * 0.2, 0] });
|
|
15852
16019
|
}
|
|
15853
16020
|
}
|
|
@@ -16468,7 +16635,7 @@ var GameUrban = (() => {
|
|
|
16468
16635
|
const floor = c.roundBox(L, 0.1, W, 0.02, wood, cx, y0, 0, { def: true });
|
|
16469
16636
|
c.roundBox(L - 0.1, 0.14, 0.2, 0.02, MT.trim, cx, y0 - 0.12, 0.45);
|
|
16470
16637
|
c.roundBox(L - 0.1, 0.14, 0.2, 0.02, MT.trim, cx, y0 - 0.12, -0.45);
|
|
16471
|
-
for (let xs = x1 + 0.2; xs < x0; xs += 0.55) c.roundBox(0.08, 0.1, W - 0.05, 0.02, MT.trim, xs, y0 - 0.
|
|
16638
|
+
for (let xs = x1 + 0.2; xs < x0; xs += 0.55) c.roundBox(0.08, 0.1, W - 0.05, 0.02, MT.trim, xs, y0 - 0.102, 0);
|
|
16472
16639
|
const sides = [];
|
|
16473
16640
|
[1, -1].forEach(function(s) {
|
|
16474
16641
|
const sd = c.roundBox(L, sideH, 0.06, 0.02, wood, cx, y0 + sideH / 2 + 0.05, s * (W / 2 - 0.03), { def: true });
|
|
@@ -16479,7 +16646,7 @@ var GameUrban = (() => {
|
|
|
16479
16646
|
c.roundBox(L, 0.03, 0.015, 6e-3, CM("#3a3c2e", { roughness: 0.9 }), cx, y0 + 0.05 + sideH * t * 2, s * (W / 2 + 2e-3));
|
|
16480
16647
|
});
|
|
16481
16648
|
});
|
|
16482
|
-
c.roundBox(0.06, sideH, W, 0.02, wood, x0 - 0.
|
|
16649
|
+
c.roundBox(0.06, sideH, W, 0.02, wood, x0 - 0.028, y0 + sideH / 2 + 0.05, 0, { def: true });
|
|
16483
16650
|
const tg = c.roundBox(0.06, sideH * 0.7, W - 0.1, 0.02, wood, x1 - 0.02, y0 - sideH * 0.3, 0);
|
|
16484
16651
|
tg.rotation.z = 0.08;
|
|
16485
16652
|
const top = y0 + sideH + bowH, yb = y0 + sideH + 0.05, nseg = 20, pos = [], idx = [];
|
|
@@ -16873,7 +17040,7 @@ var GameUrban = (() => {
|
|
|
16873
17040
|
top: roofY + 0.03,
|
|
16874
17041
|
k: 0.28,
|
|
16875
17042
|
holes,
|
|
16876
|
-
archInner: W / 2 - ww - 0.
|
|
17043
|
+
archInner: W / 2 - ww - 0.098,
|
|
16877
17044
|
sub: 0.18,
|
|
16878
17045
|
bev: 0.025
|
|
16879
17046
|
});
|
|
@@ -17206,8 +17373,7 @@ var GameUrban = (() => {
|
|
|
17206
17373
|
[1.3, roofY, 0.1],
|
|
17207
17374
|
[F - 0.04, 1.02, 0.06],
|
|
17208
17375
|
[F, 0.9, 0.05],
|
|
17209
|
-
[2.05, 0.46, 0.06]
|
|
17210
|
-
[-1.4, 0.44, 0.04]
|
|
17376
|
+
[2.05, 0.46, 0.06]
|
|
17211
17377
|
];
|
|
17212
17378
|
const arches = axles.map(function(x) {
|
|
17213
17379
|
return [x, wr, wr + 0.09];
|
|
@@ -17285,8 +17451,8 @@ var GameUrban = (() => {
|
|
|
17285
17451
|
[1, -1].forEach(function(s) {
|
|
17286
17452
|
c.roundBox(1.6, 0.16, 0.12, 0.04, OLIVE_STEEL, (axles[1] + axles[2]) / 2, wr, s * (W / 2 - ww - 0.1));
|
|
17287
17453
|
c.cylinder(0.12, 0.12, 0.2, OLIVE_STEEL, (axles[1] + axles[2]) / 2, wr, s * (W / 2 - ww - 0.1), "z");
|
|
17288
|
-
c.roundBox(1, 0.05, 0.32, 0.02, paintMat(c, col), axles[0], 1.12, s * (W / 2 - 0.
|
|
17289
|
-
c.roundBox(2.35, 0.05, 0.32, 0.02, paintMat(c, col), (axles[1] + axles[2]) / 2, 1.12, s * (W / 2 - 0.
|
|
17454
|
+
c.roundBox(1, 0.05, 0.32, 0.02, paintMat(c, col), axles[0], 1.12, s * (W / 2 - 0.158), { def: true });
|
|
17455
|
+
c.roundBox(2.35, 0.05, 0.32, 0.02, paintMat(c, col), (axles[1] + axles[2]) / 2, 1.12, s * (W / 2 - 0.158), { def: true });
|
|
17290
17456
|
c.roundBox(1.2, 0.26, 0.28, 0.03, paintMat(c, OLIVE2), -1.45, 1.28, s * (W / 2 - 0.17));
|
|
17291
17457
|
[-0.95, -1.95].forEach(function(x) {
|
|
17292
17458
|
c.roundBox(0.3, 0.2, 0.02, 0.01, MT.dark, x, 1.28, s * (W / 2 - 0.025));
|
|
@@ -17443,7 +17609,7 @@ var GameUrban = (() => {
|
|
|
17443
17609
|
m.kind = "car";
|
|
17444
17610
|
m.bullet = true;
|
|
17445
17611
|
const low = c.roundBox(6.6, 0.62, 2, 0.08, paintMat(c, col), -0.1, 0.78, 0, { def: true, sub: 0.3 });
|
|
17446
|
-
c.roundBox(0.55, 0.62, 2, 0.06, paintMat(c, col), 3.1, 0.8, 0, { def: true, rot: [0, 0, -0.95] });
|
|
17612
|
+
c.roundBox(0.55, 0.62, 2.004, 0.06, paintMat(c, col), 3.1, 0.8, 0, { def: true, rot: [0, 0, -0.95] });
|
|
17447
17613
|
const items = [
|
|
17448
17614
|
[R, 1.05, 0.04],
|
|
17449
17615
|
[R - 0.02, deckY - 0.04, 0.05],
|
|
@@ -17486,7 +17652,7 @@ var GameUrban = (() => {
|
|
|
17486
17652
|
(ex0 + ex1) / 2
|
|
17487
17653
|
);
|
|
17488
17654
|
scale(c, nB, bcen, 1.45);
|
|
17489
|
-
c.roundBox(ex1 - ex0 - 0.1, 0.
|
|
17655
|
+
c.roundBox(ex1 - ex0 - 0.1, 0.012, 2.1, 0.01, BAY_LIGHT, bcen.x, 0.957, 0);
|
|
17490
17656
|
[1, -1].forEach(function(sd) {
|
|
17491
17657
|
c.roundBox(ex1 - ex0 - 0.1, 0.55, 0.02, 0.01, BAY_LIGHT, bcen.x, 1.25, sd * 1.08);
|
|
17492
17658
|
});
|
|
@@ -17512,12 +17678,12 @@ var GameUrban = (() => {
|
|
|
17512
17678
|
c.roundBox(0.55, 0.42, 0.03, 0.01, MT.rubber, 2.95, 0.86, s * (W / 2 + 0.05));
|
|
17513
17679
|
c.part("armor", s > 0 ? trl("labels.right_skirt") : trl("labels.left_skirt"), sk, new V3(-0.2, 0.86, s * W / 2), 1.2);
|
|
17514
17680
|
c.roundBox(0.5, 0.03, 0.6, 0.01, paintMat(c, col), F - 0.25, 1.08, s * tz, { rot: [0, 0, -0.35] });
|
|
17515
|
-
c.roundBox(0.03, 0.5, 0.55, 0.01, MT.rubber, R + 0.
|
|
17681
|
+
c.roundBox(0.03, 0.5, 0.55, 0.01, MT.rubber, R + 0.015, 0.85, s * tz);
|
|
17516
17682
|
star(c, 0.6, 1.3, s * (H.half(1.3) + 0.01), 0.17, s > 0 ? "+z" : "-z", { ring: true });
|
|
17517
17683
|
c.text(trl("texts.army"), 1, 0.16, -1.5, 1.3, s * (H.half(1.3) + 0.01), s > 0 ? "+z" : "-z", { fg: "#dcdace", size: 0.7 });
|
|
17518
17684
|
guardedHeadlight(c, 2.95, gl(2.95) + 0.16, s * 1.3, s, { style: "round" });
|
|
17519
17685
|
c.roundBox(0.1, 0.16, 0.08, 0.02, OLIVE_STEEL, 2.9, gl(2.9) + 0.04, s * 1.3);
|
|
17520
|
-
c.roundBox(0.1, 0.18, 0.3, 0.03, OLIVE_STEEL, R - 0.
|
|
17686
|
+
c.roundBox(0.1, 0.18, 0.3, 0.03, OLIVE_STEEL, R - 0.037, 1.35, s * 1.25);
|
|
17521
17687
|
kit.taillight(c, { style: "round2", x: R - 0.08, y: 1.35, z: s * 1.25, w: 0.2, h: 0.09, d: 0.05, side: s });
|
|
17522
17688
|
c.tube(
|
|
17523
17689
|
[
|
|
@@ -17559,7 +17725,7 @@ var GameUrban = (() => {
|
|
|
17559
17725
|
{ rot: [0, 0, -0.18] }
|
|
17560
17726
|
);
|
|
17561
17727
|
hatch(c, 2.05, roofY - 0.1, -0.78, 0.28, 0, OLIVE_STEEL, { yaw: 0 });
|
|
17562
|
-
kit.seat(c, 1.95, 0.62, -0.
|
|
17728
|
+
kit.seat(c, 1.95, 0.62, -0.76, { w: 0.44, h: 0.34, back: 0.5, lean: 0.5, mat: CM("#2f3226", { roughness: 0.9 }) });
|
|
17563
17729
|
[-0.95, -0.78, -0.61].forEach(function(z, i) {
|
|
17564
17730
|
periscope(c, 2.3, roofY - 0.08, z, 0.14, i === 1 ? lbl("driver_periscope") : null);
|
|
17565
17731
|
});
|
|
@@ -17681,14 +17847,14 @@ var GameUrban = (() => {
|
|
|
17681
17847
|
const g = new THREE.Group();
|
|
17682
17848
|
g.position.set(x, y, z);
|
|
17683
17849
|
c.vehicle.add(g);
|
|
17684
|
-
const wmsh = new THREE.Mesh(new THREE.CylinderGeometry(rad, rad, w * 0.8, 24), wm);
|
|
17850
|
+
const wmsh = new THREE.Mesh(new THREE.CylinderGeometry(rad, rad, w * (opt.width ?? 0.8), 24), wm);
|
|
17685
17851
|
wmsh.rotation.x = PI / 2;
|
|
17686
17852
|
wmsh.castShadow = true;
|
|
17687
17853
|
g.add(wmsh);
|
|
17688
17854
|
if (opt.tires)
|
|
17689
17855
|
[-1, 1].forEach(function(q) {
|
|
17690
17856
|
const t = new THREE.Mesh(new THREE.TorusGeometry(rad - 0.035, 0.035, 6, 24), MT.rubber);
|
|
17691
|
-
t.position.z = q * w * 0.22;
|
|
17857
|
+
t.position.z = q * w * (opt.tireAt ?? 0.22);
|
|
17692
17858
|
g.add(t);
|
|
17693
17859
|
});
|
|
17694
17860
|
const hb = new THREE.Mesh(new THREE.CylinderGeometry(rad * 0.32, rad * 0.32, w * 0.86, 10), MT.steel);
|
|
@@ -17705,21 +17871,21 @@ var GameUrban = (() => {
|
|
|
17705
17871
|
for (let k = 0; k < 6; k++) {
|
|
17706
17872
|
const b = new THREE.Mesh(G.roundedBox(rad * 1.5, 0.05, 0.04, 0.01), wm);
|
|
17707
17873
|
b.rotation.z = k / 6 * PI;
|
|
17708
|
-
b.position.z = (z > 0 ? 1 : -1) * w * 0.42;
|
|
17874
|
+
b.position.z = (z > 0 ? 1 : -1) * (w * 0.42 + k * 3e-3);
|
|
17709
17875
|
g.add(b);
|
|
17710
17876
|
}
|
|
17711
17877
|
c.spin.push({ o: g, axis: "z", v: 0, track: true });
|
|
17712
17878
|
return g;
|
|
17713
17879
|
}
|
|
17714
17880
|
for (let i = 0; i < n; i++) wheel(xs + i * sp, r + th, r, { tires: true });
|
|
17715
|
-
wheel(x0, yS, rS, { teeth: true });
|
|
17716
|
-
wheel(x1, yI, rI, { spokes: true, tires: true });
|
|
17881
|
+
wheel(x0, yS, rS, { teeth: true, width: 0.76 });
|
|
17882
|
+
wheel(x1, yI, rI, { spokes: true, tires: true, width: 0.76, tireAt: 0.2 });
|
|
17717
17883
|
const topY = function(x) {
|
|
17718
17884
|
return yS + rS + th / 2 + (yI + rI - yS - rS) * (x - x0) / (x1 - x0);
|
|
17719
17885
|
};
|
|
17720
17886
|
for (let q = 0; q < 4; q++) {
|
|
17721
17887
|
const xr = x0 + (x1 - x0) * (0.2 + q * 0.2);
|
|
17722
|
-
wheel(xr, topY(xr) - rr - th / 2 - 0.01, rr, {});
|
|
17888
|
+
wheel(xr, topY(xr) - rr - th / 2 - 0.01, rr, { width: 0.7 });
|
|
17723
17889
|
}
|
|
17724
17890
|
const path = [], segs = 12;
|
|
17725
17891
|
function arc(cx, cy, rad, a0, a1) {
|
|
@@ -17743,7 +17909,7 @@ var GameUrban = (() => {
|
|
|
17743
17909
|
const curve = new THREE.SplineCurve(pts.concat([pts[0]])), lenT = curve.getLength(), nl = Math.round(lenT / 0.15), links = [];
|
|
17744
17910
|
for (let l = 0; l < nl; l++) {
|
|
17745
17911
|
const t = l / nl, p = curve.getPointAt(t), tg = curve.getTangentAt(t), ang = Math.atan2(tg.y, tg.x);
|
|
17746
|
-
const lg = G.roundedBox(0.13, th, w, 0.015);
|
|
17912
|
+
const lg = G.roundedBox(0.13, th, w - l % 2 * 4e-3, 0.015);
|
|
17747
17913
|
lg.applyMatrix4(new THREE.Matrix4().makeRotationZ(ang).setPosition(p.x, p.y, 0));
|
|
17748
17914
|
links.push(lg);
|
|
17749
17915
|
const gh2 = G.roundedBox(0.05, 0.05, 0.05, 0.01);
|
|
@@ -18763,7 +18929,7 @@ var GameUrban = (() => {
|
|
|
18763
18929
|
off: 3e-3,
|
|
18764
18930
|
nv: 4
|
|
18765
18931
|
});
|
|
18766
|
-
skin(c, Gd, o.refl || REFL, { u0: pu, u1: 1 - pu, yb, yt, off: 6e-3, nv: 4 });
|
|
18932
|
+
const reflector = skin(c, Gd, o.refl || REFL, { u0: pu, u1: 1 - pu, yb, yt, off: 6e-3, nv: 4 });
|
|
18767
18933
|
(o.proj || []).forEach(function(q) {
|
|
18768
18934
|
const r = sh(q[0]), y = (r[0] + r[1]) / 2 + (q[1] || 0), s = Gd.at(q[0], y), rad = q[2] || Math.min(0.034, (r[1] - r[0]) * 0.4);
|
|
18769
18935
|
const cup = onSurf(c.cylinder(rad * 1.35, rad * 1.2, 0.012, LH, 0, 0, 0), s, 8e-3);
|
|
@@ -18794,7 +18960,7 @@ var GameUrban = (() => {
|
|
|
18794
18960
|
lens.push(ln);
|
|
18795
18961
|
if (!inner2.length) inner2.push(ln);
|
|
18796
18962
|
const cs = Gd.at(0.5, (rg[0] + rg[1]) / 2).p;
|
|
18797
|
-
regLight(c, "headlight", o.label || (sd > 0 ? trl("labels.right_headlight") : trl("labels.left_headlight")), inner2, lens, cs);
|
|
18963
|
+
Object.assign(regLight(c, "headlight", o.label || (sd > 0 ? trl("labels.right_headlight") : trl("labels.left_headlight")), inner2, lens, cs), { reflector: [reflector] });
|
|
18798
18964
|
return Gd;
|
|
18799
18965
|
};
|
|
18800
18966
|
K.tail = function(sd, o) {
|
|
@@ -19157,8 +19323,8 @@ var GameUrban = (() => {
|
|
|
19157
19323
|
[-0.3, 0.2].forEach(function(z, index) {
|
|
19158
19324
|
const spindle = new V3(wx + 0.02, wy, z + 0.02);
|
|
19159
19325
|
const blade = c.rod(spindle, new V3(wx - 0.13, wy + 0.13, z - 0.36), 9e-3, MT.trim);
|
|
19160
|
-
const
|
|
19161
|
-
tagWiper({ context: c, parts: [blade], spindle, normal: new V3(
|
|
19326
|
+
const along2 = new V3(gh.ft - gh.fb, gh.roof - gh.belt, 0).normalize();
|
|
19327
|
+
tagWiper({ context: c, parts: [blade], spindle, normal: new V3(along2.y, -along2.x, 0), index });
|
|
19162
19328
|
});
|
|
19163
19329
|
if (s.fin !== false)
|
|
19164
19330
|
c.sphere(0.1, s.roofCol ? c.paint(s.roofCol) : GLOSS, gh.rt + 0.2, roofAt(gh, gh.rt + 0.2) + 0.045, 0, 1, 0.45, 0.28, {
|
|
@@ -21447,9 +21613,9 @@ var GameUrban = (() => {
|
|
|
21447
21613
|
],
|
|
21448
21614
|
col
|
|
21449
21615
|
);
|
|
21450
|
-
lamp(c, { style: "rect", x: 0.
|
|
21616
|
+
lamp(c, { style: "rect", x: 0.575, y: 0.91, z: 0, w: 0.2, h: 0.11, d: 0.08, side: 1, label: trl("labels.headlight") });
|
|
21451
21617
|
c.roundBox(0.1, 0.07, 0.18, 0.02, blk, 0.36, 1.04, 0, { rot: [0, 0, 0.4] });
|
|
21452
|
-
c.roundBox(0.02, 0.05, 0.15, 0.01, MT.gauge, 0.39, 1.
|
|
21618
|
+
c.roundBox(0.02, 0.05, 0.15, 0.01, MT.gauge, 0.39, 1.064, 0, { rot: [0, 0, 0.4] });
|
|
21453
21619
|
handlebar(c, 0.36, 1.03, 0.37, { rise: 0.04, back: 0.06, mat: MT.chrome, stalk: 0.19 });
|
|
21454
21620
|
[1, -1].forEach(function(s) {
|
|
21455
21621
|
blinker(c, 0.48, 0.9, s * 0.17, true);
|
|
@@ -21651,7 +21817,7 @@ var GameUrban = (() => {
|
|
|
21651
21817
|
body(
|
|
21652
21818
|
c,
|
|
21653
21819
|
[
|
|
21654
|
-
[0.
|
|
21820
|
+
[0.435, 1.13, 0.85, 0.24, 2.6],
|
|
21655
21821
|
[0.55, 1.11, 0.87, 0.24, 2.6],
|
|
21656
21822
|
[0.6, 1.05, 0.91, 0.16, 2.4]
|
|
21657
21823
|
],
|
|
@@ -21818,7 +21984,7 @@ var GameUrban = (() => {
|
|
|
21818
21984
|
body(
|
|
21819
21985
|
c,
|
|
21820
21986
|
[
|
|
21821
|
-
[0.
|
|
21987
|
+
[0.615, 1.32, 0.98, 0.3, 2.6],
|
|
21822
21988
|
[0.72, 1.28, 1, 0.3, 2.6],
|
|
21823
21989
|
[0.78, 1.2, 1.02, 0.22, 2.4]
|
|
21824
21990
|
],
|
|
@@ -22749,8 +22915,8 @@ var GameUrban = (() => {
|
|
|
22749
22915
|
return b;
|
|
22750
22916
|
}
|
|
22751
22917
|
function plateMoto(c, x, y, txt) {
|
|
22752
|
-
c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x +
|
|
22753
|
-
c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x, y, 0, "-x", {
|
|
22918
|
+
c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x + 9e-3, y, 0);
|
|
22919
|
+
c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x - 3e-3, y, 0, "-x", {
|
|
22754
22920
|
w: 300,
|
|
22755
22921
|
h: 220,
|
|
22756
22922
|
bg: "#f2f2ee",
|
|
@@ -22865,7 +23031,7 @@ var GameUrban = (() => {
|
|
|
22865
23031
|
g.add(d);
|
|
22866
23032
|
for (let q = 0; q < 12; q++) {
|
|
22867
23033
|
const a2 = q / 12 * PI * 2, sl = new THREE.Mesh(G.roundedBox(rimR * 0.42, 0.016, 6e-3, 5e-3), o.slot || CM("#1c1e21", { metalness: 0.5, roughness: 0.4 }));
|
|
22868
|
-
sl.position.set(Math.cos(a2) * rimR * 0.62, Math.sin(a2) * rimR * 0.62, s * (hw * 0.72 +
|
|
23034
|
+
sl.position.set(Math.cos(a2) * rimR * 0.62, Math.sin(a2) * rimR * 0.62, s * (hw * 0.72 + 0.0105));
|
|
22869
23035
|
sl.rotation.z = a2;
|
|
22870
23036
|
g.add(sl);
|
|
22871
23037
|
}
|
|
@@ -22963,7 +23129,7 @@ var GameUrban = (() => {
|
|
|
22963
23129
|
body(
|
|
22964
23130
|
c,
|
|
22965
23131
|
[
|
|
22966
|
-
[0.
|
|
23132
|
+
[0.335, 0.36, 0.29, 0.28, 2.6],
|
|
22967
23133
|
[0.46, 0.38, 0.31, 0.46, 3],
|
|
22968
23134
|
[0.6, 0.41, 0.34, 0.5, 3],
|
|
22969
23135
|
[0.74, 0.43, 0.37, 0.46, 2.8],
|
|
@@ -23371,7 +23537,7 @@ var GameUrban = (() => {
|
|
|
23371
23537
|
body(
|
|
23372
23538
|
c,
|
|
23373
23539
|
[
|
|
23374
|
-
[0.
|
|
23540
|
+
[0.415, 1.05, 0.82, 0.26, 2.6],
|
|
23375
23541
|
[0.52, 1.03, 0.83, 0.28, 2.6],
|
|
23376
23542
|
[0.59, 0.99, 0.85, 0.22, 2.4],
|
|
23377
23543
|
[0.62, 0.95, 0.87, 0.1, 2.2]
|
|
@@ -23392,7 +23558,7 @@ var GameUrban = (() => {
|
|
|
23392
23558
|
});
|
|
23393
23559
|
c.roundBox(0.015, 0.1, 0.2, 0.02, SMOKEG, 0.55, 1.035, 0, { rot: [0, 0, 0.55] });
|
|
23394
23560
|
c.roundBox(0.07, 0.03, 0.16, 0.01, CM("#121518", { roughness: 0.25, metalness: 0.3 }), 0.44, 1.07, 0, { rot: [0, 0, 0.5] });
|
|
23395
|
-
c.roundBox(0.04, 0.032, 0.1, 6e-3, MT.gauge, 0.45, 1.
|
|
23561
|
+
c.roundBox(0.04, 0.032, 0.1, 6e-3, MT.gauge, 0.45, 1.078, 0, { rot: [0, 0, 0.5] });
|
|
23396
23562
|
[1, -1].forEach(function(s) {
|
|
23397
23563
|
blinker(c, 0.5, 0.92, s * 0.16, true);
|
|
23398
23564
|
});
|
|
@@ -23809,7 +23975,7 @@ var GameUrban = (() => {
|
|
|
23809
23975
|
});
|
|
23810
23976
|
c.cylinder(0.12, 0.12, 0.07, CH, 0.2, 0.56, 0.17, "z");
|
|
23811
23977
|
c.cylinder(0.1, 0.1, 0.012, CM("#9ea3a7", { metalness: 0.55, roughness: 0.35 }), 0.2, 0.56, 0.21, "z");
|
|
23812
|
-
c.text("114", 0.1, 0.04, 0.2, 0.56, 0.
|
|
23978
|
+
c.text("114", 0.1, 0.04, 0.2, 0.56, 0.219, "+z", { fg: "#1b1c1f", size: 0.85 });
|
|
23813
23979
|
c.sphere(0.17, CH, -0.06, 0.32, -0.17, 1.35, 0.85, 0.28);
|
|
23814
23980
|
c.cylinder(0.07, 0.07, 0.02, CH, -0.02, 0.3, -0.215, "z");
|
|
23815
23981
|
c.roundBox(0.86, 0.035, 0.02, 0.015, CM("#1a1a1a", { roughness: 0.8 }), -0.43, 0.32, 0.15, { rot: [0, 0, 0] });
|
|
@@ -24204,12 +24370,12 @@ var GameUrban = (() => {
|
|
|
24204
24370
|
col
|
|
24205
24371
|
);
|
|
24206
24372
|
c.roundBox(0.1, 0.07, 0.18, 0.02, blk, 0.36, 1.04, 0, { rot: [0, 0, 0.4] });
|
|
24207
|
-
c.roundBox(0.02, 0.05, 0.15, 0.01, MT.gauge, 0.39, 1.
|
|
24373
|
+
c.roundBox(0.02, 0.05, 0.15, 0.01, MT.gauge, 0.39, 1.064, 0, { rot: [0, 0, 0.4] });
|
|
24208
24374
|
[1, -1].forEach(function(s) {
|
|
24209
24375
|
blinker(c, 0.48, 0.9, s * 0.17, true);
|
|
24210
24376
|
});
|
|
24211
24377
|
Z.fairing = grab(c, n0);
|
|
24212
|
-
lamp(c, { style: "rect", x: 0.
|
|
24378
|
+
lamp(c, { style: "rect", x: 0.575, y: 0.91, z: 0, w: 0.2, h: 0.11, d: 0.08, side: 1, label: trl("labels.headlight") });
|
|
24213
24379
|
n0 = c.vehicle.children.length;
|
|
24214
24380
|
handlebar(c, 0.36, 1.02, 0.36, { rise: 0.03, back: 0.06, mat: MT.chrome, stalk: 0.19 });
|
|
24215
24381
|
Z.handlebar = grab(c, n0);
|
|
@@ -24333,9 +24499,19 @@ var GameUrban = (() => {
|
|
|
24333
24499
|
return [s[0], cy - hh, cy + hh, s[3] * k, s[4], s[5]];
|
|
24334
24500
|
});
|
|
24335
24501
|
}
|
|
24502
|
+
function stretchSt(st) {
|
|
24503
|
+
const out = st.map(function(q) {
|
|
24504
|
+
return q.slice();
|
|
24505
|
+
});
|
|
24506
|
+
const last = out.length - 1;
|
|
24507
|
+
const dir = out[last][0] >= out[0][0] ? 1 : -1;
|
|
24508
|
+
out[0][0] = out[0][0] + dir * 3e-3;
|
|
24509
|
+
out[last][0] = out[last][0] - dir * 3e-3;
|
|
24510
|
+
return out;
|
|
24511
|
+
}
|
|
24336
24512
|
function fSkin(c, EA, st, keep, mat, o) {
|
|
24337
24513
|
o = o || {};
|
|
24338
|
-
const m = c.add(EA.fuseGeo(scaleSt(st, o.k ||
|
|
24514
|
+
const m = c.add(EA.fuseGeo(stretchSt(scaleSt(st, o.k || EA.nextSkinScale(c))), { smooth: o.smooth || 48, seg: o.seg || 30 }), mat, 0, 0, 0, o.parent);
|
|
24339
24515
|
m.castShadow = false;
|
|
24340
24516
|
cutSub(m, [keep], o.sub || 0.06, o.pre);
|
|
24341
24517
|
c.deform.push(m);
|
|
@@ -24343,7 +24519,7 @@ var GameUrban = (() => {
|
|
|
24343
24519
|
}
|
|
24344
24520
|
function fGlass(c, EA, st, keep, label, type, o) {
|
|
24345
24521
|
o = o || {};
|
|
24346
|
-
const m = new THREE.Mesh(EA.fuseGeo(scaleSt(st, o.k ||
|
|
24522
|
+
const m = new THREE.Mesh(EA.fuseGeo(scaleSt(st, o.k || EA.nextPaneScale(c)), { smooth: o.smooth || 48, seg: o.seg || 30 }), o.mat || MT.glass);
|
|
24347
24523
|
(o.parent || c.vehicle).add(m);
|
|
24348
24524
|
cutSub(m, [keep], o.sub || 0.07, o.pre);
|
|
24349
24525
|
return kit.asGlass(c, m, label, type || "tempered", o.pos ? { pos: o.pos } : {});
|
|
@@ -24505,7 +24681,7 @@ var GameUrban = (() => {
|
|
|
24505
24681
|
return Math.min(boltW(x) - Math.abs(y - bolt(x)), x + 3.2, 2.93 - x, Math.abs(z) - 0.12);
|
|
24506
24682
|
}),
|
|
24507
24683
|
black,
|
|
24508
|
-
{ parent: grp, sub: 0.05, pre: EA.keepT([-3.3, 3, -0.35, 0.2, 0.1]) }
|
|
24684
|
+
{ parent: grp, sub: 0.05, k: 1.013, pre: EA.keepT([-3.3, 3, -0.35, 0.2, 0.1]) }
|
|
24509
24685
|
);
|
|
24510
24686
|
const doorR = EA.polySdf([
|
|
24511
24687
|
[1.38, -0.4],
|
|
@@ -24570,7 +24746,7 @@ var GameUrban = (() => {
|
|
|
24570
24746
|
};
|
|
24571
24747
|
const g = EA.foilGeo(
|
|
24572
24748
|
[
|
|
24573
|
-
{ p: [1.46, dh(0),
|
|
24749
|
+
{ p: [1.46, dh(0), s * 2e-3], c: 1.6, t: 0.12, cam: 0.025, noCap: true },
|
|
24574
24750
|
{ p: [1.46, dh(2.6), s * 2.6], c: 1.6, t: 0.12, cam: 0.025 },
|
|
24575
24751
|
{ p: [1.46, dh(4.9), s * 4.9], c: 1.6, t: 0.12, cam: 0.025 },
|
|
24576
24752
|
{ p: [1.43, dh(5.18), s * 5.18], c: 1.5, t: 0.11, cam: 0.02 },
|
|
@@ -24627,7 +24803,7 @@ var GameUrban = (() => {
|
|
|
24627
24803
|
const hs = c.add(
|
|
24628
24804
|
EA.foilGeo(
|
|
24629
24805
|
[
|
|
24630
|
-
{ p: [-2.78, 0.1,
|
|
24806
|
+
{ p: [-2.78, 0.1, s * 2e-3], c: 0.78, t: 0.07 },
|
|
24631
24807
|
{ p: [-2.85, 0.1, s * 1.1], c: 0.74, t: 0.07 },
|
|
24632
24808
|
{ p: [-2.95, 0.1, s * 1.36], c: 0.6, t: 0.06 },
|
|
24633
24809
|
{ p: [-3.1, 0.1, s * 1.46], c: 0.32, t: 0.05 }
|
|
@@ -24878,7 +25054,7 @@ var GameUrban = (() => {
|
|
|
24878
25054
|
EA.sideKeepP(ckP, 0.5, s),
|
|
24879
25055
|
s > 0 ? lbl("right_flight_deck_window") : lbl("left_flight_deck_window"),
|
|
24880
25056
|
"tempered",
|
|
24881
|
-
{ pos: new V3(5.4, 2.25, s * 0.8) }
|
|
25057
|
+
{ pos: new V3(5.4, 2.25, s * 0.8), k: 1.0085 }
|
|
24882
25058
|
);
|
|
24883
25059
|
fGlass(
|
|
24884
25060
|
c,
|
|
@@ -24932,7 +25108,7 @@ var GameUrban = (() => {
|
|
|
24932
25108
|
const w = c.add(
|
|
24933
25109
|
EA.foilGeo(
|
|
24934
25110
|
[
|
|
24935
|
-
{ p: [1.52, dh(0),
|
|
25111
|
+
{ p: [1.52, dh(0), s * 2e-3], c: 2.38, t: 0.15, cam: 0.02 },
|
|
24936
25112
|
{ p: [1.52, dh(0.86), s * 0.86], c: 2.38, t: 0.15, cam: 0.02 },
|
|
24937
25113
|
{ p: [1.42, dh(2.47), s * 2.47], c: 2.25, t: 0.145, cam: 0.02 },
|
|
24938
25114
|
{ p: [0.98, dh(7.42), s * 7.42], c: 1.4, t: 0.12, cam: 0.02 },
|
|
@@ -25067,7 +25243,7 @@ var GameUrban = (() => {
|
|
|
25067
25243
|
const hs = c.add(
|
|
25068
25244
|
EA.foilGeo(
|
|
25069
25245
|
[
|
|
25070
|
-
{ p: [-5.95, 2.3,
|
|
25246
|
+
{ p: [-5.95, 2.3, s * 2e-3], c: 1.55, t: 0.1 },
|
|
25071
25247
|
{ p: [-6.62, 2.3 + 3.2 * 0.176, s * 3.2], c: 0.86, t: 0.09 }
|
|
25072
25248
|
],
|
|
25073
25249
|
{ up: "y", n: 10 }
|
|
@@ -25330,7 +25506,7 @@ var GameUrban = (() => {
|
|
|
25330
25506
|
const w = c.add(
|
|
25331
25507
|
EA.foilGeo(
|
|
25332
25508
|
[
|
|
25333
|
-
{ p: [1.56, dh(0),
|
|
25509
|
+
{ p: [1.56, dh(0), s * 2e-3], c: 1.98, t: 0.15, cam: 0.025, noCap: true },
|
|
25334
25510
|
{ p: [1.56, dh(3.6), s * 3.6], c: 1.98, t: 0.15, cam: 0.025 },
|
|
25335
25511
|
{ p: [1.38, dh(7.7), s * 7.7], c: 1.3, t: 0.12, cam: 0.02 },
|
|
25336
25512
|
{ p: [1.32, dh(7.94), s * 7.94], c: 1.1, t: 0.06, cam: 0.01 }
|
|
@@ -25472,7 +25648,7 @@ var GameUrban = (() => {
|
|
|
25472
25648
|
const hs = c.add(
|
|
25473
25649
|
EA.foilGeo(
|
|
25474
25650
|
[
|
|
25475
|
-
{ p: [-4.8, 3.08,
|
|
25651
|
+
{ p: [-4.8, 3.08, s * 2e-3], c: 1.55, t: 0.1 },
|
|
25476
25652
|
{ p: [-5.15, 3.08, s * 3.1], c: 1, t: 0.09 }
|
|
25477
25653
|
],
|
|
25478
25654
|
{ up: "y", n: 10 }
|
|
@@ -25675,7 +25851,7 @@ var GameUrban = (() => {
|
|
|
25675
25851
|
EA.sideKeepP(ckP, 0.5, s),
|
|
25676
25852
|
s > 0 ? lbl("right_flight_deck_side_window") : lbl("left_flight_deck_side_window"),
|
|
25677
25853
|
"tempered",
|
|
25678
|
-
{ pos: new V3(3.6, 2, s * 0.78) }
|
|
25854
|
+
{ pos: new V3(3.6, 2, s * 0.78), k: 1.0085 }
|
|
25679
25855
|
);
|
|
25680
25856
|
fGlass(
|
|
25681
25857
|
c,
|
|
@@ -25703,7 +25879,7 @@ var GameUrban = (() => {
|
|
|
25703
25879
|
return Math.min(8e-3 - Math.abs(EA.polySdf(rrect(2.62, 3.25, 0.72, 2.22, 0.12))(x, y)), -z - 0.5);
|
|
25704
25880
|
}),
|
|
25705
25881
|
MT.dark,
|
|
25706
|
-
{ k: 1.
|
|
25882
|
+
{ k: 1.0065 }
|
|
25707
25883
|
);
|
|
25708
25884
|
void dF;
|
|
25709
25885
|
EA.fuseSkin(
|
|
@@ -25713,7 +25889,7 @@ var GameUrban = (() => {
|
|
|
25713
25889
|
return Math.min(0.035 - Math.abs(x - 3.88 - (y - 1.75) * 0.5), y - 1.7, 2.42 - y);
|
|
25714
25890
|
}),
|
|
25715
25891
|
blk,
|
|
25716
|
-
{ k: 1.
|
|
25892
|
+
{ k: 1.0065 }
|
|
25717
25893
|
);
|
|
25718
25894
|
c.rod(new V3(5, 1.74, 0), new V3(4.05, 2.4, 0), 0.02, blk);
|
|
25719
25895
|
const fl = 0.8, fab = CM("#c9bda6", { roughness: 0.75 });
|
|
@@ -25752,7 +25928,7 @@ var GameUrban = (() => {
|
|
|
25752
25928
|
const w = c.add(
|
|
25753
25929
|
EA.foilGeo(
|
|
25754
25930
|
[
|
|
25755
|
-
{ p: [1, dh(0),
|
|
25931
|
+
{ p: [1, dh(0), s * 2e-3], c: 2.45, t: 0.14, cam: 0.02 },
|
|
25756
25932
|
{ p: [0.95, dh(0.85), s * 0.85], c: 2.42, t: 0.14, cam: 0.02 },
|
|
25757
25933
|
{ p: [0.55, dh(2.4), s * 2.4], c: 1.9, t: 0.13, cam: 0.02 },
|
|
25758
25934
|
{ p: [-0.32, dh(5.75), s * 5.75], c: 1.08, t: 0.11, cam: 0.02 },
|
|
@@ -25834,7 +26010,7 @@ var GameUrban = (() => {
|
|
|
25834
26010
|
const finB = c.add(
|
|
25835
26011
|
EA.foilGeo(
|
|
25836
26012
|
[
|
|
25837
|
-
{ p: [-3.89, 2.
|
|
26013
|
+
{ p: [-3.89, 2.253, 0], c: 2.22, t: 0.115 },
|
|
25838
26014
|
{ p: [-5.34, 4.185, 0], c: 1.17, t: 0.105 }
|
|
25839
26015
|
],
|
|
25840
26016
|
{ up: "z", n: 10 }
|
|
@@ -25857,7 +26033,7 @@ var GameUrban = (() => {
|
|
|
25857
26033
|
const hs = c.add(
|
|
25858
26034
|
EA.foilGeo(
|
|
25859
26035
|
[
|
|
25860
|
-
{ p: [-5.3, 4.2,
|
|
26036
|
+
{ p: [-5.3, 4.2, s * 2e-3], c: 1.18, t: 0.1 },
|
|
25861
26037
|
{ p: [-5.9, 4.24, s * 2.55], c: 0.62, t: 0.09 }
|
|
25862
26038
|
],
|
|
25863
26039
|
{ up: "y", n: 10 }
|
|
@@ -26119,7 +26295,7 @@ var GameUrban = (() => {
|
|
|
26119
26295
|
[1, -1].forEach(function(s) {
|
|
26120
26296
|
const g = EA.foilGeo(
|
|
26121
26297
|
[
|
|
26122
|
-
{ p: [1.52, dh(0),
|
|
26298
|
+
{ p: [1.52, dh(0), s * 2e-3], c: 2.35, t: 0.15, cam: 0.02 },
|
|
26123
26299
|
{ p: [1.5, dh(0.48), s * 0.48], c: 2.32, t: 0.15, cam: 0.02 },
|
|
26124
26300
|
{ p: [0.78, dh(5.4), s * 5.4], c: 1.2, t: 0.12, cam: 0.02 },
|
|
26125
26301
|
{ p: [0.74, dh(5.57), s * 5.57], c: 1.1, t: 0.07, cam: 0.01 }
|
|
@@ -26224,7 +26400,7 @@ var GameUrban = (() => {
|
|
|
26224
26400
|
[1, -1].forEach(function(s) {
|
|
26225
26401
|
const g = EA.foilGeo(
|
|
26226
26402
|
[
|
|
26227
|
-
{ p: [-4.3, 1.72,
|
|
26403
|
+
{ p: [-4.3, 1.72, s * 2e-3], c: 1.3, t: 0.1 },
|
|
26228
26404
|
{ p: [-4.72, 1.76, s * 2.2], c: 0.75, t: 0.09 }
|
|
26229
26405
|
],
|
|
26230
26406
|
{ up: "y", n: 10 }
|
|
@@ -26485,7 +26661,7 @@ var GameUrban = (() => {
|
|
|
26485
26661
|
const fl = c.roundBox(L, 0.035, 2 * hw, 0.01, LINER, cx, o.floor, 0);
|
|
26486
26662
|
for (let k = 0; k < 7; k++) c.roundBox(L - 0.04, 0.018, 0.04, 8e-3, LINER, cx, o.floor + 0.025, -hw * 0.8 + k * hw * 1.6 / 6);
|
|
26487
26663
|
[1, -1].forEach(function(s) {
|
|
26488
|
-
c.roundBox(L, h, 0.025, 0.01, LINER, cx, o.floor + h / 2, s * (hw + 0.012));
|
|
26664
|
+
c.roundBox(L - 8e-3, h, 0.025, 0.01, LINER, cx, o.floor + h / 2, s * (hw + 0.012));
|
|
26489
26665
|
});
|
|
26490
26666
|
c.roundBox(0.025, h, 2 * hw, 0.01, LINER, o.x0 + 0.012, o.floor + h / 2, 0);
|
|
26491
26667
|
c.roundBox(0.03, h + 0.05, 2 * hw + 0.02, 0.01, c.paint(c.meta.color), o.x1 - 0.015, o.floor + (h + 0.05) / 2, 0);
|
|
@@ -27381,10 +27557,10 @@ var GameUrban = (() => {
|
|
|
27381
27557
|
pre: function(c2, _m) {
|
|
27382
27558
|
const gx = fX(s, 0.82) - 0.012, gy = 0.82, gh = 0.46, gw = 1.08, tz = 0.8;
|
|
27383
27559
|
c2.roundBox(0.05, gh, gw, 0.04, MT.chrome, gx, gy, 0, { taper: { sz: tz } });
|
|
27384
|
-
c2.roundBox(0.
|
|
27560
|
+
c2.roundBox(0.058, gh - 0.1, gw - 0.16, 0.02, GLOSS, gx + 2e-3, gy, 0, { taper: { sz: tz - 0.02 } });
|
|
27385
27561
|
[0.13, 0.045, -0.04, -0.125].forEach(function(dy) {
|
|
27386
27562
|
const k = (dy + gh / 2 - 0.05) / (gh - 0.1);
|
|
27387
|
-
c2.roundBox(0.
|
|
27563
|
+
c2.roundBox(0.066, 0.022, (gw - 0.2) * (1 + (tz - 1) * k), 8e-3, MT.chrome, gx + 4e-3, gy + dy, 0);
|
|
27388
27564
|
});
|
|
27389
27565
|
c2.roundBox(0.04, 0.04, 1.32, 0.015, MT.chrome, fX(s, 1.04) - 0.03, 1.04, 0);
|
|
27390
27566
|
kit.emblem(c2, fX(s, 0.9) + 0.03, 0.9, 0, 0.06);
|
|
@@ -27720,9 +27896,9 @@ var GameUrban = (() => {
|
|
|
27720
27896
|
pre: function(c2, _m) {
|
|
27721
27897
|
const gx = fX(s, 0.8) - 0.012, gy = 0.8, gw = 1.14, gh = 0.52;
|
|
27722
27898
|
c2.roundBox(0.05, gh, gw, 0.04, MT.chrome, gx, gy, 0, { taper: { sz: 0.84 } });
|
|
27723
|
-
c2.roundBox(0.
|
|
27899
|
+
c2.roundBox(0.058, gh - 0.12, gw - 0.16, 0.02, GLOSS, gx + 2e-3, gy - 0.01, 0, { taper: { sz: 0.82 } });
|
|
27724
27900
|
[0.12, -0.02, -0.14].forEach(function(dy) {
|
|
27725
|
-
c2.roundBox(0.
|
|
27901
|
+
c2.roundBox(0.066, 0.03, (gw - 0.22) * (1 - (dy + 0.2) * 0.4), 0.01, MT.housing, gx + 4e-3, gy + dy, 0);
|
|
27726
27902
|
});
|
|
27727
27903
|
c2.roundBox(0.04, 0.05, 1.3, 0.02, MT.chrome, fX(s, 1.04) - 0.03, 1.04, 0);
|
|
27728
27904
|
kit.emblem(c2, gx + 0.035, gy + 0.06, 0, 0.06);
|
|
@@ -27888,7 +28064,7 @@ var GameUrban = (() => {
|
|
|
27888
28064
|
wg.add(bolt);
|
|
27889
28065
|
}
|
|
27890
28066
|
for (let sk = 0; sk < 6; sk++) {
|
|
27891
|
-
const sa = sk / 6 * PI * 2, hole = new THREE.Mesh(new THREE.CylinderGeometry(rr * 0.13, rr * 0.13, 0.
|
|
28067
|
+
const sa = sk / 6 * PI * 2, hole = new THREE.Mesh(new THREE.CylinderGeometry(rr * 0.13, rr * 0.13, 0.03, 14), MT.hole);
|
|
27892
28068
|
hole.rotation.x = PI / 2;
|
|
27893
28069
|
hole.position.set(Math.cos(sa) * rr * 0.58, Math.sin(sa) * rr * 0.58, fz + zs * 2e-3);
|
|
27894
28070
|
wg.add(hole);
|
|
@@ -27917,7 +28093,7 @@ var GameUrban = (() => {
|
|
|
27917
28093
|
c.rod(new V3(0.6, 2.8, sd * 0.78), new V3(-0.25, 2.8, sd * 0.78), 0.035, red);
|
|
27918
28094
|
});
|
|
27919
28095
|
c.rod(new V3(0.6, 2.8, -0.78), new V3(0.6, 2.8, 0.78), 0.035, red);
|
|
27920
|
-
c.rod(new V3(-0.25, 2.8, -0.78), new V3(-0.25, 2.8, 0.78), 0.
|
|
28096
|
+
c.rod(new V3(-0.25, 2.8, -0.78), new V3(-0.25, 2.8, 0.78), 0.032, red);
|
|
27921
28097
|
c.rod(new V3(-0.25, 2.3, -0.8), new V3(-0.25, 2.8, 0.78), 0.03, red);
|
|
27922
28098
|
const roofItems = [c.roundBox(0.16, 0.05, 1.3, 0.02, MT.trim, 0.42, m.top + 0.08, 0)];
|
|
27923
28099
|
[-0.48, -0.16, 0.16, 0.48].forEach(function(z) {
|
|
@@ -28498,8 +28674,8 @@ var GameUrban = (() => {
|
|
|
28498
28674
|
);
|
|
28499
28675
|
const zz = sd * (kit.halfAt(W, m.tumble, 1.75) + 0.012), zt = sd * (kit.halfAt(W, m.tumble, 2.22) + 0.012);
|
|
28500
28676
|
c2.text("RESGATE", 1.2, 0.3, sd > 0 ? -1.5 : -0.85, 2.22, zt, sd > 0 ? "+z" : "-z", { fg: red });
|
|
28501
|
-
[0, PI / 3, -PI / 3].forEach(function(a) {
|
|
28502
|
-
c2.roundBox(0.09, 0.36, 0.01, 0.01, blu, -2.25, 1.75, zz, { rot: [0, 0, a] });
|
|
28677
|
+
[0, PI / 3, -PI / 3].forEach(function(a, i) {
|
|
28678
|
+
c2.roundBox(0.09, 0.36, 0.01, 0.01, blu, -2.25, 1.75, zz + sd * i * 25e-4, { rot: [0, 0, a] });
|
|
28503
28679
|
});
|
|
28504
28680
|
});
|
|
28505
28681
|
if (c2.hood) {
|
|
@@ -28849,9 +29025,31 @@ var GameUrban = (() => {
|
|
|
28849
29025
|
if (o.col) colorize(g, o.col);
|
|
28850
29026
|
return g;
|
|
28851
29027
|
}
|
|
29028
|
+
function stretchEnds(st, by) {
|
|
29029
|
+
const out = st.map(function(q) {
|
|
29030
|
+
return q.slice();
|
|
29031
|
+
});
|
|
29032
|
+
const last = out.length - 1;
|
|
29033
|
+
const dir = out[last][0] >= out[0][0] ? 1 : -1;
|
|
29034
|
+
out[0][0] = out[0][0] - dir * by;
|
|
29035
|
+
out[last][0] = out[last][0] + dir * by;
|
|
29036
|
+
return out;
|
|
29037
|
+
}
|
|
29038
|
+
const paneCount = /* @__PURE__ */ new WeakMap();
|
|
29039
|
+
function nextPaneScale(c) {
|
|
29040
|
+
const n = paneCount.get(c) ?? 0;
|
|
29041
|
+
paneCount.set(c, n + 1);
|
|
29042
|
+
return 0.988 - 35e-4 * (n % 4);
|
|
29043
|
+
}
|
|
29044
|
+
const skinCount = /* @__PURE__ */ new WeakMap();
|
|
29045
|
+
function nextSkinScale(c) {
|
|
29046
|
+
const n = skinCount.get(c) ?? 0;
|
|
29047
|
+
skinCount.set(c, n + 1);
|
|
29048
|
+
return 1.004 + 25e-4 * (n % 3);
|
|
29049
|
+
}
|
|
28852
29050
|
function fuseGlass(c, st, keep, label, type, o) {
|
|
28853
29051
|
o = o || {};
|
|
28854
|
-
const k = o.k ||
|
|
29052
|
+
const k = o.k || nextPaneScale(c);
|
|
28855
29053
|
const st2 = st.map(function(s) {
|
|
28856
29054
|
const cy = (s[1] + s[2]) / 2, hh = (s[2] - s[1]) / 2 * k;
|
|
28857
29055
|
return [s[0], cy - hh, cy + hh, s[3] * k, s[4], s[5]];
|
|
@@ -28864,12 +29062,12 @@ var GameUrban = (() => {
|
|
|
28864
29062
|
}
|
|
28865
29063
|
function fuseSkin(c, st, keep, mat, o) {
|
|
28866
29064
|
o = o || {};
|
|
28867
|
-
const k = o.k ||
|
|
29065
|
+
const k = o.k || nextSkinScale(c);
|
|
28868
29066
|
const st2 = st.map(function(s) {
|
|
28869
29067
|
const cy = (s[1] + s[2]) / 2, hh = (s[2] - s[1]) / 2 * k;
|
|
28870
29068
|
return [s[0], cy - hh, cy + hh, s[3] * k, s[4], s[5]];
|
|
28871
29069
|
});
|
|
28872
|
-
const m = c.add(fuseGeo(st2, { smooth: o.smooth || 48, seg: o.seg || 30 }), mat, 0, 0, 0, o.parent);
|
|
29070
|
+
const m = c.add(fuseGeo(stretchEnds(st2, -3e-3), { smooth: o.smooth || 48, seg: o.seg || 30 }), mat, 0, 0, 0, o.parent);
|
|
28873
29071
|
m.castShadow = false;
|
|
28874
29072
|
kit.cutMesh(m, [keep], 40);
|
|
28875
29073
|
c.deform.push(m);
|
|
@@ -29140,7 +29338,7 @@ var GameUrban = (() => {
|
|
|
29140
29338
|
}
|
|
29141
29339
|
;
|
|
29142
29340
|
(o.screens || []).forEach(function(s) {
|
|
29143
|
-
const sc = c.roundBox(0.012, s[2], s[3], 8e-3, MT.screen, x - 0.
|
|
29341
|
+
const sc = c.roundBox(0.012, s[2], s[3], 8e-3, MT.screen, x - 0.091, y + s[0], s[1]);
|
|
29144
29342
|
sc.castShadow = false;
|
|
29145
29343
|
});
|
|
29146
29344
|
}
|
|
@@ -29180,7 +29378,7 @@ var GameUrban = (() => {
|
|
|
29180
29378
|
);
|
|
29181
29379
|
c.roundBox(0.42 * k, 0.07 * k, 0.33 * k, 0.03 * k, CM(o.band || "#2a2c30", { roughness: 0.5 }), -0.2 * k - 0.05, -0.02 * k, 0, P);
|
|
29182
29380
|
c.roundBox(0.17 * k, shaft, 0.11 * k, 0.04 * k, low, -0.16 * k, -shaft / 2 - 0.02, 0, P);
|
|
29183
|
-
c.roundBox(0.36 * k, 0.018, 0.2 * k, 8e-3, low, -0.17 * k, -shaft -
|
|
29381
|
+
c.roundBox(0.36 * k, 0.018, 0.2 * k, 8e-3, low, -0.17 * k, -shaft - 6e-3, 0, P);
|
|
29184
29382
|
c.cylinder(0.055 * k, 0.05 * k, 0.32 * k, low, -0.2 * k, -shaft - 0.09 * k, 0, "x", P);
|
|
29185
29383
|
c.roundBox(0.16 * k, 0.12 * k, 0.025, 0.01, low, -0.18 * k, -shaft - 0.17 * k, 0, P);
|
|
29186
29384
|
const pr = propeller(c, -0.38 * k, -shaft - 0.09 * k, 0, {
|
|
@@ -29212,7 +29410,11 @@ var GameUrban = (() => {
|
|
|
29212
29410
|
function skinOf(c, mesh, keep, mat, o) {
|
|
29213
29411
|
o = o || {};
|
|
29214
29412
|
const g = mesh.geometry.clone(), p = g.attributes.position, sz = o.sz || 1.006, dy = o.dy || 0;
|
|
29413
|
+
let reach = 0;
|
|
29414
|
+
for (let i = 0; i < p.count; i++) reach = Math.max(reach, Math.abs(p.getX(i)));
|
|
29415
|
+
const sx = o.ends === false ? 1 : 1 - 3e-3 / (reach || 1);
|
|
29215
29416
|
for (let i = 0; i < p.count; i++) {
|
|
29417
|
+
p.setX(i, p.getX(i) * sx);
|
|
29216
29418
|
p.setZ(i, p.getZ(i) * sz);
|
|
29217
29419
|
p.setY(i, p.getY(i) + dy * Math.sign(p.getY(i)));
|
|
29218
29420
|
}
|
|
@@ -29326,6 +29528,8 @@ var GameUrban = (() => {
|
|
|
29326
29528
|
foilGeo,
|
|
29327
29529
|
fuseGeo,
|
|
29328
29530
|
fuseGlass,
|
|
29531
|
+
nextPaneScale,
|
|
29532
|
+
nextSkinScale,
|
|
29329
29533
|
fuseSkin,
|
|
29330
29534
|
bandT,
|
|
29331
29535
|
cutT,
|
|
@@ -29474,7 +29678,7 @@ var GameUrban = (() => {
|
|
|
29474
29678
|
const tank = c.roundBox(0.48, 0.24, 0.3, 0.06, CM("#a3241c", { roughness: 0.5 }), -2.05, 0.06, -0.38);
|
|
29475
29679
|
c.rod(new V3(-2, 0.18, -0.38), new V3(-2.3, 0.4, -0.1), 0.01, CM("#1b1b1b"));
|
|
29476
29680
|
c.roundBox(1.8, 0.03, 0.1, 0.01, MT.wood, -0.6, 0, 0.5, { rot: [0.3, 0, 0] });
|
|
29477
|
-
c.roundBox(0.35, 0.03, 0.14, 0.02, MT.wood, 0.45,
|
|
29681
|
+
c.roundBox(0.35, 0.03, 0.14, 0.02, MT.wood, 0.45, 4e-3, 0.5, { rot: [0.3, 0, 0] });
|
|
29478
29682
|
c.rod(new V3(-2.35, 0.42, 0.6), new V3(-2.35, 1.1, 0.6), 0.012, MT.chrome);
|
|
29479
29683
|
EA.navLight(c, -2.35, 1.13, 0.6, "white", trl("labels.stern_light_mast"), { r: 0.035 });
|
|
29480
29684
|
EA.navLight(c, 2.3, 0.53, 0.06, "green", trl("labels.starboard_bow_light_green"), { r: 0.03 });
|
|
@@ -29651,7 +29855,7 @@ var GameUrban = (() => {
|
|
|
29651
29855
|
c.roundBox(2.3, 0.22, 0.5, 0.07, vinyl, -2.3, 0.45, s * 0.75);
|
|
29652
29856
|
c.roundBox(2.3, 0.4, 0.12, 0.05, vinyl, -2.3, 0.72, s * (H.half(-2.3, 0.7) - 0.08));
|
|
29653
29857
|
});
|
|
29654
|
-
c.roundBox(0.5, 0.22, 1.5, 0.07, vinyl, -3.35, 0.
|
|
29858
|
+
c.roundBox(0.5, 0.22, 1.5, 0.07, vinyl, -3.35, 0.453, 0);
|
|
29655
29859
|
c.roundBox(0.12, 0.42, 2.1, 0.05, vinyl, -3.52, 0.74, 0);
|
|
29656
29860
|
c.seatTops.push(
|
|
29657
29861
|
{ x: -2.3, y: 0.57, z: 0.75, w: 0.5, l: 2.2 },
|
|
@@ -29659,8 +29863,8 @@ var GameUrban = (() => {
|
|
|
29659
29863
|
{ x: 2, y: 0.57, z: 0, w: 1.2, l: 0.9 }
|
|
29660
29864
|
);
|
|
29661
29865
|
const cy = 0.22;
|
|
29662
|
-
c.roundBox(0.85, 0.72, 0.78, 0.12, white, 0.75, cy + 0.
|
|
29663
|
-
c.roundBox(0.85, 0.72, 0.72, 0.12, white, 0.75, cy + 0.
|
|
29866
|
+
c.roundBox(0.85, 0.72, 0.78, 0.12, white, 0.75, cy + 0.362, 0.72);
|
|
29867
|
+
c.roundBox(0.85, 0.72, 0.72, 0.12, white, 0.75, cy + 0.362, -0.74);
|
|
29664
29868
|
c.roundBox(0.42, 0.04, 0.7, 0.015, CM("#18191b", { roughness: 0.7 }), 0.95, cy + 0.74, 0.72, { rot: [0, 0, -0.35] });
|
|
29665
29869
|
[0.55, 0.72, 0.89].forEach(function(z, i) {
|
|
29666
29870
|
c.cylinder(0.045, 0.045, 0.012, MT.gauge, 0.93 + (i === 1 ? 0.05 : 0), cy + 0.79, z, null, { seg: 16 }).rotation.set(0, 0, 1.22);
|
|
@@ -29671,8 +29875,8 @@ var GameUrban = (() => {
|
|
|
29671
29875
|
c.rod(new V3(0.62, cy + 0.72, 0.62), new V3(0.55, cy + 0.82, 0.62), 0.02, MT.chrome);
|
|
29672
29876
|
c.rod(new V3(0.55, cy + 0.7, 0.98), new V3(0.42, cy + 0.88, 1), 0.015, MT.chrome);
|
|
29673
29877
|
c.sphere(0.035, MT.plastic, 0.42, cy + 0.9, 1);
|
|
29674
|
-
kit.seat(c, -0.1, cy, 0.72, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false });
|
|
29675
|
-
kit.seat(c, -0.1, cy, -0.74, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false });
|
|
29878
|
+
kit.seat(c, -0.1, cy + 2e-3, 0.72, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false });
|
|
29879
|
+
kit.seat(c, -0.1, cy + 2e-3, -0.74, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false });
|
|
29676
29880
|
[1, -1].forEach(function(s) {
|
|
29677
29881
|
const pts = [];
|
|
29678
29882
|
for (let i = 0; i <= 8; i++) {
|
|
@@ -29894,7 +30098,7 @@ var GameUrban = (() => {
|
|
|
29894
30098
|
[1.6, -0.55],
|
|
29895
30099
|
[1.95, -1]
|
|
29896
30100
|
].forEach(function(q) {
|
|
29897
|
-
c.roundBox(0.42, 0.24, 0.32, 0.03, CM("#3f6fa0", { roughness: 0.6 }), q[0], dk(q[0]) + 0.
|
|
30101
|
+
c.roundBox(0.42, 0.24, 0.32, 0.03, CM("#3f6fa0", { roughness: 0.6 }), q[0], dk(q[0]) + 0.128 + (q[0] > 1.9 ? 4e-3 : 0), q[1]);
|
|
29898
30102
|
});
|
|
29899
30103
|
const hx = -2.7, hy0 = dk(hx), hh = 1.9, hw2 = 1.1, cas = c.roundBox(2, hh, hw2 * 2, 0.08, wht, hx, hy0 + hh / 2, 0, { def: true });
|
|
29900
30104
|
const cutF = {
|
|
@@ -29983,11 +30187,11 @@ var GameUrban = (() => {
|
|
|
29983
30187
|
c.rod(new V3(0, 0, 0), new V3(0, Math.cos(a8) * 0.36, Math.sin(a8) * 0.36), 0.014, MT.wood, { parent: whl });
|
|
29984
30188
|
}
|
|
29985
30189
|
c.cylinder(0.05, 0.05, 0.14, MT.wood, 0.06, 0, 0, "x", { parent: whl });
|
|
29986
|
-
kit.seat(c, hx - 0.05, hy0, 0, { w: 0.5, h: 0.55, back: 0.45, mat: inner2, headrest: false });
|
|
30190
|
+
kit.seat(c, hx - 0.05, hy0 + 2e-3, 0, { w: 0.5, h: 0.55, back: 0.45, mat: inner2, headrest: false });
|
|
29987
30191
|
c.roundBox(1.8, 0.12, 0.65, 0.04, CM("#7c5a3b"), hx - 0.2, hy0 + 0.5, -0.72);
|
|
29988
30192
|
c.roundBox(1.7, 0.08, 0.55, 0.04, CM("#6b7c8f", { roughness: 1 }), hx - 0.2, hy0 + 0.6, -0.72);
|
|
29989
30193
|
c.roundBox(1.9, 0.02, 2.1, 0.01, inner2, hx, hy0 + hh - 0.06, 0).castShadow = false;
|
|
29990
|
-
c.cylinder(0.1, 0.1, 1.2, MT.trim, hx - 0.75, hy0 + hh + 0.
|
|
30194
|
+
c.cylinder(0.1, 0.1, 1.2, MT.trim, hx - 0.75, hy0 + hh + 0.596, 0.65);
|
|
29991
30195
|
c.cylinder(0.13, 0.1, 0.1, MT.trim, hx - 0.75, hy0 + hh + 1.22, 0.65);
|
|
29992
30196
|
c.rod(new V3(hx + 0.4, hy0 + hh + 0.1, 0), new V3(hx + 0.4, hy0 + hh + 1.6, 0), 0.04, wood);
|
|
29993
30197
|
EA.navLight(c, hx + 0.4, hy0 + hh + 1.65, 0, "white", trl("labels.masthead_light"), { r: 0.05 });
|
|
@@ -30088,7 +30292,7 @@ var GameUrban = (() => {
|
|
|
30088
30292
|
const EA = shared.EA, white = "#ecebe6";
|
|
30089
30293
|
const paintW = c.paint(white);
|
|
30090
30294
|
const ST = [
|
|
30091
|
-
[2.
|
|
30295
|
+
[2.297, 0.98, 1.46, 0.7, 2.4],
|
|
30092
30296
|
[2.15, 0.88, 1.55, 0.92, 2.6],
|
|
30093
30297
|
[1.85, 0.8, 1.61, 1.02, 2.8],
|
|
30094
30298
|
[1.45, 0.72, 1.65, 1.08, 3],
|
|
@@ -30217,7 +30421,7 @@ var GameUrban = (() => {
|
|
|
30217
30421
|
};
|
|
30218
30422
|
const g = EA.foilGeo(
|
|
30219
30423
|
[
|
|
30220
|
-
{ p: [0.66, dh(0),
|
|
30424
|
+
{ p: [0.66, dh(0), s * 2e-3], c: 1.63, t: 0.12, cam: 0.02 },
|
|
30221
30425
|
{ p: [0.66, dh(2.6), s * 2.6], c: 1.63, t: 0.12, cam: 0.02 },
|
|
30222
30426
|
{ p: [0.62, dh(5.2), s * 5.2], c: 1.14, t: 0.11, cam: 0.02 },
|
|
30223
30427
|
{ p: [0.58, dh(5.5) + 0.02, s * 5.5], c: 0.98, t: 0.06, cam: 0.01 }
|
|
@@ -30256,7 +30460,7 @@ var GameUrban = (() => {
|
|
|
30256
30460
|
const hs = c.add(
|
|
30257
30461
|
EA.foilGeo(
|
|
30258
30462
|
[
|
|
30259
|
-
{ p: [-4.6, 1.42,
|
|
30463
|
+
{ p: [-4.6, 1.42, s * 2e-3], c: 1.2, t: 0.09 },
|
|
30260
30464
|
{ p: [-4.95, 1.42, s * 1.72], c: 0.86, t: 0.08 }
|
|
30261
30465
|
],
|
|
30262
30466
|
{ up: "y", n: 10 }
|
|
@@ -30507,7 +30711,7 @@ var GameUrban = (() => {
|
|
|
30507
30711
|
const w = c.add(
|
|
30508
30712
|
EA.foilGeo(
|
|
30509
30713
|
[
|
|
30510
|
-
{ p: [1.18, dh(0),
|
|
30714
|
+
{ p: [1.18, dh(0), s * 2e-3], c: 1.71, t: 0.15, cam: 0.02 },
|
|
30511
30715
|
{ p: [1.18, dh(5.6), s * 5.6], c: 1.71, t: 0.14, cam: 0.02 },
|
|
30512
30716
|
{ p: [1.12, dh(5.84) + 0.02, s * 5.84], c: 1.55, t: 0.07, cam: 0.01 }
|
|
30513
30717
|
],
|
|
@@ -30541,7 +30745,7 @@ var GameUrban = (() => {
|
|
|
30541
30745
|
const hs = c.add(
|
|
30542
30746
|
EA.foilGeo(
|
|
30543
30747
|
[
|
|
30544
|
-
{ p: [-2.95, 0.36,
|
|
30748
|
+
{ p: [-2.95, 0.36, s * 2e-3], c: 0.95, t: 0.09 },
|
|
30545
30749
|
{ p: [-3.05, 0.36, s * 1.8], c: 0.8, t: 0.08 }
|
|
30546
30750
|
],
|
|
30547
30751
|
{ up: "y", n: 10 }
|
|
@@ -30573,8 +30777,8 @@ var GameUrban = (() => {
|
|
|
30573
30777
|
const finB = c.add(
|
|
30574
30778
|
EA.foilGeo(
|
|
30575
30779
|
[
|
|
30576
|
-
{ p: [-2.64, 0.
|
|
30577
|
-
{ p: [-3.24, 1.
|
|
30780
|
+
{ p: [-2.64, 0.424, 0], c: 1.27, t: 0.11 },
|
|
30781
|
+
{ p: [-3.24, 1.853, 0], c: 0.74, t: 0.1 }
|
|
30578
30782
|
],
|
|
30579
30783
|
{ up: "z", n: 10 }
|
|
30580
30784
|
),
|
|
@@ -30844,10 +31048,11 @@ var GameUrban = (() => {
|
|
|
30844
31048
|
EA.sideKeepP(fdP, 0.35, s),
|
|
30845
31049
|
s > 0 ? lbl("front_right_door_window") : lbl("front_left_door_window"),
|
|
30846
31050
|
"tempered",
|
|
30847
|
-
{ pos: new V3(0.4, 1.5, s * 0.64) }
|
|
31051
|
+
{ pos: new V3(0.4, 1.5, s * 0.64), k: 0.988 }
|
|
30848
31052
|
);
|
|
30849
31053
|
EA.fuseGlass(c, ST, EA.sideKeepP(rdP, 0.35, s), s > 0 ? lbl("rear_right_door_window") : lbl("rear_left_door_window"), "tempered", {
|
|
30850
|
-
pos: new V3(-0.5, 1.5, s * 0.63)
|
|
31054
|
+
pos: new V3(-0.5, 1.5, s * 0.63),
|
|
31055
|
+
k: 0.988
|
|
30851
31056
|
});
|
|
30852
31057
|
const df = EA.polySdf([
|
|
30853
31058
|
[0.78, 0.72],
|
|
@@ -30943,7 +31148,7 @@ var GameUrban = (() => {
|
|
|
30943
31148
|
const hs = c.add(
|
|
30944
31149
|
EA.foilGeo(
|
|
30945
31150
|
[
|
|
30946
|
-
{ p: [-5.25, 1.76,
|
|
31151
|
+
{ p: [-5.25, 1.76, s * 2e-3], c: 0.45, t: 0.1 },
|
|
30947
31152
|
{ p: [-5.32, 1.76, s * 0.62], c: 0.34, t: 0.09 }
|
|
30948
31153
|
],
|
|
30949
31154
|
{ up: "y", n: 8 }
|
|
@@ -31271,7 +31476,7 @@ var GameUrban = (() => {
|
|
|
31271
31476
|
const hs = c.add(
|
|
31272
31477
|
EA.foilGeo(
|
|
31273
31478
|
[
|
|
31274
|
-
{ p: [-5.3, 1.98,
|
|
31479
|
+
{ p: [-5.3, 1.98, s * 2e-3], c: 0.6, t: 0.11 },
|
|
31275
31480
|
{ p: [-5.38, 1.98, s * 1], c: 0.52, t: 0.1 }
|
|
31276
31481
|
],
|
|
31277
31482
|
{ up: "y", n: 8 }
|
|
@@ -31469,7 +31674,10 @@ var GameUrban = (() => {
|
|
|
31469
31674
|
hasSunroof: (key) => !!options.sunroofs?.includes(key),
|
|
31470
31675
|
register(spec, build) {
|
|
31471
31676
|
if (!groups.has(spec.group) || only && !only.has(spec.key) || skip.has(spec.key)) return;
|
|
31472
|
-
kit.register({ ...spec, seedKey: legacyVehicleSeeds[spec.key] },
|
|
31677
|
+
kit.register({ ...spec, seedKey: legacyVehicleSeeds[spec.key] }, (context, vehicleKit) => {
|
|
31678
|
+
build(context, vehicleKit);
|
|
31679
|
+
separateSpokes(context);
|
|
31680
|
+
});
|
|
31473
31681
|
}
|
|
31474
31682
|
};
|
|
31475
31683
|
}
|