@adatechnology/game-urban 0.3.13 → 0.5.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.
@@ -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
- [DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present" },
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.VEHICLE_CREASE]: { priority: 100, phase: "idle" }
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) => [p[0] + MARGIN, p[1] + MARGIN, p[2] - MARGIN, p[3] - MARGIN];
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) + MARGIN;
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 = MARGIN + (extra || 0);
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: WALL_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 along = alongV ? extentV : extentU;
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 - along;
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 + along] : [alongStart, p, alongStart + along, p + across];
678
- const clear = alongV ? [p - lowClear, alongStart - car.end, p + across + highClear, alongStart + along + car.end] : [alongStart - car.end, p - lowClear, alongStart + along + car.end, p + across + highClear];
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
- if (j.axis === "u") return n[1] > 0 ? [u - h, v - MARGIN, u + h, v + depth] : [u - h, v - depth, u + h, v + MARGIN];
710
- return n[0] > 0 ? [u - MARGIN, v - h, u + depth, v + h] : [u - depth, v - h, u + MARGIN, v + h];
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 : MARGIN;
748
- const e1 = atDoor(a1) ? 0 : MARGIN;
749
- return p.axis === "u" ? [a0 - e0, pos - MARGIN, a1 + e1, pos + MARGIN] : [pos - MARGIN, a0 - e0, pos + MARGIN, a1 + e1];
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 = inner(room.parts[0]);
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 = inner(room.parts[0]);
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 = inner(room.parts[Math.min(def.part || 0, room.parts.length - 1)]);
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 + MARGIN) || side === "right" && eq(r[2], found2.pos - MARGIN) || side === "front" && eq(r[1], found2.pos + MARGIN) || side === "back" && eq(r[3], found2.pos - MARGIN))
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] - MARGIN : side === "right" ? R[2] + MARGIN : side === "front" ? R[1] - MARGIN : R[3] + MARGIN;
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] * (MARGIN + 0.1), (rect[1] + rect[3]) / 2], [(rect[0] + rect[2]) / 2, kz - normalV[1] * (MARGIN + 0.1)]]) if (isOpenSide(plan, room, sp[0], sp[1])) return invalid("open_wall");
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,93 @@ 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
+ crossarm: { reach: 0.3, width: 2, height: 0.1, depth: 0.09, color: 9211014 },
3076
+ insulators: { at: [-0.55, 0.35, 1.15], radius: 0.04, color: 14210248 },
3077
+ bushings: { spread: 0.16, radius: 0.025, height: 0.14, color: 11055288 },
3078
+ lowVoltage: { out: 0.2, color: 6185060 },
3079
+ telecom: { out: 0.18, color: 6185060 },
3080
+ guy: { reach: 3, color: 8027262 }
3081
+ };
3082
+
2954
3083
  // src/poles.ts
2955
3084
  var on = (o) => o.on ?? true;
3085
+ var lensOf = (o, parent) => ({
3086
+ emissive: on(o),
3087
+ ...parent === void 0 ? {} : { parent },
3088
+ ...on(o) && o.flicker ? { flickerPhase: flickerPhaseOf(o.x, o.z) } : {}
3089
+ });
3090
+ var along = (o, reach) => ({ x: o.x + reach * Math.cos(o.ry ?? 0), z: o.z - reach * Math.sin(o.ry ?? 0) });
2956
3091
  function drawMast(b, mast, x, z, parent = -1) {
2957
3092
  b.cylinder(x, 0, z, mast.radiusTop, mast.radiusBottom, mast.height, mast.color, parent, mast.segments, mast.style);
2958
3093
  }
2959
3094
  function spendLight(b, light, x, z, o) {
2960
- if (on(o) && b.lights.take()) b.light({ x: x + (light.reach ?? 0), y: light.y, z: z + (light.z ?? 0), color: light.color, intensity: light.intensity, distance: light.distance, flicker: o.flicker ?? false });
3095
+ const ry = o.ry ?? 0;
3096
+ const [reach, side] = [light.reach ?? 0, light.z ?? 0];
3097
+ 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
3098
  }
2962
3099
  var doubleArm = (b, spec, o) => {
2963
3100
  const group = b.group(o.x, 0, o.z, o.ry ?? 0);
2964
3101
  drawMast(b, spec.mast, 0, 0, group);
2965
3102
  for (const side of [-1, 1]) {
2966
3103
  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, { parent: group, emissive: on(o) });
3104
+ 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
3105
  }
2969
- spendLight(b, spec.light, o.x, o.z, o);
3106
+ spendLight(b, spec.light, o.x, o.z, { ...o, ry: 0 });
2970
3107
  };
2971
3108
  var singleArm = (b, spec, o) => {
2972
3109
  const dir = o.dir ?? 1;
3110
+ const ry = o.ry ?? 0;
3111
+ const arm = along(o, dir * spec.arm.reach);
3112
+ const lamp = along(o, dir * spec.lamp.reach);
3113
+ const drum = along(o, -dir * spec.transformer.offset);
2973
3114
  drawMast(b, spec.mast, o.x, o.z);
2974
- b.box(o.x + dir * spec.arm.reach, spec.arm.y, o.z, spec.arm.width, spec.arm.height, spec.arm.depth, spec.arm.color);
2975
- b.box(o.x + dir * spec.lamp.reach, spec.lamp.y, o.z, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit, { emissive: on(o) });
2976
- if (o.transformer) b.cylinder(o.x - dir * spec.transformer.offset, spec.transformer.y, o.z, spec.transformer.radius, spec.transformer.radius, spec.transformer.height, spec.transformer.color, -1, spec.transformer.segments);
3115
+ b.box(arm.x, spec.arm.y, arm.z, spec.arm.width, spec.arm.height, spec.arm.depth, spec.arm.color, { ry });
3116
+ 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 });
3117
+ 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
3118
  spendLight(b, { ...spec.light, reach: dir * (spec.light.reach ?? spec.lamp.reach) }, o.x, o.z, o);
2978
3119
  };
2979
3120
  var lantern = (b, spec, o) => {
3121
+ const lamp = along(o, spec.lamp.reach);
2980
3122
  drawMast(b, spec.mast, o.x, o.z);
2981
- b.box(o.x + spec.lamp.reach, spec.lamp.y, o.z, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit, { emissive: on(o) });
3123
+ 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
3124
  b.cone(o.x, spec.cap.y, o.z, spec.cap.radius, spec.cap.height, spec.cap.color, -1, spec.cap.segments);
2983
3125
  spendLight(b, spec.light, o.x, o.z, o);
2984
3126
  };
2985
3127
  var crossarm = (b, spec, o) => {
3128
+ const ry = o.ry ?? 0;
3129
+ const arm = along(o, spec.arm.reach);
3130
+ const lamp = along(o, spec.lamp.reach);
2986
3131
  drawMast(b, spec.mast, o.x, o.z);
2987
- b.box(o.x + spec.arm.reach, spec.arm.y, o.z, spec.arm.width, spec.arm.height, spec.arm.depth, spec.arm.color);
2988
- b.box(o.x + spec.lamp.reach, spec.lamp.y, o.z, spec.lamp.width, spec.lamp.height, spec.lamp.depth, on(o) ? spec.lens.lit : spec.lens.unlit, { emissive: on(o) });
3132
+ b.box(arm.x, spec.arm.y, arm.z, spec.arm.width, spec.arm.height, spec.arm.depth, spec.arm.color, { ry });
3133
+ 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
3134
  spendLight(b, { ...spec.light, reach: spec.light.reach ?? spec.lamp.reach }, o.x, o.z, o);
2990
3135
  };
2991
3136
  var floodTower = (b, spec, o) => {
2992
3137
  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
3138
  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
3139
  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, { emissive: on(o) });
3140
+ 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
3141
  }
2997
3142
  spendLight(b, spec.light, o.x, o.z, o);
2998
3143
  };
2999
- var POLE_SHAPES = { double_arm: doubleArm, single_arm: singleArm, lantern, crossarm, flood_tower: floodTower };
3144
+ var distribution = (b, spec, o) => singleArm(b, spec, o);
3145
+ var POLE_SHAPES = { double_arm: doubleArm, single_arm: singleArm, lantern, crossarm, flood_tower: floodTower, distribution };
3000
3146
  var LED = {
3001
3147
  mast: { radiusTop: 0.1, radiusBottom: 0.14, height: 9, color: 5593438, style: { metalness: 0.6, roughness: 0.5 } },
3002
3148
  arm: { reach: 0.8, y: 8.8, width: 1.6, height: 0.1, depth: 0.12, color: 5593438 },
@@ -3038,7 +3184,8 @@ var GameUrban = (() => {
3038
3184
  { id: "concrete_arm", shape: "single_arm", spec: CONCRETE },
3039
3185
  { id: "cast_iron", shape: "lantern", spec: IRON },
3040
3186
  { id: "wood_crossarm", shape: "crossarm", spec: WOOD },
3041
- { id: "flood_tower", shape: "flood_tower", spec: FLOOD }
3187
+ { id: "flood_tower", shape: "flood_tower", spec: FLOOD },
3188
+ { id: "concrete_distribution", shape: "distribution", spec: DISTRIBUTION }
3042
3189
  ];
3043
3190
 
3044
3191
  // src/streets.ts
@@ -3049,9 +3196,9 @@ var GameUrban = (() => {
3049
3196
  var DEFAULT_GROUND_SIZE = 600;
3050
3197
  var roadStyle = (o) => ({ ...DEFAULT_ROAD_STYLE, ...o?.road, dash: { ...DEFAULT_ROAD_STYLE.dash, ...o?.road?.dash } });
3051
3198
  var walkStyle = (o) => ({ ...DEFAULT_WALK_STYLE, ...o?.walk });
3052
- function drawRoad(b, x, z, w, l, along, options) {
3199
+ function drawRoad(b, x, z, w, l, along2, options) {
3053
3200
  const style = roadStyle(options);
3054
- const alongX = along === "x";
3201
+ const alongX = along2 === "x";
3055
3202
  b.plane(x, ROAD_LEVEL, z, alongX ? l : w, alongX ? w : l, style.color);
3056
3203
  const { dash } = style;
3057
3204
  for (let u = -l / 2 + dash.first; u < l / 2; u += dash.every) {
@@ -3262,12 +3409,12 @@ var GameUrban = (() => {
3262
3409
  for (const side of [-1.5, 1.5]) b.box(x + side, 8.2, z, 0.15, 1.6, 0.15, palette2.deck);
3263
3410
  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
3411
  }
3265
- function drawSandbags(b, x, z, length, along, rows = 3, c) {
3412
+ function drawSandbags(b, x, z, length, along2, rows = 3, c) {
3266
3413
  const color = colors(c).sandbags;
3267
3414
  for (let r = 0; r < rows; r++) {
3268
3415
  for (let i = 0; i < length / SANDBAG_LENGTH; i++) {
3269
3416
  const u = -length / 2 + 0.28 + i * SANDBAG_LENGTH + r % 2 * 0.28;
3270
- b.item(along === "x" ? x + u : x, r * 0.21, along === "x" ? z : z + u, along === "x" ? 0.55 : 0.32, 0.22, along === "x" ? 0.32 : 0.55, color);
3417
+ 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
3418
  }
3272
3419
  }
3273
3420
  }
@@ -4272,7 +4419,7 @@ var GameUrban = (() => {
4272
4419
  const core = {
4273
4420
  poles,
4274
4421
  streets: {
4275
- road: (b, x, z, w, l, along) => drawRoad(b, x, z, w, l, along, options.streets),
4422
+ road: (b, x, z, w, l, along2) => drawRoad(b, x, z, w, l, along2, options.streets),
4276
4423
  walk: (b, x, z, w, d) => drawWalk(b, x, z, w, d, options.streets),
4277
4424
  ground: drawGround,
4278
4425
  grid: (b, g) => drawStreetGrid(b, g.block, g.count, g.width, options.streets)
@@ -4289,7 +4436,7 @@ var GameUrban = (() => {
4289
4436
  tree: (b, x, z, scale) => drawTree(b, x, z, scale, propColors),
4290
4437
  container: drawContainer,
4291
4438
  watchtower: (b, x, z, searchlight) => drawWatchtower(b, x, z, searchlight, propColors),
4292
- sandbags: (b, x, z, length, along, rows) => drawSandbags(b, x, z, length, along, rows, propColors),
4439
+ sandbags: (b, x, z, length, along2, rows) => drawSandbags(b, x, z, length, along2, rows, propColors),
4293
4440
  label: (b, x, z, title, subtitle) => drawStripLabel(b, x, z, title, subtitle, propColors),
4294
4441
  wires: (b, points, y, color) => drawWires(b, points, y, color, propColors)
4295
4442
  }
@@ -7961,6 +8108,32 @@ var GameUrban = (() => {
7961
8108
  }
7962
8109
  ];
7963
8110
  }
8111
+ var THICKNESS_STEP = 0.0625;
8112
+ var THINNEST = 0.15;
8113
+ var CLEARANCE = 15e-4;
8114
+ var SPOKE_HALF_THICKNESS = 0.02;
8115
+ var DISH_HALF_THICKNESS = 0.025;
8116
+ function sharesPlaneWithDish(reach, scale) {
8117
+ const dishReach = reach * 0.9;
8118
+ const outer = Math.abs(reach + SPOKE_HALF_THICKNESS * scale - (dishReach + DISH_HALF_THICKNESS));
8119
+ const inner2 = Math.abs(reach - SPOKE_HALF_THICKNESS * scale - (dishReach - DISH_HALF_THICKNESS));
8120
+ return outer < CLEARANCE || inner2 < CLEARANCE;
8121
+ }
8122
+ function separateSpokes(context) {
8123
+ for (const wheel of context.wheels) {
8124
+ let previous = 1 + THICKNESS_STEP;
8125
+ for (const child of wheel.children) {
8126
+ const mesh = child;
8127
+ const type = mesh.geometry?.type;
8128
+ if (!mesh.isMesh || type !== "BufferGeometry" && type !== "BoxGeometry" || mesh.position.z === 0) continue;
8129
+ const reach = Math.abs(mesh.position.z);
8130
+ let scale = previous - THICKNESS_STEP;
8131
+ while (sharesPlaneWithDish(reach, scale) && scale > THINNEST) scale -= THICKNESS_STEP / 2;
8132
+ mesh.scale.z = Math.max(scale, THINNEST);
8133
+ previous = scale;
8134
+ }
8135
+ }
8136
+ }
7964
8137
  function installBoatsExtra(fx) {
7965
8138
  const kit = fx.kit;
7966
8139
  const THREE = kit.THREE;
@@ -8394,12 +8567,12 @@ var GameUrban = (() => {
8394
8567
  cs.castShadow = false;
8395
8568
  [1, -1].forEach(function(s) {
8396
8569
  c.roundBox(2.6, 0.06, 0.42, 0.02, teak, -2.45, 0.86, s * 0.82);
8397
- c.roundBox(2.6, 0.38, 0.06, 0.02, white, -2.45, 0.67, s * 0.6);
8570
+ c.roundBox(2.6, 0.376, 0.06, 0.02, white, -2.45, 0.671, s * 0.6);
8398
8571
  c.roundBox(2.8, 0.22, 0.05, 0.02, white, -2.4, 1.02, s * (H.sheerAt(-2.4).z - 0.32));
8399
8572
  c.cylinder(0.06, 0.07, 0.11, MT.chrome, -1.6, 1.15, s * 1.06);
8400
8573
  c.cylinder(0.035, 0.035, 0.02, MT.chrome, -1.6, 1.21, s * 1.06);
8401
8574
  });
8402
- c.roundBox(0.3, 0.38, 1.2, 0.03, white, -3.75, 0.67, 0);
8575
+ c.roundBox(0.3, 0.376, 1.2, 0.03, white, -3.75, 0.671, 0);
8403
8576
  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
8577
  const trST = [
8405
8578
  [-1.1, 0.8, 1.56, 2, 6],
@@ -8808,9 +8981,9 @@ var GameUrban = (() => {
8808
8981
  });
8809
8982
  c.roundBox(1.6, 0.03, 0.1, 0.01, MT.wood, 0.3, 0.05, 0.38, { rot: [0.2, 0, 0] });
8810
8983
  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.14, 0.15);
8984
+ c.roundBox(0.36, 0.24, 0.26, 0.03, CM("#ffffff", { roughness: 0.5 }), 1.25, 0.142, 0.15);
8812
8985
  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.282);
8986
+ c.roundBox(0.03, 0.1, 0.02, 5e-3, CM("#d01c1c"), 1.25, 0.2, 0.284);
8814
8987
  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
8988
  buoy.rotation.x = PI / 2;
8816
8989
  const motor = EA.outboard(c, -1.99, 0.55, 0, { k: 1, tiller: true, label: "40", col: "#1d1f22" });
@@ -8946,7 +9119,7 @@ var GameUrban = (() => {
8946
9119
  return Math.min(0.06 - y, x - x0 - 0.04);
8947
9120
  }),
8948
9121
  CM("#1d2023", { roughness: 0.6 }),
8949
- { sz: 1.004, dy: 3e-3 }
9122
+ { sz: 1.004, dy: 3e-3, ends: false }
8950
9123
  );
8951
9124
  EA.sheerTube(c, H, x0 + 0.02, 6.2, 0.07, blk, { dy: -0.1, dz: 0.02 });
8952
9125
  const deck = c.add(EA.deckGeo(H, x0 + 0.02, 6.32, { n: 40, m: 10, crown: 0.05 }), deckC);
@@ -12037,7 +12210,7 @@ var GameUrban = (() => {
12037
12210
  [0.62, 0.48, -0.48, -0.62].forEach(function(z) {
12038
12211
  const s = dg.at(dg.uz(z), 0.25);
12039
12212
  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.102, MT.dark, s.p.x - 0.02, 0.25, z, "x");
12213
+ c2.cylinder(0.036, 0.036, 0.106, MT.dark, s.p.x - 0.02, 0.25, z, "x");
12041
12214
  });
12042
12215
  const lip = K.grid(-1, 0, { z1: 0.7, y0: 0.88, y1: 0.97, du: 0.03, dv: 0.02 });
12043
12216
  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 +12313,9 @@ var GameUrban = (() => {
12140
12313
  c.cylinder(0.08, 0.065, 0.12, MT.steel, x, y, z, "x");
12141
12314
  c.cylinder(0.07, 0.07, 0.012, MT.head, x + 0.065, y, z, "x");
12142
12315
  }
12143
- function sandbags(c, x0, x1, y, z, along) {
12316
+ function sandbags(c, x0, x1, y, z, along2) {
12144
12317
  const bag = CM("#6e6248", { roughness: 0.95 });
12145
- if (along === "z") {
12318
+ if (along2 === "z") {
12146
12319
  for (let zz = x0; zz <= x1 + 1e-6; zz += 0.42) {
12147
12320
  c.roundBox(0.3, 0.16, 0.4, 0.07, bag, z, y, zz);
12148
12321
  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 +12623,7 @@ var GameUrban = (() => {
12450
12623
  side: s,
12451
12624
  noPart: true
12452
12625
  });
12453
- c.roundBox(0.03, 0.12, 0.42, 0.02, MT.dark, bx + 0.125, by - bh * 0.3, s * 0.35);
12626
+ c.roundBox(0.03, 0.12, 0.42, 0.02, MT.dark, bx + 0.119, by - bh * 0.3, s * 0.35);
12454
12627
  });
12455
12628
  }
12456
12629
  c.roundBox(0.06, 0.06, 0.12, 0.02, MT.steel, bx + 0.13, by - bh * 0.35, 0);
@@ -12553,7 +12726,7 @@ var GameUrban = (() => {
12553
12726
  -(W - 0.2) / 2 + (k + 0.5) * (W - 0.2) / 8
12554
12727
  );
12555
12728
  [1, -1].forEach(function(s) {
12556
- c.roundBox(0.06, 0.32, 0.06, 0.01, MT.trim, rear + 0.12, ry - 0.2, s * 0.43);
12729
+ c.roundBox(0.06, 0.32, 0.06, 0.01, MT.trim, rear + 0.118, ry - 0.2, s * 0.43);
12557
12730
  });
12558
12731
  m.rearBumper = bar;
12559
12732
  c.part("bumper", trl("labels.rear_bumper"), bar, new V3(rear, 0.52, 0), 1);
@@ -13615,7 +13788,7 @@ var GameUrban = (() => {
13615
13788
  });
13616
13789
  const vg = c.roundBox(0.32, 0.2, 0.03, 0.03, MT.armorGlass, 1.3, 2.45, zs);
13617
13790
  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 * 4e-3);
13791
+ c.roundBox(0.4, 0.28, 0.02, 0.03, plate, 1.3, 2.45, zs - s * 8e-3);
13619
13792
  for (let x = rear + 0.2; x < bx0; x += 0.3) {
13620
13793
  c.sphere(0.018, MT.steel, x, 1.2, zs);
13621
13794
  c.sphere(0.018, MT.steel, x, 2.98, zs);
@@ -13724,7 +13897,7 @@ var GameUrban = (() => {
13724
13897
  const hx0 = 0.02, hx1 = 1.84 + FX, hy = 1.48;
13725
13898
  [1, -1].forEach(function(s) {
13726
13899
  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);
13900
+ 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
13901
  c.roundBox(1, 0.03, 0.02, 0.01, CM("#e9e6dd"), 0.55, 1.36, s * 0.38);
13729
13902
  c.text("275", 0.3, 0.14, 0.32, 1.2, s * 0.384, s > 0 ? "+z" : "-z", { fg: "#f2efe6" });
13730
13903
  });
@@ -14198,7 +14371,7 @@ var GameUrban = (() => {
14198
14371
  const hs = c.add(
14199
14372
  EA.foilGeo(
14200
14373
  [
14201
- { p: [-3.9, 1.44, 0], c: 0.3, t: 0.1 },
14374
+ { p: [-3.9, 1.44, s * 2e-3], c: 0.3, t: 0.1 },
14202
14375
  { p: [-3.95, 1.44, s * 0.42], c: 0.22, t: 0.09 }
14203
14376
  ],
14204
14377
  { up: "y", n: 8 }
@@ -14437,7 +14610,7 @@ var GameUrban = (() => {
14437
14610
  },
14438
14611
  lbl("chin_windows"),
14439
14612
  "tempered",
14440
- { pos: new V3(2.3, 0.88, 0) }
14613
+ { pos: new V3(2.3, 0.88, 0), k: 0.988 }
14441
14614
  );
14442
14615
  [1, -1].forEach(function(s) {
14443
14616
  EA.fuseGlass(
@@ -14537,7 +14710,7 @@ var GameUrban = (() => {
14537
14710
  tipCol: "#e6e4dd",
14538
14711
  phase: 0.25
14539
14712
  });
14540
- c.roundBox(0.5, 0.12, 0.16, 0.05, MT.steel, 0, 2.8, 0);
14713
+ c.roundBox(0.5, 0.12, 0.16, 0.05, MT.steel, 0, 2.797, 0);
14541
14714
  const bm = boom(
14542
14715
  c,
14543
14716
  EA,
@@ -14571,7 +14744,7 @@ var GameUrban = (() => {
14571
14744
  const hs = c.add(
14572
14745
  EA.foilGeo(
14573
14746
  [
14574
- { p: [-4.05, 1.68, 0], c: 0.42, t: 0.12, cam: -0.04 },
14747
+ { p: [-4.05, 1.68, s * 2e-3], c: 0.42, t: 0.12, cam: -0.04 },
14575
14748
  { p: [-4.1, 1.68, s * 0.99], c: 0.38, t: 0.11, cam: -0.04 }
14576
14749
  ],
14577
14750
  { up: "y", n: 8 }
@@ -14820,7 +14993,7 @@ var GameUrban = (() => {
14820
14993
  },
14821
14994
  lbl("chin_windows"),
14822
14995
  "tempered",
14823
- { pos: new V3(3.05, 0.95, 0) }
14996
+ { pos: new V3(3.05, 0.95, 0), k: 0.988 }
14824
14997
  );
14825
14998
  [1, -1].forEach(function(s) {
14826
14999
  EA.fuseGlass(c, ST, EA.sideKeepP(fdP, 0.6, s), s > 0 ? lbl("co_pilot_door_window") : lbl("pilot_door_window"), "tempered", {
@@ -14985,7 +15158,7 @@ var GameUrban = (() => {
14985
15158
  const hs = c.add(
14986
15159
  EA.foilGeo(
14987
15160
  [
14988
- { p: [-5.75, 2.1, 0], c: 0.62, t: 0.12, cam: -0.03 },
15161
+ { p: [-5.75, 2.1, s * 2e-3], c: 0.62, t: 0.12, cam: -0.03 },
14989
15162
  { p: [-5.85, 2.1, s * 1.05], c: 0.52, t: 0.11, cam: -0.03 }
14990
15163
  ],
14991
15164
  { up: "y", n: 8 }
@@ -15398,7 +15571,7 @@ var GameUrban = (() => {
15398
15571
  EA.colorize(
15399
15572
  EA.foilGeo(
15400
15573
  [
15401
- { p: [-8.3, 2.75, 0], c: 1, t: 0.1 },
15574
+ { p: [-8.3, 2.75, s * 2e-3], c: 1, t: 0.1 },
15402
15575
  { p: [-8.5, 2.75, s * 1.85], c: 0.7, t: 0.09 }
15403
15576
  ],
15404
15577
  { up: "y", n: 8 }
@@ -15841,13 +16014,13 @@ var GameUrban = (() => {
15841
16014
  });
15842
16015
  return out;
15843
16016
  }
15844
- function sandbags(c, x0, x1, y, z, along, rows) {
16017
+ function sandbags(c, x0, x1, y, z, along2, rows) {
15845
16018
  rows = rows || 2;
15846
16019
  for (let r = 0; r < rows; r++) {
15847
16020
  const off = r % 2 ? 0.2 : 0;
15848
16021
  for (let t = x0 + off; t <= x1 + 1e-6; t += 0.42) {
15849
16022
  const j = kit.hash(t, r, z) - 0.5;
15850
- if (along === "z") c.roundBox(0.32, 0.16, 0.42, 0.07, BAG, z, y + r * 0.14, t, { rot: [0, j * 0.2, 0] });
16023
+ 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
16024
  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
16025
  }
15853
16026
  }
@@ -16468,7 +16641,7 @@ var GameUrban = (() => {
16468
16641
  const floor = c.roundBox(L, 0.1, W, 0.02, wood, cx, y0, 0, { def: true });
16469
16642
  c.roundBox(L - 0.1, 0.14, 0.2, 0.02, MT.trim, cx, y0 - 0.12, 0.45);
16470
16643
  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.1, 0);
16644
+ 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
16645
  const sides = [];
16473
16646
  [1, -1].forEach(function(s) {
16474
16647
  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 +16652,7 @@ var GameUrban = (() => {
16479
16652
  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
16653
  });
16481
16654
  });
16482
- c.roundBox(0.06, sideH, W, 0.02, wood, x0 - 0.03, y0 + sideH / 2 + 0.05, 0, { def: true });
16655
+ c.roundBox(0.06, sideH, W, 0.02, wood, x0 - 0.028, y0 + sideH / 2 + 0.05, 0, { def: true });
16483
16656
  const tg = c.roundBox(0.06, sideH * 0.7, W - 0.1, 0.02, wood, x1 - 0.02, y0 - sideH * 0.3, 0);
16484
16657
  tg.rotation.z = 0.08;
16485
16658
  const top = y0 + sideH + bowH, yb = y0 + sideH + 0.05, nseg = 20, pos = [], idx = [];
@@ -16873,7 +17046,7 @@ var GameUrban = (() => {
16873
17046
  top: roofY + 0.03,
16874
17047
  k: 0.28,
16875
17048
  holes,
16876
- archInner: W / 2 - ww - 0.1,
17049
+ archInner: W / 2 - ww - 0.098,
16877
17050
  sub: 0.18,
16878
17051
  bev: 0.025
16879
17052
  });
@@ -17206,8 +17379,7 @@ var GameUrban = (() => {
17206
17379
  [1.3, roofY, 0.1],
17207
17380
  [F - 0.04, 1.02, 0.06],
17208
17381
  [F, 0.9, 0.05],
17209
- [2.05, 0.46, 0.06],
17210
- [-1.4, 0.44, 0.04]
17382
+ [2.05, 0.46, 0.06]
17211
17383
  ];
17212
17384
  const arches = axles.map(function(x) {
17213
17385
  return [x, wr, wr + 0.09];
@@ -17285,8 +17457,8 @@ var GameUrban = (() => {
17285
17457
  [1, -1].forEach(function(s) {
17286
17458
  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
17459
  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.16), { def: true });
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.16), { def: true });
17460
+ c.roundBox(1, 0.05, 0.32, 0.02, paintMat(c, col), axles[0], 1.12, s * (W / 2 - 0.158), { def: true });
17461
+ 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
17462
  c.roundBox(1.2, 0.26, 0.28, 0.03, paintMat(c, OLIVE2), -1.45, 1.28, s * (W / 2 - 0.17));
17291
17463
  [-0.95, -1.95].forEach(function(x) {
17292
17464
  c.roundBox(0.3, 0.2, 0.02, 0.01, MT.dark, x, 1.28, s * (W / 2 - 0.025));
@@ -17443,7 +17615,7 @@ var GameUrban = (() => {
17443
17615
  m.kind = "car";
17444
17616
  m.bullet = true;
17445
17617
  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] });
17618
+ 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
17619
  const items = [
17448
17620
  [R, 1.05, 0.04],
17449
17621
  [R - 0.02, deckY - 0.04, 0.05],
@@ -17486,7 +17658,7 @@ var GameUrban = (() => {
17486
17658
  (ex0 + ex1) / 2
17487
17659
  );
17488
17660
  scale(c, nB, bcen, 1.45);
17489
- c.roundBox(ex1 - ex0 - 0.1, 0.02, 2.1, 0.01, BAY_LIGHT, bcen.x, 0.95, 0);
17661
+ c.roundBox(ex1 - ex0 - 0.1, 0.012, 2.1, 0.01, BAY_LIGHT, bcen.x, 0.957, 0);
17490
17662
  [1, -1].forEach(function(sd) {
17491
17663
  c.roundBox(ex1 - ex0 - 0.1, 0.55, 0.02, 0.01, BAY_LIGHT, bcen.x, 1.25, sd * 1.08);
17492
17664
  });
@@ -17512,12 +17684,12 @@ var GameUrban = (() => {
17512
17684
  c.roundBox(0.55, 0.42, 0.03, 0.01, MT.rubber, 2.95, 0.86, s * (W / 2 + 0.05));
17513
17685
  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
17686
  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.02, 0.85, s * tz);
17687
+ c.roundBox(0.03, 0.5, 0.55, 0.01, MT.rubber, R + 0.015, 0.85, s * tz);
17516
17688
  star(c, 0.6, 1.3, s * (H.half(1.3) + 0.01), 0.17, s > 0 ? "+z" : "-z", { ring: true });
17517
17689
  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
17690
  guardedHeadlight(c, 2.95, gl(2.95) + 0.16, s * 1.3, s, { style: "round" });
17519
17691
  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.04, 1.35, s * 1.25);
17692
+ c.roundBox(0.1, 0.18, 0.3, 0.03, OLIVE_STEEL, R - 0.037, 1.35, s * 1.25);
17521
17693
  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
17694
  c.tube(
17523
17695
  [
@@ -17559,7 +17731,7 @@ var GameUrban = (() => {
17559
17731
  { rot: [0, 0, -0.18] }
17560
17732
  );
17561
17733
  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.78, { w: 0.44, h: 0.34, back: 0.5, lean: 0.5, mat: CM("#2f3226", { roughness: 0.9 }) });
17734
+ 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
17735
  [-0.95, -0.78, -0.61].forEach(function(z, i) {
17564
17736
  periscope(c, 2.3, roofY - 0.08, z, 0.14, i === 1 ? lbl("driver_periscope") : null);
17565
17737
  });
@@ -17681,14 +17853,14 @@ var GameUrban = (() => {
17681
17853
  const g = new THREE.Group();
17682
17854
  g.position.set(x, y, z);
17683
17855
  c.vehicle.add(g);
17684
- const wmsh = new THREE.Mesh(new THREE.CylinderGeometry(rad, rad, w * 0.8, 24), wm);
17856
+ const wmsh = new THREE.Mesh(new THREE.CylinderGeometry(rad, rad, w * (opt.width ?? 0.8), 24), wm);
17685
17857
  wmsh.rotation.x = PI / 2;
17686
17858
  wmsh.castShadow = true;
17687
17859
  g.add(wmsh);
17688
17860
  if (opt.tires)
17689
17861
  [-1, 1].forEach(function(q) {
17690
17862
  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;
17863
+ t.position.z = q * w * (opt.tireAt ?? 0.22);
17692
17864
  g.add(t);
17693
17865
  });
17694
17866
  const hb = new THREE.Mesh(new THREE.CylinderGeometry(rad * 0.32, rad * 0.32, w * 0.86, 10), MT.steel);
@@ -17705,21 +17877,21 @@ var GameUrban = (() => {
17705
17877
  for (let k = 0; k < 6; k++) {
17706
17878
  const b = new THREE.Mesh(G.roundedBox(rad * 1.5, 0.05, 0.04, 0.01), wm);
17707
17879
  b.rotation.z = k / 6 * PI;
17708
- b.position.z = (z > 0 ? 1 : -1) * w * 0.42;
17880
+ b.position.z = (z > 0 ? 1 : -1) * (w * 0.42 + k * 3e-3);
17709
17881
  g.add(b);
17710
17882
  }
17711
17883
  c.spin.push({ o: g, axis: "z", v: 0, track: true });
17712
17884
  return g;
17713
17885
  }
17714
17886
  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 });
17887
+ wheel(x0, yS, rS, { teeth: true, width: 0.76 });
17888
+ wheel(x1, yI, rI, { spokes: true, tires: true, width: 0.76, tireAt: 0.2 });
17717
17889
  const topY = function(x) {
17718
17890
  return yS + rS + th / 2 + (yI + rI - yS - rS) * (x - x0) / (x1 - x0);
17719
17891
  };
17720
17892
  for (let q = 0; q < 4; q++) {
17721
17893
  const xr = x0 + (x1 - x0) * (0.2 + q * 0.2);
17722
- wheel(xr, topY(xr) - rr - th / 2 - 0.01, rr, {});
17894
+ wheel(xr, topY(xr) - rr - th / 2 - 0.01, rr, { width: 0.7 });
17723
17895
  }
17724
17896
  const path = [], segs = 12;
17725
17897
  function arc(cx, cy, rad, a0, a1) {
@@ -17743,7 +17915,7 @@ var GameUrban = (() => {
17743
17915
  const curve = new THREE.SplineCurve(pts.concat([pts[0]])), lenT = curve.getLength(), nl = Math.round(lenT / 0.15), links = [];
17744
17916
  for (let l = 0; l < nl; l++) {
17745
17917
  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);
17918
+ const lg = G.roundedBox(0.13, th, w - l % 2 * 4e-3, 0.015);
17747
17919
  lg.applyMatrix4(new THREE.Matrix4().makeRotationZ(ang).setPosition(p.x, p.y, 0));
17748
17920
  links.push(lg);
17749
17921
  const gh2 = G.roundedBox(0.05, 0.05, 0.05, 0.01);
@@ -19157,8 +19329,8 @@ var GameUrban = (() => {
19157
19329
  [-0.3, 0.2].forEach(function(z, index) {
19158
19330
  const spindle = new V3(wx + 0.02, wy, z + 0.02);
19159
19331
  const blade = c.rod(spindle, new V3(wx - 0.13, wy + 0.13, z - 0.36), 9e-3, MT.trim);
19160
- const along = new V3(gh.ft - gh.fb, gh.roof - gh.belt, 0).normalize();
19161
- tagWiper({ context: c, parts: [blade], spindle, normal: new V3(along.y, -along.x, 0), index });
19332
+ const along2 = new V3(gh.ft - gh.fb, gh.roof - gh.belt, 0).normalize();
19333
+ tagWiper({ context: c, parts: [blade], spindle, normal: new V3(along2.y, -along2.x, 0), index });
19162
19334
  });
19163
19335
  if (s.fin !== false)
19164
19336
  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 +21619,9 @@ var GameUrban = (() => {
21447
21619
  ],
21448
21620
  col
21449
21621
  );
21450
- lamp(c, { style: "rect", x: 0.57, y: 0.91, z: 0, w: 0.2, h: 0.11, d: 0.08, side: 1, label: trl("labels.headlight") });
21622
+ 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
21623
  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.06, 0, { rot: [0, 0, 0.4] });
21624
+ c.roundBox(0.02, 0.05, 0.15, 0.01, MT.gauge, 0.39, 1.064, 0, { rot: [0, 0, 0.4] });
21453
21625
  handlebar(c, 0.36, 1.03, 0.37, { rise: 0.04, back: 0.06, mat: MT.chrome, stalk: 0.19 });
21454
21626
  [1, -1].forEach(function(s) {
21455
21627
  blinker(c, 0.48, 0.9, s * 0.17, true);
@@ -21651,7 +21823,7 @@ var GameUrban = (() => {
21651
21823
  body(
21652
21824
  c,
21653
21825
  [
21654
- [0.44, 1.13, 0.85, 0.24, 2.6],
21826
+ [0.435, 1.13, 0.85, 0.24, 2.6],
21655
21827
  [0.55, 1.11, 0.87, 0.24, 2.6],
21656
21828
  [0.6, 1.05, 0.91, 0.16, 2.4]
21657
21829
  ],
@@ -21818,7 +21990,7 @@ var GameUrban = (() => {
21818
21990
  body(
21819
21991
  c,
21820
21992
  [
21821
- [0.62, 1.32, 0.98, 0.3, 2.6],
21993
+ [0.615, 1.32, 0.98, 0.3, 2.6],
21822
21994
  [0.72, 1.28, 1, 0.3, 2.6],
21823
21995
  [0.78, 1.2, 1.02, 0.22, 2.4]
21824
21996
  ],
@@ -22749,8 +22921,8 @@ var GameUrban = (() => {
22749
22921
  return b;
22750
22922
  }
22751
22923
  function plateMoto(c, x, y, txt) {
22752
- c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x + 0.012, y, 0);
22753
- c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x, y, 0, "-x", {
22924
+ c.roundBox(0.02, 0.15, 0.2, 8e-3, MT.trim, x + 9e-3, y, 0);
22925
+ c.text(txt || kit.config.plate.slice(0, 5), 0.2, 0.135, x - 3e-3, y, 0, "-x", {
22754
22926
  w: 300,
22755
22927
  h: 220,
22756
22928
  bg: "#f2f2ee",
@@ -22865,7 +23037,7 @@ var GameUrban = (() => {
22865
23037
  g.add(d);
22866
23038
  for (let q = 0; q < 12; q++) {
22867
23039
  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 + 6e-3));
23040
+ sl.position.set(Math.cos(a2) * rimR * 0.62, Math.sin(a2) * rimR * 0.62, s * (hw * 0.72 + 0.0105));
22869
23041
  sl.rotation.z = a2;
22870
23042
  g.add(sl);
22871
23043
  }
@@ -22963,7 +23135,7 @@ var GameUrban = (() => {
22963
23135
  body(
22964
23136
  c,
22965
23137
  [
22966
- [0.34, 0.36, 0.29, 0.28, 2.6],
23138
+ [0.335, 0.36, 0.29, 0.28, 2.6],
22967
23139
  [0.46, 0.38, 0.31, 0.46, 3],
22968
23140
  [0.6, 0.41, 0.34, 0.5, 3],
22969
23141
  [0.74, 0.43, 0.37, 0.46, 2.8],
@@ -23371,7 +23543,7 @@ var GameUrban = (() => {
23371
23543
  body(
23372
23544
  c,
23373
23545
  [
23374
- [0.42, 1.05, 0.82, 0.26, 2.6],
23546
+ [0.415, 1.05, 0.82, 0.26, 2.6],
23375
23547
  [0.52, 1.03, 0.83, 0.28, 2.6],
23376
23548
  [0.59, 0.99, 0.85, 0.22, 2.4],
23377
23549
  [0.62, 0.95, 0.87, 0.1, 2.2]
@@ -23392,7 +23564,7 @@ var GameUrban = (() => {
23392
23564
  });
23393
23565
  c.roundBox(0.015, 0.1, 0.2, 0.02, SMOKEG, 0.55, 1.035, 0, { rot: [0, 0, 0.55] });
23394
23566
  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.075, 0, { rot: [0, 0, 0.5] });
23567
+ c.roundBox(0.04, 0.032, 0.1, 6e-3, MT.gauge, 0.45, 1.078, 0, { rot: [0, 0, 0.5] });
23396
23568
  [1, -1].forEach(function(s) {
23397
23569
  blinker(c, 0.5, 0.92, s * 0.16, true);
23398
23570
  });
@@ -23809,7 +23981,7 @@ var GameUrban = (() => {
23809
23981
  });
23810
23982
  c.cylinder(0.12, 0.12, 0.07, CH, 0.2, 0.56, 0.17, "z");
23811
23983
  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.217, "+z", { fg: "#1b1c1f", size: 0.85 });
23984
+ c.text("114", 0.1, 0.04, 0.2, 0.56, 0.219, "+z", { fg: "#1b1c1f", size: 0.85 });
23813
23985
  c.sphere(0.17, CH, -0.06, 0.32, -0.17, 1.35, 0.85, 0.28);
23814
23986
  c.cylinder(0.07, 0.07, 0.02, CH, -0.02, 0.3, -0.215, "z");
23815
23987
  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 +24376,12 @@ var GameUrban = (() => {
24204
24376
  col
24205
24377
  );
24206
24378
  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.06, 0, { rot: [0, 0, 0.4] });
24379
+ c.roundBox(0.02, 0.05, 0.15, 0.01, MT.gauge, 0.39, 1.064, 0, { rot: [0, 0, 0.4] });
24208
24380
  [1, -1].forEach(function(s) {
24209
24381
  blinker(c, 0.48, 0.9, s * 0.17, true);
24210
24382
  });
24211
24383
  Z.fairing = grab(c, n0);
24212
- lamp(c, { style: "rect", x: 0.57, y: 0.91, z: 0, w: 0.2, h: 0.11, d: 0.08, side: 1, label: trl("labels.headlight") });
24384
+ 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
24385
  n0 = c.vehicle.children.length;
24214
24386
  handlebar(c, 0.36, 1.02, 0.36, { rise: 0.03, back: 0.06, mat: MT.chrome, stalk: 0.19 });
24215
24387
  Z.handlebar = grab(c, n0);
@@ -24333,9 +24505,19 @@ var GameUrban = (() => {
24333
24505
  return [s[0], cy - hh, cy + hh, s[3] * k, s[4], s[5]];
24334
24506
  });
24335
24507
  }
24508
+ function stretchSt(st) {
24509
+ const out = st.map(function(q) {
24510
+ return q.slice();
24511
+ });
24512
+ const last = out.length - 1;
24513
+ const dir = out[last][0] >= out[0][0] ? 1 : -1;
24514
+ out[0][0] = out[0][0] + dir * 3e-3;
24515
+ out[last][0] = out[last][0] - dir * 3e-3;
24516
+ return out;
24517
+ }
24336
24518
  function fSkin(c, EA, st, keep, mat, o) {
24337
24519
  o = o || {};
24338
- const m = c.add(EA.fuseGeo(scaleSt(st, o.k || 1.004), { smooth: o.smooth || 48, seg: o.seg || 30 }), mat, 0, 0, 0, o.parent);
24520
+ 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
24521
  m.castShadow = false;
24340
24522
  cutSub(m, [keep], o.sub || 0.06, o.pre);
24341
24523
  c.deform.push(m);
@@ -24343,7 +24525,7 @@ var GameUrban = (() => {
24343
24525
  }
24344
24526
  function fGlass(c, EA, st, keep, label, type, o) {
24345
24527
  o = o || {};
24346
- const m = new THREE.Mesh(EA.fuseGeo(scaleSt(st, o.k || 0.988), { smooth: o.smooth || 48, seg: o.seg || 30 }), o.mat || MT.glass);
24528
+ 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
24529
  (o.parent || c.vehicle).add(m);
24348
24530
  cutSub(m, [keep], o.sub || 0.07, o.pre);
24349
24531
  return kit.asGlass(c, m, label, type || "tempered", o.pos ? { pos: o.pos } : {});
@@ -24505,7 +24687,7 @@ var GameUrban = (() => {
24505
24687
  return Math.min(boltW(x) - Math.abs(y - bolt(x)), x + 3.2, 2.93 - x, Math.abs(z) - 0.12);
24506
24688
  }),
24507
24689
  black,
24508
- { parent: grp, sub: 0.05, pre: EA.keepT([-3.3, 3, -0.35, 0.2, 0.1]) }
24690
+ { parent: grp, sub: 0.05, k: 1.013, pre: EA.keepT([-3.3, 3, -0.35, 0.2, 0.1]) }
24509
24691
  );
24510
24692
  const doorR = EA.polySdf([
24511
24693
  [1.38, -0.4],
@@ -24570,7 +24752,7 @@ var GameUrban = (() => {
24570
24752
  };
24571
24753
  const g = EA.foilGeo(
24572
24754
  [
24573
- { p: [1.46, dh(0), 0], c: 1.6, t: 0.12, cam: 0.025, noCap: true },
24755
+ { p: [1.46, dh(0), s * 2e-3], c: 1.6, t: 0.12, cam: 0.025, noCap: true },
24574
24756
  { p: [1.46, dh(2.6), s * 2.6], c: 1.6, t: 0.12, cam: 0.025 },
24575
24757
  { p: [1.46, dh(4.9), s * 4.9], c: 1.6, t: 0.12, cam: 0.025 },
24576
24758
  { p: [1.43, dh(5.18), s * 5.18], c: 1.5, t: 0.11, cam: 0.02 },
@@ -24627,7 +24809,7 @@ var GameUrban = (() => {
24627
24809
  const hs = c.add(
24628
24810
  EA.foilGeo(
24629
24811
  [
24630
- { p: [-2.78, 0.1, 0], c: 0.78, t: 0.07 },
24812
+ { p: [-2.78, 0.1, s * 2e-3], c: 0.78, t: 0.07 },
24631
24813
  { p: [-2.85, 0.1, s * 1.1], c: 0.74, t: 0.07 },
24632
24814
  { p: [-2.95, 0.1, s * 1.36], c: 0.6, t: 0.06 },
24633
24815
  { p: [-3.1, 0.1, s * 1.46], c: 0.32, t: 0.05 }
@@ -24878,7 +25060,7 @@ var GameUrban = (() => {
24878
25060
  EA.sideKeepP(ckP, 0.5, s),
24879
25061
  s > 0 ? lbl("right_flight_deck_window") : lbl("left_flight_deck_window"),
24880
25062
  "tempered",
24881
- { pos: new V3(5.4, 2.25, s * 0.8) }
25063
+ { pos: new V3(5.4, 2.25, s * 0.8), k: 1.0085 }
24882
25064
  );
24883
25065
  fGlass(
24884
25066
  c,
@@ -24932,7 +25114,7 @@ var GameUrban = (() => {
24932
25114
  const w = c.add(
24933
25115
  EA.foilGeo(
24934
25116
  [
24935
- { p: [1.52, dh(0), 0], c: 2.38, t: 0.15, cam: 0.02 },
25117
+ { p: [1.52, dh(0), s * 2e-3], c: 2.38, t: 0.15, cam: 0.02 },
24936
25118
  { p: [1.52, dh(0.86), s * 0.86], c: 2.38, t: 0.15, cam: 0.02 },
24937
25119
  { p: [1.42, dh(2.47), s * 2.47], c: 2.25, t: 0.145, cam: 0.02 },
24938
25120
  { p: [0.98, dh(7.42), s * 7.42], c: 1.4, t: 0.12, cam: 0.02 },
@@ -25067,7 +25249,7 @@ var GameUrban = (() => {
25067
25249
  const hs = c.add(
25068
25250
  EA.foilGeo(
25069
25251
  [
25070
- { p: [-5.95, 2.3, 0], c: 1.55, t: 0.1 },
25252
+ { p: [-5.95, 2.3, s * 2e-3], c: 1.55, t: 0.1 },
25071
25253
  { p: [-6.62, 2.3 + 3.2 * 0.176, s * 3.2], c: 0.86, t: 0.09 }
25072
25254
  ],
25073
25255
  { up: "y", n: 10 }
@@ -25330,7 +25512,7 @@ var GameUrban = (() => {
25330
25512
  const w = c.add(
25331
25513
  EA.foilGeo(
25332
25514
  [
25333
- { p: [1.56, dh(0), 0], c: 1.98, t: 0.15, cam: 0.025, noCap: true },
25515
+ { p: [1.56, dh(0), s * 2e-3], c: 1.98, t: 0.15, cam: 0.025, noCap: true },
25334
25516
  { p: [1.56, dh(3.6), s * 3.6], c: 1.98, t: 0.15, cam: 0.025 },
25335
25517
  { p: [1.38, dh(7.7), s * 7.7], c: 1.3, t: 0.12, cam: 0.02 },
25336
25518
  { p: [1.32, dh(7.94), s * 7.94], c: 1.1, t: 0.06, cam: 0.01 }
@@ -25472,7 +25654,7 @@ var GameUrban = (() => {
25472
25654
  const hs = c.add(
25473
25655
  EA.foilGeo(
25474
25656
  [
25475
- { p: [-4.8, 3.08, 0], c: 1.55, t: 0.1 },
25657
+ { p: [-4.8, 3.08, s * 2e-3], c: 1.55, t: 0.1 },
25476
25658
  { p: [-5.15, 3.08, s * 3.1], c: 1, t: 0.09 }
25477
25659
  ],
25478
25660
  { up: "y", n: 10 }
@@ -25675,7 +25857,7 @@ var GameUrban = (() => {
25675
25857
  EA.sideKeepP(ckP, 0.5, s),
25676
25858
  s > 0 ? lbl("right_flight_deck_side_window") : lbl("left_flight_deck_side_window"),
25677
25859
  "tempered",
25678
- { pos: new V3(3.6, 2, s * 0.78) }
25860
+ { pos: new V3(3.6, 2, s * 0.78), k: 1.0085 }
25679
25861
  );
25680
25862
  fGlass(
25681
25863
  c,
@@ -25703,7 +25885,7 @@ var GameUrban = (() => {
25703
25885
  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
25886
  }),
25705
25887
  MT.dark,
25706
- { k: 1.003 }
25888
+ { k: 1.0065 }
25707
25889
  );
25708
25890
  void dF;
25709
25891
  EA.fuseSkin(
@@ -25713,7 +25895,7 @@ var GameUrban = (() => {
25713
25895
  return Math.min(0.035 - Math.abs(x - 3.88 - (y - 1.75) * 0.5), y - 1.7, 2.42 - y);
25714
25896
  }),
25715
25897
  blk,
25716
- { k: 1.004 }
25898
+ { k: 1.0065 }
25717
25899
  );
25718
25900
  c.rod(new V3(5, 1.74, 0), new V3(4.05, 2.4, 0), 0.02, blk);
25719
25901
  const fl = 0.8, fab = CM("#c9bda6", { roughness: 0.75 });
@@ -25752,7 +25934,7 @@ var GameUrban = (() => {
25752
25934
  const w = c.add(
25753
25935
  EA.foilGeo(
25754
25936
  [
25755
- { p: [1, dh(0), 0], c: 2.45, t: 0.14, cam: 0.02 },
25937
+ { p: [1, dh(0), s * 2e-3], c: 2.45, t: 0.14, cam: 0.02 },
25756
25938
  { p: [0.95, dh(0.85), s * 0.85], c: 2.42, t: 0.14, cam: 0.02 },
25757
25939
  { p: [0.55, dh(2.4), s * 2.4], c: 1.9, t: 0.13, cam: 0.02 },
25758
25940
  { p: [-0.32, dh(5.75), s * 5.75], c: 1.08, t: 0.11, cam: 0.02 },
@@ -25834,7 +26016,7 @@ var GameUrban = (() => {
25834
26016
  const finB = c.add(
25835
26017
  EA.foilGeo(
25836
26018
  [
25837
- { p: [-3.89, 2.25, 0], c: 2.22, t: 0.115 },
26019
+ { p: [-3.89, 2.253, 0], c: 2.22, t: 0.115 },
25838
26020
  { p: [-5.34, 4.185, 0], c: 1.17, t: 0.105 }
25839
26021
  ],
25840
26022
  { up: "z", n: 10 }
@@ -25857,7 +26039,7 @@ var GameUrban = (() => {
25857
26039
  const hs = c.add(
25858
26040
  EA.foilGeo(
25859
26041
  [
25860
- { p: [-5.3, 4.2, 0], c: 1.18, t: 0.1 },
26042
+ { p: [-5.3, 4.2, s * 2e-3], c: 1.18, t: 0.1 },
25861
26043
  { p: [-5.9, 4.24, s * 2.55], c: 0.62, t: 0.09 }
25862
26044
  ],
25863
26045
  { up: "y", n: 10 }
@@ -26119,7 +26301,7 @@ var GameUrban = (() => {
26119
26301
  [1, -1].forEach(function(s) {
26120
26302
  const g = EA.foilGeo(
26121
26303
  [
26122
- { p: [1.52, dh(0), 0], c: 2.35, t: 0.15, cam: 0.02 },
26304
+ { p: [1.52, dh(0), s * 2e-3], c: 2.35, t: 0.15, cam: 0.02 },
26123
26305
  { p: [1.5, dh(0.48), s * 0.48], c: 2.32, t: 0.15, cam: 0.02 },
26124
26306
  { p: [0.78, dh(5.4), s * 5.4], c: 1.2, t: 0.12, cam: 0.02 },
26125
26307
  { p: [0.74, dh(5.57), s * 5.57], c: 1.1, t: 0.07, cam: 0.01 }
@@ -26224,7 +26406,7 @@ var GameUrban = (() => {
26224
26406
  [1, -1].forEach(function(s) {
26225
26407
  const g = EA.foilGeo(
26226
26408
  [
26227
- { p: [-4.3, 1.72, 0], c: 1.3, t: 0.1 },
26409
+ { p: [-4.3, 1.72, s * 2e-3], c: 1.3, t: 0.1 },
26228
26410
  { p: [-4.72, 1.76, s * 2.2], c: 0.75, t: 0.09 }
26229
26411
  ],
26230
26412
  { up: "y", n: 10 }
@@ -26485,7 +26667,7 @@ var GameUrban = (() => {
26485
26667
  const fl = c.roundBox(L, 0.035, 2 * hw, 0.01, LINER, cx, o.floor, 0);
26486
26668
  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
26669
  [1, -1].forEach(function(s) {
26488
- c.roundBox(L, h, 0.025, 0.01, LINER, cx, o.floor + h / 2, s * (hw + 0.012));
26670
+ c.roundBox(L - 8e-3, h, 0.025, 0.01, LINER, cx, o.floor + h / 2, s * (hw + 0.012));
26489
26671
  });
26490
26672
  c.roundBox(0.025, h, 2 * hw, 0.01, LINER, o.x0 + 0.012, o.floor + h / 2, 0);
26491
26673
  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 +27563,10 @@ var GameUrban = (() => {
27381
27563
  pre: function(c2, _m) {
27382
27564
  const gx = fX(s, 0.82) - 0.012, gy = 0.82, gh = 0.46, gw = 1.08, tz = 0.8;
27383
27565
  c2.roundBox(0.05, gh, gw, 0.04, MT.chrome, gx, gy, 0, { taper: { sz: tz } });
27384
- c2.roundBox(0.056, gh - 0.1, gw - 0.16, 0.02, GLOSS, gx + 2e-3, gy, 0, { taper: { sz: tz - 0.02 } });
27566
+ c2.roundBox(0.058, gh - 0.1, gw - 0.16, 0.02, GLOSS, gx + 2e-3, gy, 0, { taper: { sz: tz - 0.02 } });
27385
27567
  [0.13, 0.045, -0.04, -0.125].forEach(function(dy) {
27386
27568
  const k = (dy + gh / 2 - 0.05) / (gh - 0.1);
27387
- c2.roundBox(0.06, 0.022, (gw - 0.2) * (1 + (tz - 1) * k), 8e-3, MT.chrome, gx + 4e-3, gy + dy, 0);
27569
+ c2.roundBox(0.066, 0.022, (gw - 0.2) * (1 + (tz - 1) * k), 8e-3, MT.chrome, gx + 4e-3, gy + dy, 0);
27388
27570
  });
27389
27571
  c2.roundBox(0.04, 0.04, 1.32, 0.015, MT.chrome, fX(s, 1.04) - 0.03, 1.04, 0);
27390
27572
  kit.emblem(c2, fX(s, 0.9) + 0.03, 0.9, 0, 0.06);
@@ -27720,9 +27902,9 @@ var GameUrban = (() => {
27720
27902
  pre: function(c2, _m) {
27721
27903
  const gx = fX(s, 0.8) - 0.012, gy = 0.8, gw = 1.14, gh = 0.52;
27722
27904
  c2.roundBox(0.05, gh, gw, 0.04, MT.chrome, gx, gy, 0, { taper: { sz: 0.84 } });
27723
- c2.roundBox(0.056, gh - 0.12, gw - 0.16, 0.02, GLOSS, gx + 2e-3, gy - 0.01, 0, { taper: { sz: 0.82 } });
27905
+ 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
27906
  [0.12, -0.02, -0.14].forEach(function(dy) {
27725
- c2.roundBox(0.06, 0.03, (gw - 0.22) * (1 - (dy + 0.2) * 0.4), 0.01, MT.housing, gx + 4e-3, gy + dy, 0);
27907
+ 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
27908
  });
27727
27909
  c2.roundBox(0.04, 0.05, 1.3, 0.02, MT.chrome, fX(s, 1.04) - 0.03, 1.04, 0);
27728
27910
  kit.emblem(c2, gx + 0.035, gy + 0.06, 0, 0.06);
@@ -27888,7 +28070,7 @@ var GameUrban = (() => {
27888
28070
  wg.add(bolt);
27889
28071
  }
27890
28072
  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.034, 14), MT.hole);
28073
+ 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
28074
  hole.rotation.x = PI / 2;
27893
28075
  hole.position.set(Math.cos(sa) * rr * 0.58, Math.sin(sa) * rr * 0.58, fz + zs * 2e-3);
27894
28076
  wg.add(hole);
@@ -27917,7 +28099,7 @@ var GameUrban = (() => {
27917
28099
  c.rod(new V3(0.6, 2.8, sd * 0.78), new V3(-0.25, 2.8, sd * 0.78), 0.035, red);
27918
28100
  });
27919
28101
  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.035, red);
28102
+ c.rod(new V3(-0.25, 2.8, -0.78), new V3(-0.25, 2.8, 0.78), 0.032, red);
27921
28103
  c.rod(new V3(-0.25, 2.3, -0.8), new V3(-0.25, 2.8, 0.78), 0.03, red);
27922
28104
  const roofItems = [c.roundBox(0.16, 0.05, 1.3, 0.02, MT.trim, 0.42, m.top + 0.08, 0)];
27923
28105
  [-0.48, -0.16, 0.16, 0.48].forEach(function(z) {
@@ -28498,8 +28680,8 @@ var GameUrban = (() => {
28498
28680
  );
28499
28681
  const zz = sd * (kit.halfAt(W, m.tumble, 1.75) + 0.012), zt = sd * (kit.halfAt(W, m.tumble, 2.22) + 0.012);
28500
28682
  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] });
28683
+ [0, PI / 3, -PI / 3].forEach(function(a, i) {
28684
+ 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
28685
  });
28504
28686
  });
28505
28687
  if (c2.hood) {
@@ -28849,9 +29031,31 @@ var GameUrban = (() => {
28849
29031
  if (o.col) colorize(g, o.col);
28850
29032
  return g;
28851
29033
  }
29034
+ function stretchEnds(st, by) {
29035
+ const out = st.map(function(q) {
29036
+ return q.slice();
29037
+ });
29038
+ const last = out.length - 1;
29039
+ const dir = out[last][0] >= out[0][0] ? 1 : -1;
29040
+ out[0][0] = out[0][0] - dir * by;
29041
+ out[last][0] = out[last][0] + dir * by;
29042
+ return out;
29043
+ }
29044
+ const paneCount = /* @__PURE__ */ new WeakMap();
29045
+ function nextPaneScale(c) {
29046
+ const n = paneCount.get(c) ?? 0;
29047
+ paneCount.set(c, n + 1);
29048
+ return 0.988 - 35e-4 * (n % 4);
29049
+ }
29050
+ const skinCount = /* @__PURE__ */ new WeakMap();
29051
+ function nextSkinScale(c) {
29052
+ const n = skinCount.get(c) ?? 0;
29053
+ skinCount.set(c, n + 1);
29054
+ return 1.004 + 25e-4 * (n % 3);
29055
+ }
28852
29056
  function fuseGlass(c, st, keep, label, type, o) {
28853
29057
  o = o || {};
28854
- const k = o.k || 0.988;
29058
+ const k = o.k || nextPaneScale(c);
28855
29059
  const st2 = st.map(function(s) {
28856
29060
  const cy = (s[1] + s[2]) / 2, hh = (s[2] - s[1]) / 2 * k;
28857
29061
  return [s[0], cy - hh, cy + hh, s[3] * k, s[4], s[5]];
@@ -28864,12 +29068,12 @@ var GameUrban = (() => {
28864
29068
  }
28865
29069
  function fuseSkin(c, st, keep, mat, o) {
28866
29070
  o = o || {};
28867
- const k = o.k || 1.004;
29071
+ const k = o.k || nextSkinScale(c);
28868
29072
  const st2 = st.map(function(s) {
28869
29073
  const cy = (s[1] + s[2]) / 2, hh = (s[2] - s[1]) / 2 * k;
28870
29074
  return [s[0], cy - hh, cy + hh, s[3] * k, s[4], s[5]];
28871
29075
  });
28872
- const m = c.add(fuseGeo(st2, { smooth: o.smooth || 48, seg: o.seg || 30 }), mat, 0, 0, 0, o.parent);
29076
+ const m = c.add(fuseGeo(stretchEnds(st2, -3e-3), { smooth: o.smooth || 48, seg: o.seg || 30 }), mat, 0, 0, 0, o.parent);
28873
29077
  m.castShadow = false;
28874
29078
  kit.cutMesh(m, [keep], 40);
28875
29079
  c.deform.push(m);
@@ -29140,7 +29344,7 @@ var GameUrban = (() => {
29140
29344
  }
29141
29345
  ;
29142
29346
  (o.screens || []).forEach(function(s) {
29143
- const sc = c.roundBox(0.012, s[2], s[3], 8e-3, MT.screen, x - 0.085, y + s[0], s[1]);
29347
+ const sc = c.roundBox(0.012, s[2], s[3], 8e-3, MT.screen, x - 0.091, y + s[0], s[1]);
29144
29348
  sc.castShadow = false;
29145
29349
  });
29146
29350
  }
@@ -29180,7 +29384,7 @@ var GameUrban = (() => {
29180
29384
  );
29181
29385
  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
29386
  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 - 0.01, 0, P);
29387
+ c.roundBox(0.36 * k, 0.018, 0.2 * k, 8e-3, low, -0.17 * k, -shaft - 6e-3, 0, P);
29184
29388
  c.cylinder(0.055 * k, 0.05 * k, 0.32 * k, low, -0.2 * k, -shaft - 0.09 * k, 0, "x", P);
29185
29389
  c.roundBox(0.16 * k, 0.12 * k, 0.025, 0.01, low, -0.18 * k, -shaft - 0.17 * k, 0, P);
29186
29390
  const pr = propeller(c, -0.38 * k, -shaft - 0.09 * k, 0, {
@@ -29212,7 +29416,11 @@ var GameUrban = (() => {
29212
29416
  function skinOf(c, mesh, keep, mat, o) {
29213
29417
  o = o || {};
29214
29418
  const g = mesh.geometry.clone(), p = g.attributes.position, sz = o.sz || 1.006, dy = o.dy || 0;
29419
+ let reach = 0;
29420
+ for (let i = 0; i < p.count; i++) reach = Math.max(reach, Math.abs(p.getX(i)));
29421
+ const sx = o.ends === false ? 1 : 1 - 3e-3 / (reach || 1);
29215
29422
  for (let i = 0; i < p.count; i++) {
29423
+ p.setX(i, p.getX(i) * sx);
29216
29424
  p.setZ(i, p.getZ(i) * sz);
29217
29425
  p.setY(i, p.getY(i) + dy * Math.sign(p.getY(i)));
29218
29426
  }
@@ -29326,6 +29534,8 @@ var GameUrban = (() => {
29326
29534
  foilGeo,
29327
29535
  fuseGeo,
29328
29536
  fuseGlass,
29537
+ nextPaneScale,
29538
+ nextSkinScale,
29329
29539
  fuseSkin,
29330
29540
  bandT,
29331
29541
  cutT,
@@ -29474,7 +29684,7 @@ var GameUrban = (() => {
29474
29684
  const tank = c.roundBox(0.48, 0.24, 0.3, 0.06, CM("#a3241c", { roughness: 0.5 }), -2.05, 0.06, -0.38);
29475
29685
  c.rod(new V3(-2, 0.18, -0.38), new V3(-2.3, 0.4, -0.1), 0.01, CM("#1b1b1b"));
29476
29686
  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, 0, 0.5, { rot: [0.3, 0, 0] });
29687
+ c.roundBox(0.35, 0.03, 0.14, 0.02, MT.wood, 0.45, 4e-3, 0.5, { rot: [0.3, 0, 0] });
29478
29688
  c.rod(new V3(-2.35, 0.42, 0.6), new V3(-2.35, 1.1, 0.6), 0.012, MT.chrome);
29479
29689
  EA.navLight(c, -2.35, 1.13, 0.6, "white", trl("labels.stern_light_mast"), { r: 0.035 });
29480
29690
  EA.navLight(c, 2.3, 0.53, 0.06, "green", trl("labels.starboard_bow_light_green"), { r: 0.03 });
@@ -29651,7 +29861,7 @@ var GameUrban = (() => {
29651
29861
  c.roundBox(2.3, 0.22, 0.5, 0.07, vinyl, -2.3, 0.45, s * 0.75);
29652
29862
  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
29863
  });
29654
- c.roundBox(0.5, 0.22, 1.5, 0.07, vinyl, -3.35, 0.45, 0);
29864
+ c.roundBox(0.5, 0.22, 1.5, 0.07, vinyl, -3.35, 0.453, 0);
29655
29865
  c.roundBox(0.12, 0.42, 2.1, 0.05, vinyl, -3.52, 0.74, 0);
29656
29866
  c.seatTops.push(
29657
29867
  { x: -2.3, y: 0.57, z: 0.75, w: 0.5, l: 2.2 },
@@ -29659,8 +29869,8 @@ var GameUrban = (() => {
29659
29869
  { x: 2, y: 0.57, z: 0, w: 1.2, l: 0.9 }
29660
29870
  );
29661
29871
  const cy = 0.22;
29662
- c.roundBox(0.85, 0.72, 0.78, 0.12, white, 0.75, cy + 0.36, 0.72);
29663
- c.roundBox(0.85, 0.72, 0.72, 0.12, white, 0.75, cy + 0.36, -0.74);
29872
+ c.roundBox(0.85, 0.72, 0.78, 0.12, white, 0.75, cy + 0.362, 0.72);
29873
+ c.roundBox(0.85, 0.72, 0.72, 0.12, white, 0.75, cy + 0.362, -0.74);
29664
29874
  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
29875
  [0.55, 0.72, 0.89].forEach(function(z, i) {
29666
29876
  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 +29881,8 @@ var GameUrban = (() => {
29671
29881
  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
29882
  c.rod(new V3(0.55, cy + 0.7, 0.98), new V3(0.42, cy + 0.88, 1), 0.015, MT.chrome);
29673
29883
  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 });
29884
+ 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 });
29885
+ 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
29886
  [1, -1].forEach(function(s) {
29677
29887
  const pts = [];
29678
29888
  for (let i = 0; i <= 8; i++) {
@@ -29894,7 +30104,7 @@ var GameUrban = (() => {
29894
30104
  [1.6, -0.55],
29895
30105
  [1.95, -1]
29896
30106
  ].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.12, q[1]);
30107
+ 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
30108
  });
29899
30109
  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
30110
  const cutF = {
@@ -29983,11 +30193,11 @@ var GameUrban = (() => {
29983
30193
  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
30194
  }
29985
30195
  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 });
30196
+ kit.seat(c, hx - 0.05, hy0 + 2e-3, 0, { w: 0.5, h: 0.55, back: 0.45, mat: inner2, headrest: false });
29987
30197
  c.roundBox(1.8, 0.12, 0.65, 0.04, CM("#7c5a3b"), hx - 0.2, hy0 + 0.5, -0.72);
29988
30198
  c.roundBox(1.7, 0.08, 0.55, 0.04, CM("#6b7c8f", { roughness: 1 }), hx - 0.2, hy0 + 0.6, -0.72);
29989
30199
  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.6, 0.65);
30200
+ c.cylinder(0.1, 0.1, 1.2, MT.trim, hx - 0.75, hy0 + hh + 0.596, 0.65);
29991
30201
  c.cylinder(0.13, 0.1, 0.1, MT.trim, hx - 0.75, hy0 + hh + 1.22, 0.65);
29992
30202
  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
30203
  EA.navLight(c, hx + 0.4, hy0 + hh + 1.65, 0, "white", trl("labels.masthead_light"), { r: 0.05 });
@@ -30088,7 +30298,7 @@ var GameUrban = (() => {
30088
30298
  const EA = shared.EA, white = "#ecebe6";
30089
30299
  const paintW = c.paint(white);
30090
30300
  const ST = [
30091
- [2.3, 0.98, 1.46, 0.7, 2.4],
30301
+ [2.297, 0.98, 1.46, 0.7, 2.4],
30092
30302
  [2.15, 0.88, 1.55, 0.92, 2.6],
30093
30303
  [1.85, 0.8, 1.61, 1.02, 2.8],
30094
30304
  [1.45, 0.72, 1.65, 1.08, 3],
@@ -30217,7 +30427,7 @@ var GameUrban = (() => {
30217
30427
  };
30218
30428
  const g = EA.foilGeo(
30219
30429
  [
30220
- { p: [0.66, dh(0), 0], c: 1.63, t: 0.12, cam: 0.02 },
30430
+ { p: [0.66, dh(0), s * 2e-3], c: 1.63, t: 0.12, cam: 0.02 },
30221
30431
  { p: [0.66, dh(2.6), s * 2.6], c: 1.63, t: 0.12, cam: 0.02 },
30222
30432
  { p: [0.62, dh(5.2), s * 5.2], c: 1.14, t: 0.11, cam: 0.02 },
30223
30433
  { p: [0.58, dh(5.5) + 0.02, s * 5.5], c: 0.98, t: 0.06, cam: 0.01 }
@@ -30256,7 +30466,7 @@ var GameUrban = (() => {
30256
30466
  const hs = c.add(
30257
30467
  EA.foilGeo(
30258
30468
  [
30259
- { p: [-4.6, 1.42, 0], c: 1.2, t: 0.09 },
30469
+ { p: [-4.6, 1.42, s * 2e-3], c: 1.2, t: 0.09 },
30260
30470
  { p: [-4.95, 1.42, s * 1.72], c: 0.86, t: 0.08 }
30261
30471
  ],
30262
30472
  { up: "y", n: 10 }
@@ -30507,7 +30717,7 @@ var GameUrban = (() => {
30507
30717
  const w = c.add(
30508
30718
  EA.foilGeo(
30509
30719
  [
30510
- { p: [1.18, dh(0), 0], c: 1.71, t: 0.15, cam: 0.02 },
30720
+ { p: [1.18, dh(0), s * 2e-3], c: 1.71, t: 0.15, cam: 0.02 },
30511
30721
  { p: [1.18, dh(5.6), s * 5.6], c: 1.71, t: 0.14, cam: 0.02 },
30512
30722
  { p: [1.12, dh(5.84) + 0.02, s * 5.84], c: 1.55, t: 0.07, cam: 0.01 }
30513
30723
  ],
@@ -30541,7 +30751,7 @@ var GameUrban = (() => {
30541
30751
  const hs = c.add(
30542
30752
  EA.foilGeo(
30543
30753
  [
30544
- { p: [-2.95, 0.36, 0], c: 0.95, t: 0.09 },
30754
+ { p: [-2.95, 0.36, s * 2e-3], c: 0.95, t: 0.09 },
30545
30755
  { p: [-3.05, 0.36, s * 1.8], c: 0.8, t: 0.08 }
30546
30756
  ],
30547
30757
  { up: "y", n: 10 }
@@ -30573,8 +30783,8 @@ var GameUrban = (() => {
30573
30783
  const finB = c.add(
30574
30784
  EA.foilGeo(
30575
30785
  [
30576
- { p: [-2.64, 0.42, 0], c: 1.27, t: 0.11 },
30577
- { p: [-3.24, 1.85, 0], c: 0.74, t: 0.1 }
30786
+ { p: [-2.64, 0.424, 0], c: 1.27, t: 0.11 },
30787
+ { p: [-3.24, 1.853, 0], c: 0.74, t: 0.1 }
30578
30788
  ],
30579
30789
  { up: "z", n: 10 }
30580
30790
  ),
@@ -30844,10 +31054,11 @@ var GameUrban = (() => {
30844
31054
  EA.sideKeepP(fdP, 0.35, s),
30845
31055
  s > 0 ? lbl("front_right_door_window") : lbl("front_left_door_window"),
30846
31056
  "tempered",
30847
- { pos: new V3(0.4, 1.5, s * 0.64) }
31057
+ { pos: new V3(0.4, 1.5, s * 0.64), k: 0.988 }
30848
31058
  );
30849
31059
  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)
31060
+ pos: new V3(-0.5, 1.5, s * 0.63),
31061
+ k: 0.988
30851
31062
  });
30852
31063
  const df = EA.polySdf([
30853
31064
  [0.78, 0.72],
@@ -30943,7 +31154,7 @@ var GameUrban = (() => {
30943
31154
  const hs = c.add(
30944
31155
  EA.foilGeo(
30945
31156
  [
30946
- { p: [-5.25, 1.76, 0], c: 0.45, t: 0.1 },
31157
+ { p: [-5.25, 1.76, s * 2e-3], c: 0.45, t: 0.1 },
30947
31158
  { p: [-5.32, 1.76, s * 0.62], c: 0.34, t: 0.09 }
30948
31159
  ],
30949
31160
  { up: "y", n: 8 }
@@ -31271,7 +31482,7 @@ var GameUrban = (() => {
31271
31482
  const hs = c.add(
31272
31483
  EA.foilGeo(
31273
31484
  [
31274
- { p: [-5.3, 1.98, 0], c: 0.6, t: 0.11 },
31485
+ { p: [-5.3, 1.98, s * 2e-3], c: 0.6, t: 0.11 },
31275
31486
  { p: [-5.38, 1.98, s * 1], c: 0.52, t: 0.1 }
31276
31487
  ],
31277
31488
  { up: "y", n: 8 }
@@ -31469,7 +31680,10 @@ var GameUrban = (() => {
31469
31680
  hasSunroof: (key) => !!options.sunroofs?.includes(key),
31470
31681
  register(spec, build) {
31471
31682
  if (!groups.has(spec.group) || only && !only.has(spec.key) || skip.has(spec.key)) return;
31472
- kit.register({ ...spec, seedKey: legacyVehicleSeeds[spec.key] }, build);
31683
+ kit.register({ ...spec, seedKey: legacyVehicleSeeds[spec.key] }, (context, vehicleKit) => {
31684
+ build(context, vehicleKit);
31685
+ separateSpokes(context);
31686
+ });
31473
31687
  }
31474
31688
  };
31475
31689
  }