@adatechnology/game-weapons-three 0.30.0 → 0.30.1

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.
@@ -19481,13 +19481,16 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
19481
19481
  for (const u of Object.values(uniforms)) if (isTexture(u?.value)) out.add(u.value);
19482
19482
  }
19483
19483
  }
19484
+ var isInstanced = (o) => o.isInstancedMesh === true;
19484
19485
  function collect(roots) {
19485
19486
  const geometries = /* @__PURE__ */ new Set();
19486
19487
  const materials = /* @__PURE__ */ new Set();
19487
19488
  const textures = /* @__PURE__ */ new Set();
19488
19489
  const skeletons = /* @__PURE__ */ new Set();
19490
+ const instanced = /* @__PURE__ */ new Set();
19489
19491
  for (const root of roots) {
19490
19492
  root.traverse((object2) => {
19493
+ if (isInstanced(object2)) instanced.add(object2);
19491
19494
  const o = object2;
19492
19495
  if (o.geometry && typeof o.geometry.dispose === "function") geometries.add(o.geometry);
19493
19496
  if (o.skeleton && typeof o.skeleton.dispose === "function") skeletons.add(o.skeleton);
@@ -19499,7 +19502,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
19499
19502
  }
19500
19503
  });
19501
19504
  }
19502
- return { geometries, materials, textures, skeletons };
19505
+ return { geometries, materials, textures, skeletons, instanced };
19503
19506
  }
19504
19507
  var marked = /* @__PURE__ */ new WeakSet();
19505
19508
  function markShared(...resources) {
@@ -19548,6 +19551,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
19548
19551
  report.textures++;
19549
19552
  }
19550
19553
  for (const s of found.skeletons) s.dispose();
19554
+ for (const mesh3 of found.instanced) mesh3.dispose();
19551
19555
  return report;
19552
19556
  }
19553
19557
  function discardObject3D(objects, options = {}) {
@@ -21909,7 +21913,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
21909
21913
  };
21910
21914
  var JOINT_GAP = 1e-4;
21911
21915
  var MIN_BEARING_SHARE = 0.25;
21912
- var unsupportedCells = (cells, thin, dims, standing) => {
21916
+ var unsupportedCells = (cells, thin, dims, standing, bears) => {
21913
21917
  if (thin === 1) return unheldSlabCells(cells, dims, standing);
21914
21918
  const [u, v] = planeAxes(thin);
21915
21919
  const bottom = -dims[v] / 2;
@@ -21927,6 +21931,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
21927
21931
  const held = /* @__PURE__ */ new Set();
21928
21932
  const queue = [];
21929
21933
  for (const i of rows.get(0) ?? []) {
21934
+ if (bears && !bears(i)) continue;
21930
21935
  held.add(i);
21931
21936
  queue.push(i);
21932
21937
  }
@@ -23281,19 +23286,31 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
23281
23286
  var clampNumber = (v, a, b) => Math.max(a, Math.min(b, v));
23282
23287
  var settlementAt = (settlement, point) => {
23283
23288
  const d = [settlement.to[0] - settlement.from[0], settlement.to[1] - settlement.from[1], settlement.to[2] - settlement.from[2]];
23289
+ const px = point[0] - settlement.from[0];
23290
+ const py = point[1] - settlement.from[1];
23291
+ const pz = point[2] - settlement.from[2];
23284
23292
  const length2 = d[0] * d[0] + d[1] * d[1] + d[2] * d[2];
23285
- const t = length2 > 0 ? clampNumber(((point[0] - settlement.from[0]) * d[0] + (point[1] - settlement.from[1]) * d[1] + (point[2] - settlement.from[2]) * d[2]) / length2, 0, 1) : 0;
23293
+ const along3 = length2 > 0 ? (px * d[0] + py * d[1] + pz * d[2]) / length2 : 0;
23294
+ const t = clampNumber(along3, 0, 1);
23286
23295
  const drops = settlement.drop;
23287
23296
  if (drops.length === 0) return 0;
23288
23297
  const at4 = t * (drops.length - 1);
23289
23298
  const i = Math.floor(at4);
23290
23299
  const j = Math.min(drops.length - 1, i + 1);
23291
- return drops[i] + (drops[j] - drops[i]) * (at4 - i);
23300
+ const f = at4 - i;
23301
+ const drop = drops[i] + (drops[j] - drops[i]) * f;
23302
+ const turn2 = settlement.turn;
23303
+ if (!turn2 || turn2.length !== drops.length) return drop;
23304
+ const a = turn2[i];
23305
+ const b = turn2[j];
23306
+ const armX = px - d[0] * along3;
23307
+ const armZ = pz - d[2] * along3;
23308
+ return drop - ((a[2] + (b[2] - a[2]) * f) * armX - (a[0] + (b[0] - a[0]) * f) * armZ);
23292
23309
  };
23293
23310
  var mergeSettlement = (old, next) => {
23294
23311
  if (!old) return next;
23295
23312
  const same = old.from.every((v, k) => Math.abs(v - next.from[k]) < 1e-6) && old.to.every((v, k) => Math.abs(v - next.to[k]) < 1e-6);
23296
- if (same && old.drop.length === next.drop.length) return { from: old.from, to: old.to, drop: old.drop.map((v, k) => Math.max(v, next.drop[k])) };
23313
+ if (same && old.drop.length === next.drop.length && !old.turn && !next.turn) return { from: old.from, to: old.to, drop: old.drop.map((v, k) => Math.max(v, next.drop[k])) };
23297
23314
  const mean = (line) => line.drop.reduce((sum2, v) => sum2 + v, 0) / Math.max(1, line.drop.length);
23298
23315
  return mean(old) >= mean(next) ? old : next;
23299
23316
  };
@@ -24025,7 +24042,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
24025
24042
  tearJoules: 80
24026
24043
  }
24027
24044
  },
24028
- failureMPa: 40
24045
+ failureMPa: 40,
24046
+ elastic: {
24047
+ alongGPa: 6.96,
24048
+ shearGPa: 0.44
24049
+ }
24029
24050
  },
24030
24051
  {
24031
24052
  id: "mdf",
@@ -24072,7 +24093,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
24072
24093
  tearJoules: 20
24073
24094
  }
24074
24095
  },
24075
- failureMPa: 25
24096
+ failureMPa: 25,
24097
+ elastic: {
24098
+ alongGPa: 3,
24099
+ shearGPa: 0.8
24100
+ }
24076
24101
  },
24077
24102
  {
24078
24103
  id: "glass",
@@ -25613,17 +25638,18 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
25613
25638
  const index = shape.placeOf(i, j);
25614
25639
  k[index] = k[index] + value;
25615
25640
  }
25616
- function halfQuadratic(shape, k, x) {
25641
+ function multiply2(shape, k, x, out) {
25617
25642
  const { n, start, rows } = shape;
25618
- let total = 0;
25643
+ for (let j = 0; j < n; j++) out[j] = k[j] * x[j];
25619
25644
  for (let j = 0; j < n; j++) {
25620
25645
  const xj = x[j];
25621
- if (xj === 0) continue;
25622
- let column = 0.5 * k[j] * xj;
25623
- for (let p = start[j]; p < start[j + 1]; p++) column += k[n + p] * x[rows[p]];
25624
- total += xj * column;
25646
+ for (let p = start[j]; p < start[j + 1]; p++) {
25647
+ const i = rows[p];
25648
+ const value = k[n + p];
25649
+ out[i] = out[i] + value * xj;
25650
+ out[j] = out[j] + value * x[i];
25651
+ }
25625
25652
  }
25626
- return total;
25627
25653
  }
25628
25654
  function factor(shape, k, from, to) {
25629
25655
  const { n, start, rows, beforeStart, before } = shape;
@@ -25677,7 +25703,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
25677
25703
  placeOf: (i, j) => placeOf(shape, i, j),
25678
25704
  factor: (k, from, to) => factor(shape, k, from, to),
25679
25705
  substitute: (k, f) => substitute(shape, k, f),
25680
- halfQuadratic: (k, x) => halfQuadratic(shape, k, x)
25706
+ multiply: (k, x, out) => multiply2(shape, k, x, out)
25681
25707
  };
25682
25708
  };
25683
25709
  function hullOf(points) {
@@ -25865,14 +25891,15 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
25865
25891
  const delta = new Float64Array(n);
25866
25892
  for (let i = 0; i < n; i++) delta[i] = after2.u[i] - before.u[i];
25867
25893
  for (const beam of beams.values()) if (!after2.standing.has(beam.part.id)) for (const node of beam.nodes) for (const dof of dofsOf(node)) delta[dof] = 0;
25868
- const potential = (x) => {
25869
- let height = 0;
25870
- for (let i = 0; i < n; i++) height += after2.load[i] * x[i];
25871
- return frame2.shape.halfQuadratic(after2.structure, x) - height;
25872
- };
25873
- const had = new Float64Array(n);
25874
- for (let i = 0; i < n; i++) had[i] = after2.u[i] - delta[i];
25875
- released = Math.max(0, potential(had) - potential(after2.u));
25894
+ const d = new Float64Array(n);
25895
+ for (let i = 0; i < n; i++) d[i] = -delta[i];
25896
+ const kd = new Float64Array(n);
25897
+ frame2.shape.multiply(after2.structure, d, kd);
25898
+ const ku = new Float64Array(n);
25899
+ frame2.shape.multiply(after2.structure, after2.u, ku);
25900
+ let change = 0;
25901
+ for (let i = 0; i < n; i++) change += d[i] * (0.5 * kd[i] + (ku[i] - after2.load[i]));
25902
+ released = Math.max(0, change);
25876
25903
  spin = spinOf({ frame: frame2, after: after2, delta, released, centre: allCentre, mass: all, floor: floor2, g });
25877
25904
  }
25878
25905
  return {
@@ -25896,12 +25923,15 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
25896
25923
  const from = vec.madd(beam.part.position, beam.axis, -beam.length / 2);
25897
25924
  const to = vec.madd(beam.part.position, beam.axis, beam.length / 2);
25898
25925
  const drop = [];
25926
+ const turn2 = [];
25899
25927
  for (let i = 0; i < SAG_STATIONS; i++) {
25900
25928
  const point = vec.madd(from, beam.axis, beam.length * i / (SAG_STATIONS - 1));
25901
25929
  const node = carrier ? carrier.node : nearest(beam, point);
25902
25930
  drop.push(-moved(after2, { part: id, node, arm: vec.sub(point, nodes[node].at), mass: 0 })[1]);
25931
+ const base2 = order2[node] * 6;
25932
+ turn2.push([after2.u[base2 + 3], after2.u[base2 + 4], after2.u[base2 + 5]]);
25903
25933
  }
25904
- return { from, to, drop };
25934
+ return { from, to, drop, turn: turn2 };
25905
25935
  }
25906
25936
  };
25907
25937
  }
@@ -28100,6 +28130,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
28100
28130
  } else emit2({ ...base2(o, src), type: "stage", part: p.spec.id, stage: 2, opening: { center: worldCenter, radius: hole.radius }, fragments });
28101
28131
  debris2(o, p, p.mat.breakDebris, worldCenter, [0, 1, 0], 14, 2, src);
28102
28132
  if (p.spec.reinforcement) exposeRebar(o, p, src);
28133
+ dropOverOpening(o, p, src);
28103
28134
  };
28104
28135
  const distort = (o, q, beta, at4, toward2, src) => {
28105
28136
  const prior = q.rt.distortion ?? 0;
@@ -29341,7 +29372,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
29341
29372
  const faceArea = (cell) => cell.size[u] * cell.size[v];
29342
29373
  const total = cells.reduce((sum2, cell) => sum2 + faceArea(cell), 0) || 1;
29343
29374
  const shape = p.spec.units ? "chunk" : FRAGMENT_SHAPE[p.mat.fracture] ?? "chunk";
29344
- const laid = !!p.spec.units && p.spec.units.mortar !== p.spec.material;
29375
+ const laid2 = !!p.spec.units && p.spec.units.mortar !== p.spec.material;
29345
29376
  const pieces = shape === "shard" && bondedPlate(o, p) ? cells.flatMap((cell) => shardsOfCell(cell, u, v)) : cells;
29346
29377
  return pieces.map((cell, i) => {
29347
29378
  const cw = toWorld(c, q, cell.center);
@@ -29350,7 +29381,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
29350
29381
  const k = speed * (0.6 + 0.8 * rnd2());
29351
29382
  const marks = marksInBox(cell.center, cell.size, void 0, holes);
29352
29383
  const size = [cell.size[0], cell.size[1], cell.size[2]];
29353
- if (laid) for (const a of [u, v]) size[a] = Math.max(size[a] * MIN_UNIT_SHARE, size[a] - MORTAR_JOINT);
29384
+ if (laid2) for (const a of [u, v]) size[a] = Math.max(size[a] * MIN_UNIT_SHARE, size[a] - MORTAR_JOINT);
29354
29385
  return {
29355
29386
  id: `${p.spec.id}#${tag}${i}`,
29356
29387
  part: p.spec.id,
@@ -29363,7 +29394,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
29363
29394
  angularVelocity: bornSpin(cell.size, 8, rnd2),
29364
29395
  mass: mass * faceArea(cell) / total,
29365
29396
  ...marks.length > 0 ? { marks } : {},
29366
- ...inner && laid ? { unit: true } : inner ? { inner } : {}
29397
+ ...inner && laid2 ? { unit: true } : inner ? { inner } : {}
29367
29398
  };
29368
29399
  });
29369
29400
  };
@@ -29774,7 +29805,19 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
29774
29805
  if (p.st.stripped) bars = [...bars, ...stirrups];
29775
29806
  else for (const box5 of [...p.st.chipped ?? [], ...p.rt.bared ?? []]) bars.push(...clipBarsToVolume(stirrups, box5.center, box5.size));
29776
29807
  }
29777
- emit2({ ...base2(o, src), type: "expose", part: p.spec.id, bars: worldBars(o, p, bars) });
29808
+ emit2({ ...base2(o, src), type: "expose", part: p.spec.id, bars: worldBars(o, p, belowCut(p, bars)) });
29809
+ };
29810
+ const belowCut = (p, bars) => {
29811
+ const cut = p.rt.cutThrough;
29812
+ if (cut === void 0) return bars.map(([a, b]) => [a, b]);
29813
+ const height = (x) => p.pos[1] + rotateVec(p.q, x)[1];
29814
+ return bars.flatMap(([a, b]) => {
29815
+ const ha = height(a) - cut, hb = height(b) - cut;
29816
+ if (ha <= 0 && hb <= 0) return [[a, b]];
29817
+ if (ha > 0 && hb > 0) return [];
29818
+ const at4 = vec.add(a, vec.scale(vec.sub(b, a), ha / (ha - hb)));
29819
+ return [ha <= 0 ? [a, at4] : [at4, b]];
29820
+ });
29778
29821
  };
29779
29822
  const openBreach = (o, p, center, total, energy, dir, src) => {
29780
29823
  const [u, v] = planeAxes(p.thin);
@@ -29803,6 +29846,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
29803
29846
  setStage(o, p, 2, { opening: { center: worldCenter, radius }, fragments }, src);
29804
29847
  debris2(o, p, p.mat.breakDebris, worldCenter, vec.scale(dir ?? [0, 1, 0], -1), 14, 3, src);
29805
29848
  dropUnsupported(o, p, src);
29849
+ dropOverOpening(o, p, src);
29806
29850
  const reinforcement = p.spec.reinforcement;
29807
29851
  if (reinforcement) exposeRebar(o, p, src);
29808
29852
  if (p.structural) solveStructure(o);
@@ -30028,6 +30072,28 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
30028
30072
  }
30029
30073
  return false;
30030
30074
  };
30075
+ const bedOverHoles = (o, p, grid) => {
30076
+ const bases = (o.byPart.get(p.spec.id) ?? []).filter((j) => j.bears === "a_on_b" && j.spec.a === p.spec.id && !j.st.open).map((j) => o.parts[j.ib]).filter((q) => !!q.st.opening);
30077
+ if (bases.length === 0) return void 0;
30078
+ const [, v] = planeAxes(p.thin);
30079
+ const bed = [0, 0, 0];
30080
+ return (i) => {
30081
+ const cell = grid[i];
30082
+ bed[0] = cell.center[0];
30083
+ bed[1] = cell.center[1];
30084
+ bed[2] = cell.center[2];
30085
+ bed[v] = cell.center[v] - cell.size[v] / 2;
30086
+ const at4 = toWorld(p.pos, p.q, bed);
30087
+ return !bases.some((q) => insideOpening(o, q, at4));
30088
+ };
30089
+ };
30090
+ const dropOverOpening = (o, q, src) => {
30091
+ for (const j of o.byPart.get(q.spec.id) ?? []) {
30092
+ if (j.bears !== "a_on_b" || j.spec.b !== q.spec.id || j.st.open) continue;
30093
+ const p = o.parts[j.ia];
30094
+ if (p.spec.units && !isLost(p)) dropUnsupported(o, p, src);
30095
+ }
30096
+ };
30031
30097
  const dropUnsupported = (o, p, src) => {
30032
30098
  var _a, _b;
30033
30099
  if (!p.spec.units || p.spec.units.mortar === p.spec.material || p.st.stripped || isLost(p)) return 0;
@@ -30037,7 +30103,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
30037
30103
  const op = p.st.opening ? toLocal(p.pos, p.q, p.st.opening.center) : null;
30038
30104
  const opened = (cell) => !!op && !!p.st.opening && Math.hypot(cell.center[u] - op[u], cell.center[v] - op[v]) <= p.st.opening.radius;
30039
30105
  const castHere = castCells(p);
30040
- const loose = wedgedUnder(o, p, unsupportedCells(grid, p.thin, p.dims, (i) => worn[i] !== -1 && !opened(grid[i]))).filter((i) => !castHere.has(i));
30106
+ const loose = wedgedUnder(o, p, unsupportedCells(grid, p.thin, p.dims, (i) => worn[i] !== -1 && !opened(grid[i]), bedOverHoles(o, p, grid))).filter((i) => !castHere.has(i));
30041
30107
  if (loose.length === 0) return 0;
30042
30108
  for (const i of loose) worn[i] = -1;
30043
30109
  const fallen = loose.map((i) => grid[i]);
@@ -30203,7 +30269,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
30203
30269
  const cell = grid[i];
30204
30270
  return vec.add(p.pos, rotateVec(p.q, cell.center))[1] - (Math.abs(ax[0]) * cell.size[0] + Math.abs(ax[1]) * cell.size[1] + Math.abs(ax[2]) * cell.size[2]) / 2;
30205
30271
  }));
30206
- knockOutUnits(o, p, wp, 0, above2, src, [0, -1, 0], 0, { point: [p.pos[0], floor2, p.pos[2]], normal: [0, 1, 0] });
30272
+ p.rt.cutThrough = floor2;
30273
+ const severed = { point: toWorld(o.st.position, o.st.rotation, [p.pos[0], floor2, p.pos[2]]), normal: rotateVec(o.st.rotation, [0, 1, 0]) };
30274
+ knockOutUnits(o, p, wp, 0, above2, src, [0, -1, 0], 0, severed);
30275
+ exposeRebar(o, p, src);
30207
30276
  };
30208
30277
  const giveAtCut = (o, p, src, cut) => {
30209
30278
  if (!p.spec.reinforcement || !p.spec.units || !p.st.chipped?.length || sectionLoss(p) <= 0) return false;
@@ -46536,6 +46605,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
46536
46605
  material: "glass",
46537
46606
  thickness: 3e-3
46538
46607
  }
46608
+ ],
46609
+ container: {
46610
+ capacityLiters: 0.3
46611
+ },
46612
+ estimated: [
46613
+ "container"
46539
46614
  ]
46540
46615
  },
46541
46616
  {
@@ -46787,8 +46862,17 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
46787
46862
  }
46788
46863
  ],
46789
46864
  estimated: [
46790
- "parts"
46791
- ]
46865
+ "parts",
46866
+ "consumable"
46867
+ ],
46868
+ consumable: {
46869
+ form: "liquid",
46870
+ unit: "ml",
46871
+ amount: 450,
46872
+ dose: 5,
46873
+ emptyKg: 0.03,
46874
+ density: 1.03
46875
+ }
46792
46876
  },
46793
46877
  {
46794
46878
  id: "bleach",
@@ -48278,8 +48362,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
48278
48362
  thickness: 2e-3
48279
48363
  }
48280
48364
  ],
48365
+ container: {
48366
+ capacityLiters: 0.35
48367
+ },
48281
48368
  estimated: [
48282
- "parts"
48369
+ "parts",
48370
+ "container"
48283
48371
  ]
48284
48372
  },
48285
48373
  {
@@ -48426,6 +48514,41 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
48426
48514
  },
48427
48515
  weapon: "brass_knuckles",
48428
48516
  model: "brass_knuckles"
48517
+ },
48518
+ {
48519
+ id: "plunger",
48520
+ category: "tools",
48521
+ kind: "tool",
48522
+ tags: [
48523
+ "cleaning"
48524
+ ],
48525
+ tools: [
48526
+ "plunger"
48527
+ ],
48528
+ size: [
48529
+ 0.14,
48530
+ 0.55,
48531
+ 0.14
48532
+ ],
48533
+ weight: 0.45,
48534
+ stack: 1,
48535
+ shape: "tool",
48536
+ color: 11545120,
48537
+ rarity: "common",
48538
+ finds: {
48539
+ places: [
48540
+ "house",
48541
+ "apartment"
48542
+ ]
48543
+ },
48544
+ parts: [
48545
+ {
48546
+ id: "body",
48547
+ material: "rubber",
48548
+ thickness: 4e-3
48549
+ }
48550
+ ],
48551
+ model: "plunger"
48429
48552
  }
48430
48553
  ];
48431
48554
  var kinds_default = [
@@ -50109,6 +50232,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
50109
50232
  "alicate"
50110
50233
  ]
50111
50234
  },
50235
+ plunger: {
50236
+ created: true,
50237
+ idSource: "decision",
50238
+ sizeSource: "REF",
50239
+ vc3: [
50240
+ "desentupidor"
50241
+ ]
50242
+ },
50112
50243
  adjustable_wrench: {
50113
50244
  ite: "chave_inglesa",
50114
50245
  idSource: "decision",
@@ -53528,6 +53659,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
53528
53659
  "item.toothbrush": "Toothbrush",
53529
53660
  "item.deodorant": "Deodorant",
53530
53661
  "item.toilet_paper": "Toilet paper",
53662
+ "item.plunger": "Toilet plunger",
53531
53663
  "item.towel": "Towel",
53532
53664
  "item.detergent": "Detergent",
53533
53665
  "item.bleach": "Bleach",
@@ -54036,6 +54168,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
54036
54168
  "item.toothbrush": "Escova de dente",
54037
54169
  "item.deodorant": "Desodorante",
54038
54170
  "item.toilet_paper": "Papel higi\xEAnico",
54171
+ "item.plunger": "Desentupidor",
54039
54172
  "item.towel": "Toalha",
54040
54173
  "item.detergent": "Detergente",
54041
54174
  "item.bleach": "\xC1gua sanit\xE1ria",
@@ -54336,7 +54469,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
54336
54469
  },
54337
54470
  toilet: {
54338
54471
  body: { material: "ceramic", joint: "bolt" },
54339
- parts: [["lid", door("plastic", "hinge", "lid")], ["flush_button", { material: "plastic", joint: "clip", piece: "button" }]]
54472
+ parts: [["lid", door("plastic", "hinge", "lid")], ["seat_ring", door("plastic", "hinge", "lid")], ["flush_button", { material: "plastic", joint: "clip", piece: "button" }]]
54340
54473
  },
54341
54474
  wall_socket: { body: { material: "plastic", joint: "screw" }, parts: [] },
54342
54475
  wall_switch: { body: { material: "plastic", joint: "screw" }, parts: [["rocker", { material: "plastic", joint: "clip", piece: "rocker" }]] },
@@ -54505,6 +54638,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
54505
54638
  "prompt.toilet_lid": "Toilet lid",
54506
54639
  "prompt.toilet_lid.open": "Close the lid",
54507
54640
  "prompt.toilet_lid.closed": "Lift the lid",
54641
+ "prompt.toilet_seat": "Toilet seat",
54642
+ "prompt.toilet_seat.open": "Lower the seat",
54643
+ "prompt.toilet_seat.closed": "Lift the seat",
54508
54644
  "prompt.switch": "Light switch",
54509
54645
  "prompt.switch.on": "Switch off",
54510
54646
  "prompt.switch.on.verb": "Switch off",
@@ -54763,6 +54899,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
54763
54899
  "prompt.toilet_lid": "Tampa do vaso",
54764
54900
  "prompt.toilet_lid.open": "Fechar a tampa",
54765
54901
  "prompt.toilet_lid.closed": "Levantar a tampa",
54902
+ "prompt.toilet_seat": "Assento do vaso",
54903
+ "prompt.toilet_seat.open": "Abaixar o assento",
54904
+ "prompt.toilet_seat.closed": "Levantar o assento",
54766
54905
  "prompt.switch": "Interruptor",
54767
54906
  "prompt.switch.on": "Desligar a luz",
54768
54907
  "prompt.switch.on.verb": "Desligar",
@@ -55583,6 +55722,25 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
55583
55722
  }
55584
55723
  ];
55585
55724
  var WALL_PLATE = { width: 0.075, height: 0.12, thickness: 0.012, sink: 5e-3 };
55725
+ var DIRTY_PLATE = 0.8;
55726
+ var DIRTY_CUP = 0.5;
55727
+ var DIRTY_CUTLERY = 0.6;
55728
+ function goodsSize(id) {
55729
+ const item = GOODS_ITEMS.find((candidate) => candidate.id === id);
55730
+ if (!item) throw new Error(`game-interactables-household: the sinks lay "${id}", which the goods catalogue does not have`);
55731
+ return [item.size[0], item.size[1], item.size[2]];
55732
+ }
55733
+ var laid = (type, data) => ({ stack: { type, qty: 1, ...data ? { data } : {} }, size: goodsSize(type) });
55734
+ var DIRTY_DISHES = [
55735
+ laid("plate", { dirt: DIRTY_PLATE }),
55736
+ laid("cup", { dirt: DIRTY_CUP }),
55737
+ laid("cutlery", { dirt: DIRTY_CUTLERY })
55738
+ ];
55739
+ var WASHING_THINGS = [
55740
+ laid("detergent"),
55741
+ laid("sponge"),
55742
+ laid("cup")
55743
+ ];
55586
55744
  var DEFS2 = types_default;
55587
55745
  var HOUSEHOLD_ITEMS = GOODS_ITEMS.filter((item) => GOODS_PROVENANCE[item.id]?.household !== void 0);
55588
55746
  var itemTexts = (locale) => Object.fromEntries(HOUSEHOLD_ITEMS.map((item) => [`item.${item.id}`, GOODS_STRINGS[locale][`item.${item.id}`] ?? item.id]));
@@ -58186,7 +58344,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
58186
58344
  }
58187
58345
  var residentialTower = residentialTowerTemplate();
58188
58346
 
58189
- // ../game-floorplan-three/dist/chunk-3EJGIA6V.js
58347
+ // ../game-floorplan-three/dist/chunk-KOJFBQRC.js
58190
58348
  var __defProp4 = Object.defineProperty;
58191
58349
  var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp4(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
58192
58350
  var __publicField2 = (obj, key2, value) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
@@ -58280,13 +58438,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
58280
58438
  return out;
58281
58439
  }
58282
58440
  function exclusiveBoxes(solids2) {
58283
- const laid = [];
58441
+ const laid2 = [];
58284
58442
  for (const solid2 of solids2) {
58285
58443
  let pieces = [solid2.box];
58286
- for (const before of laid) pieces = pieces.flatMap((piece22) => subtractBox(piece22, before.box));
58287
- for (const box5 of pieces) laid.push({ ...solid2, box: box5 });
58444
+ for (const before of laid2) pieces = pieces.flatMap((piece22) => subtractBox(piece22, before.box));
58445
+ for (const box5 of pieces) laid2.push({ ...solid2, box: box5 });
58288
58446
  }
58289
- return laid;
58447
+ return laid2;
58290
58448
  }
58291
58449
  function outsideBoxes(box5, taken) {
58292
58450
  let pieces = [box5];
@@ -61984,7 +62142,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
61984
62142
  function addSpoil(THREE, parent, trenches, material, site) {
61985
62143
  const heap = new BoxBatch();
61986
62144
  const rects = trenches.map((t) => t.rect);
61987
- const laid = [];
62145
+ const laid2 = [];
61988
62146
  trenches.forEach(({ rect: r }, i) => {
61989
62147
  const others = rects.filter((_, k) => k !== i);
61990
62148
  for (const e of openEdges(r, others, site.solids)) {
@@ -61993,10 +62151,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
61993
62151
  const w = TRENCH.berm.width;
61994
62152
  const heapAt = ox ? [ox > 0 ? x1 + SPOIL_CLEAR : x0 - SPOIL_CLEAR - w, z0, ox > 0 ? x1 + SPOIL_CLEAR + w : x0 - SPOIL_CLEAR, z1] : [x0, oz > 0 ? z1 + SPOIL_CLEAR : z0 - SPOIL_CLEAR - w, x1, oz > 0 ? z1 + SPOIL_CLEAR + w : z0 - SPOIL_CLEAR];
61995
62153
  const onBuilding = [site.footprint, ...site.buildings].some(([bx0, bz0, bx1, bz1]) => heapAt[2] > bx0 - 0.4 && heapAt[0] < bx1 + 0.4 && heapAt[3] > bz0 - 0.4 && heapAt[1] < bz1 + 0.4);
61996
- if (!onBuilding) for (const piece22 of rectMinus(heapAt, [...rects.map((t) => [t[0] - SPOIL_CLEAR, t[1] - SPOIL_CLEAR, t[2] + SPOIL_CLEAR, t[3] + SPOIL_CLEAR]), ...laid])) {
62154
+ if (!onBuilding) for (const piece22 of rectMinus(heapAt, [...rects.map((t) => [t[0] - SPOIL_CLEAR, t[1] - SPOIL_CLEAR, t[2] + SPOIL_CLEAR, t[3] + SPOIL_CLEAR]), ...laid2])) {
61997
62155
  if (Math.min(piece22[2] - piece22[0], piece22[3] - piece22[1]) < TRENCH.berm.crest * 2) continue;
61998
62156
  addHumps(heap, piece22);
61999
- laid.push(piece22);
62157
+ laid2.push(piece22);
62000
62158
  }
62001
62159
  }
62002
62160
  });
@@ -62838,8 +62996,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
62838
62996
  const isBlock = part.assembly === "concrete_block_wall" || part.material === "concrete";
62839
62997
  const coreTh = coreWidthOf(th, unitId);
62840
62998
  for (const r of slivers) chased(batches.mortar, r.a0 + SLIVER_CLEAR, r.y0 + SLIVER_CLEAR, r.a1 - SLIVER_CLEAR, r.y1 - SLIVER_CLEAR, coreTh * 0.98, MORTAR_CHASE_INSET);
62841
- const laid = coursingOf(unitId, getAssembly(part.assembly ?? (isBlock ? "concrete_block_wall" : "brick_wall_plastered"))?.units);
62842
- const coursing = { courseH: laid.courseHeight, unitLen: laid.unitLength, joint: 0.012, courseBase };
62999
+ const laid2 = coursingOf(unitId, getAssembly(part.assembly ?? (isBlock ? "concrete_block_wall" : "brick_wall_plastered"))?.units);
63000
+ const coursing = { courseH: laid2.courseHeight, unitLen: laid2.unitLength, joint: 0.012, courseBase };
62843
63001
  const unit = isBlock ? batches.block : batches.brick;
62844
63002
  for (const r of pieces) {
62845
63003
  unitEnds.length = 0;
@@ -63158,13 +63316,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
63158
63316
  const lintels = beamParts.filter((p) => isLintel(p.id)).map(solidOf).map(toCoreWidth).map(inWall).map((l) => fitLintel(l, beams, columns, wallCores.filter((w) => wallLineOf(w.aabb).alongU !== wallLineOf(l.aabb).alongU))).filter((l) => l !== null);
63159
63317
  for (const l of lintels) addStageBox(THREE, masonry, l.aabb[0], l.y0, l.aabb[1], l.aabb[2], l.y1, l.aabb[3], mats.lintel, l.id);
63160
63318
  const batches = createMasonryBatches();
63161
- const laid = [];
63319
+ const laid2 = [];
63162
63320
  const solids2 = [...foundations, ...columns, ...beams, ...slabs, ...lintels];
63163
63321
  for (const run of wallRuns(wallParts)) {
63164
63322
  const p = run.part;
63165
63323
  const wall = wallLineOf(p.aabb);
63166
63324
  const cuts = [...run.gaps];
63167
- for (const s of [...solids2, ...laid]) {
63325
+ for (const s of [...solids2, ...laid2]) {
63168
63326
  const top = columns.includes(s) ? s.y1 + 0.3 : s.y1;
63169
63327
  const cut = cutOf(wall, s.aabb, s.y0, top);
63170
63328
  if (cut) cuts.push(cut);
@@ -63177,7 +63335,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
63177
63335
  const coreLine = coreLineOf(wall, p, columns, coreWidth);
63178
63336
  const filled = buildMasonryPanel(batches, p, { cuts, courseBase: (p.floor ?? 0) === 0 ? FOUNDATION_TOP : p.y0, unitId: unit, coreLine, chases: chasesIn(wall, { line: coreLine, width: coreWidth, y0: p.y0, y1: p.y1 }, runs) });
63179
63337
  const half = coreWidth / 2;
63180
- for (const r of filled) laid.push({ id: p.id, aabb: wall.alongU ? [r.a0, coreLine - half, r.a1, coreLine + half] : [coreLine - half, r.a0, coreLine + half, r.a1], y0: r.y0, y1: r.y1, floor: p.floor ?? 0 });
63338
+ for (const r of filled) laid2.push({ id: p.id, aabb: wall.alongU ? [r.a0, coreLine - half, r.a1, coreLine + half] : [coreLine - half, r.a0, coreLine + half, r.a1], y0: r.y0, y1: r.y1, floor: p.floor ?? 0 });
63181
63339
  }
63182
63340
  for (const mesh3 of masonryMeshes(THREE, batches, mats, "masonry")) masonry.add(mesh3);
63183
63341
  return groups;
@@ -63626,7 +63784,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
63626
63784
  };
63627
63785
  for (const A of ws) for (const [side, sd] of [[A.w.sides[0], -1], [A.w.sides[1], 1]]) {
63628
63786
  if (!sideOf(side, false).exterior) continue;
63629
- const strip = (k, y1, y2, o0, o1, mat, c, piece22, laid = BASEBOARD_TILES) => {
63787
+ const strip = (k, y1, y2, o0, o1, mat, c, piece22, laid2 = BASEBOARD_TILES) => {
63630
63788
  const ea = junction(A, A.a, sd) > 0 ? A.th / 2 + k : junction(A, A.a, sd) < 0 ? -A.th / 2 : 0, eb = junction(A, A.b, sd) > 0 ? A.th / 2 + k : junction(A, A.b, sd) < 0 ? -A.th / 2 : 0;
63631
63789
  const s0 = A.a - ea, s1 = A.b + eb, f0 = A.L + sd * (A.th / 2 + o0), f1 = A.L + sd * (A.th / 2 + o1), lo = Math.min(f0, f1), hi = Math.max(f0, f1);
63632
63790
  if (s1 - s0 < 1e-3) return;
@@ -63636,14 +63794,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
63636
63794
  if (!shared3.ctx.visorScene) (mat === "sidewalk" ? shared3.ctx.paving : shared3.ctx.baseboards)?.push(p);
63637
63795
  }
63638
63796
  };
63639
- const tag = laid === BASEBOARD_TILES ? "baseboard" : "sidewalk";
63797
+ const tag = laid2 === BASEBOARD_TILES ? "baseboard" : "sidewalk";
63640
63798
  const tile = (id, a, b) => {
63641
- cursor.pc = pieceRecord(id, laid.material, null, { floor: 0, mass: Math.round((b - a) * (y2 - y1) * (hi - lo) * laid.density * 100) / 100, tags: [tag] });
63799
+ cursor.pc = pieceRecord(id, laid2.material, null, { floor: 0, mass: Math.round((b - a) * (y2 - y1) * (hi - lo) * laid2.density * 100) / 100, tags: [tag] });
63642
63800
  box5(a, b);
63643
63801
  };
63644
63802
  const runs = [];
63645
63803
  let from = s0;
63646
- if (laid === BASEBOARD_TILES) for (const d of doorsInWall(R.doors, A.w, A.L, A.a, A.b).sort((p, q) => p.at - q.at)) {
63804
+ if (laid2 === BASEBOARD_TILES) for (const d of doorsInWall(R.doors, A.w, A.L, A.a, A.b).sort((p, q) => p.at - q.at)) {
63647
63805
  runs.push([from, d.at - d.width / 2]);
63648
63806
  from = d.at + d.width / 2;
63649
63807
  }
@@ -63654,7 +63812,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
63654
63812
  if (!id) box5(r0, r1);
63655
63813
  else if (shared3.ctx.baseboardBand) tile(id, r0, r1);
63656
63814
  else {
63657
- const n = Math.max(1, Math.round((r1 - r0) / laid.length)), w = (r1 - r0) / n, j = laid.joint / 2;
63815
+ const n = Math.max(1, Math.round((r1 - r0) / laid2.length)), w = (r1 - r0) / n, j = laid2.joint / 2;
63658
63816
  for (let i = 0; i < n; i++) tile(`${id}:${i}`, r0 + i * w + (i > 0 ? j : 0), r0 + (i + 1) * w - (i < n - 1 ? j : 0));
63659
63817
  }
63660
63818
  });
@@ -64769,8 +64927,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
64769
64927
  }
64770
64928
  var BLOB_LEANS = [[0.06, 0], [-0.06, 0], [0, 0.06], [0, -0.06], [0.06, 0.06], [-0.06, -0.06], [0.06, -0.06], [-0.06, 0.06], [0.12, 0], [0, 0.12]];
64771
64929
  var BLOB_CROSSING = Math.cos(20 * Math.PI / 180);
64772
- function grazes(laid, x, y, z, r) {
64773
- return laid.some(([x0, y0, z0, r0]) => {
64930
+ function grazes(laid2, x, y, z, r) {
64931
+ return laid2.some(([x0, y0, z0, r0]) => {
64774
64932
  const d = Math.hypot(x - x0, y - y0, z - z0);
64775
64933
  if (d <= Math.abs(r - r0) || d >= r + r0) return false;
64776
64934
  return (r * r + r0 * r0 - d * d) / (2 * r * r0) > BLOB_CROSSING;
@@ -64783,14 +64941,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
64783
64941
  const GREENS2 = [4160058, 3107376, 5212738, 5936200, 3832396];
64784
64942
  const FLOWERS = [14700682, 15909424, 16118506, 14168874, 9067216, 15764026];
64785
64943
  function blobs(K2, cx, cy, cz, R, n, green2, rnd2, o = {}) {
64786
- const laid = [];
64944
+ const laid2 = [];
64787
64945
  for (let i = 0; i < n; i++) {
64788
64946
  const a = rnd2() * 6.283, u = Math.sqrt(rnd2()), ph = (rnd2() - 0.2) * 1.2, dx = Math.cos(a) * u * R * 0.75, dz = Math.sin(a) * u * R * 0.75, dy = (o.flatten ? 0.35 : 0.55) * R * (Math.sin(ph) * 0.5 + 0.5) * 1.5 - R * 0.15;
64789
64947
  const r = R * (0.34 + rnd2() * 0.22) * (1 - u * 0.25), alt = r * 2 * (o.flatten ? 0.75 : 0.95), f = 0.72 + Math.min(1, (dy + R * 0.2) / (R * 1.2)) * 0.32 + rnd2() * 0.12;
64790
- const shown2 = shared3.ctx.visorScene || !grazes(laid, cx + dx, cy + dy + r * 0.5, cz + dz, r);
64948
+ const shown2 = shared3.ctx.visorScene || !grazes(laid2, cx + dx, cy + dy + r * 0.5, cz + dz, r);
64791
64949
  if (shared3.ctx.visorScene) K2.e("plant", cx + dx, cy + dy + r * 0.5, cz + dz, r, alt, sh(green2, f));
64792
64950
  else if (shown2) {
64793
- laid.push([cx + dx, cy + dy + r * 0.5, cz + dz, r]);
64951
+ laid2.push([cx + dx, cy + dy + r * 0.5, cz + dz, r]);
64794
64952
  const [wx, , wz] = K2.W(cx + dx, 0, cz + dz), lean = BLOB_LEANS[i % BLOB_LEANS.length];
64795
64953
  K2.A.cylinder({ ...K2.M, x: wx, z: wz, ry: K2.M.ry + i / n * (Math.PI / 5) }, "plant", 0, K2.y0 + cy + dy + r * 0.5, 0, r, alt, sh(green2, f), lean[0], lean[1], "sphere");
64796
64954
  }
@@ -68094,6 +68252,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
68094
68252
  return { x: (lo[0] + hi[0]) / 2, y: (lo[1] + hi[1]) / 2, z: (lo[2] + hi[2]) / 2, sx: hi[0] - lo[0], sy: hi[1] - lo[1], sz: hi[2] - lo[2], colour: unit.colour };
68095
68253
  }
68096
68254
  var axisVector = (axis2) => [axis2 === 0 ? 1 : 0, axis2 === 1 ? 1 : 0, axis2 === 2 ? 1 : 0];
68255
+ function isSliver(unit, size) {
68256
+ return Math.min(unit.sx, unit.sy, unit.sz) < 0.5 * Math.min(...size);
68257
+ }
68258
+ function overlapsStone(a, b) {
68259
+ const reach2 = 0.62 * (Math.max(a.sx, a.sy, a.sz) + Math.max(b.sx, b.sy, b.sz));
68260
+ return Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z) < reach2;
68261
+ }
68097
68262
  function unitBoxOf(axes, centre, size, colour) {
68098
68263
  const [x, y, z] = pointOf2(axes, centre[0], centre[1], centre[2]), [sx, sy, sz] = pointOf2(axes, size[0], size[1], size[2]);
68099
68264
  return { x, y, z, sx, sy, sz, colour };
@@ -68104,6 +68269,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
68104
68269
  inner[axes.along + 3] = bounds2[axes.along + 3] - COVER2;
68105
68270
  inner[axes.up + 3] = bounds2[axes.up + 3] - COVER2;
68106
68271
  if (axes.up !== 1) inner[axes.up] = bounds2[axes.up] + COVER2;
68272
+ inner[axes.across] = bounds2[axes.across] + COVER2;
68273
+ inner[axes.across + 3] = bounds2[axes.across + 3] - COVER2;
68107
68274
  return inner;
68108
68275
  }
68109
68276
  function installDestructionBreach(K, _shared) {
@@ -68710,7 +68877,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
68710
68877
  const stone = (s, y, d, size, r) => {
68711
68878
  const centre = mask.start + s;
68712
68879
  const unit = clipToBox(unitBoxOf(mask.axes, [centre, y, d], size, tmp.c.setHex(grey).multiplyScalar(0.85 + 0.2 * r(7)).getHex()), bounds2);
68713
- if (unit) out.push(unit);
68880
+ if (unit && !isSliver(unit, size) && !out.some((k) => overlapsStone(k, unit))) out.push(unit);
68714
68881
  };
68715
68882
  for (const { c, part, thick, mid } of gone) {
68716
68883
  const [from, to] = extentOf(part, mask.axes.along), [up0, up1] = extentOf(part, mask.axes.up);
@@ -85769,7 +85936,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
85769
85936
  return group;
85770
85937
  }
85771
85938
 
85772
- // ../game-items-three/dist/chunk-DBIE2ZMX.js
85939
+ // ../game-items-three/dist/chunk-FCEKW7F6.js
85773
85940
  var destruction_default = {
85774
85941
  families: {
85775
85942
  drink_can: {
@@ -86033,6 +86200,235 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
86033
86200
  mesh3.userData.destructionMaterial = materialOf2.get(part);
86034
86201
  });
86035
86202
  }
86203
+ var DEFAULT_COLOR = 9080724;
86204
+ var PI13 = Math.PI;
86205
+ function shade2(color2, factor2) {
86206
+ const channel = (shift) => Math.max(0, Math.min(255, Math.round((color2 >> shift & 255) * factor2)));
86207
+ return channel(16) << 16 | channel(8) << 8 | channel(0);
86208
+ }
86209
+ var PROUD = 2e-3;
86210
+ var seg = (c, n) => Math.max(5, Math.round(n * c.detail));
86211
+ function canonicalFrame(size) {
86212
+ const [w, h, d] = size;
86213
+ if (h >= w && h >= d) return { axis: 1, L: h, a: w, b: d };
86214
+ if (d >= w && d >= h) return { axis: 2, L: d, a: h, b: w };
86215
+ return { axis: 0, L: w, a: h, b: d };
86216
+ }
86217
+ function orient(c, group, axis2) {
86218
+ if (axis2 === 0) return group;
86219
+ const holder = c.k.G(group);
86220
+ if (axis2 === 1) holder.rotation.z = PI13 / 2;
86221
+ else holder.rotation.y = -PI13 / 2;
86222
+ return holder;
86223
+ }
86224
+ var alongLong = (draw2) => (c) => {
86225
+ const { axis: axis2, L, a, b } = canonicalFrame([c.w, c.h, c.d]);
86226
+ return orient(c, draw2(c, L, a, b), axis2);
86227
+ };
86228
+ var across = (c, group) => {
86229
+ group.scale.set(c.w, 1, c.d);
86230
+ return c.k.G(group);
86231
+ };
86232
+ var can = (c) => {
86233
+ const { k, h } = c;
86234
+ const body = k.metal(9277590);
86235
+ const r = 0.5 - PROUD / Math.min(c.w, c.d);
86236
+ return across(c, k.G(k.mesh(k.cyl(r, r, h * 0.94, seg(c, 14)), body), k.mesh(k.cyl(0.5, 0.5, h * 0.5, seg(c, 14)), k.food(c.color)), k.mesh(k.cyl(0.5, 0.5, h * 0.03, seg(c, 14)), body, [0, h * 0.485, 0]), k.mesh(k.cyl(0.5, 0.5, h * 0.03, seg(c, 14)), body, [0, -h * 0.485, 0])));
86237
+ };
86238
+ var bottle = (c) => {
86239
+ const { k, h } = c;
86240
+ const r = 0.5;
86241
+ const profile = [[0, -h / 2], [r, -h / 2], [r, h * 0.12], [r * 0.45, h * 0.3], [r * 0.4, h * 0.4], [0, h * 0.4]];
86242
+ return across(c, k.G(k.mesh(k.lathe(profile, seg(c, 14)), k.glass(c.color, 0.6)), k.mesh(k.cyl(r * 0.42, r * 0.42, h * 0.1, seg(c, 10)), k.plastic(shade2(c.color, 0.5)), [0, h * 0.45, 0])));
86243
+ };
86244
+ var jar = (c) => {
86245
+ const { k, h } = c;
86246
+ return across(c, k.G(k.mesh(k.cyl(0.5, 0.5, h * 0.82, seg(c, 14)), k.glass(c.color, 0.55), [0, -h * 0.09, 0]), k.mesh(k.cyl(0.5, 0.5, h * 0.18, seg(c, 14)), k.metal(12095802), [0, h * 0.41, 0])));
86247
+ };
86248
+ var bag = (c) => {
86249
+ const { k, w, h, d } = c;
86250
+ return k.G(k.mesh(k.bx(w, h * 0.88, d - 2 * PROUD), k.paper(c.color), [0, -h * 0.06, 0]), k.mesh(k.bx(w * 1, h * 0.12, d * 0.5), k.paper(shade2(c.color, 0.85)), [0, h * 0.44, 0]), k.mesh(k.bx(w * 0.7, h * 0.3, d), k.paper(shade2(c.color, 1.2)), [0, 0, 0]));
86251
+ };
86252
+ var box4 = (c) => {
86253
+ const { k, w, h, d } = c;
86254
+ return k.G(k.mesh(k.bx(w - 2 * PROUD, h - PROUD, d - 2 * PROUD), k.paper(c.color), [0, -PROUD / 2, 0]), k.mesh(k.bx(w, h * 0.12, d), k.paper(shade2(c.color, 0.8)), [0, h * 0.44, 0]), k.mesh(k.bx(w * 0.62, h * 0.4, d), k.paper(shade2(c.color, 1.25)), [0, -h * 0.02, 0]));
86255
+ };
86256
+ var cloth = (c) => {
86257
+ const { k, w, h, d } = c;
86258
+ const material = k.cloth(c.color);
86259
+ return k.G(k.mesh(k.bx(w, h * 0.55, d), material, [0, -h * 0.225, 0]), k.mesh(k.bx(w * 0.96, h * 0.45, d * 0.96), k.cloth(shade2(c.color, 0.9)), [0, h * 0.275, 0]));
86260
+ };
86261
+ var paper = (c) => {
86262
+ const { k, w, h, d } = c;
86263
+ const sheet = k.paper(c.color);
86264
+ return k.G(k.mesh(k.bx(w, h / 3, d), sheet, [0, -h / 3, 0]), k.mesh(k.bx(w * 0.98, h / 3, d * 0.98), k.paper(shade2(c.color, 0.95)), [0, 0, 0]), k.mesh(k.bx(w, h / 3, d), sheet, [0, h / 3, 0]));
86265
+ };
86266
+ var fruit = (c) => {
86267
+ const { k, w, h, d } = c;
86268
+ const sphere2 = new k.T.SphereGeometry(0.5, seg(c, 12), seg(c, 8));
86269
+ return k.G(k.mesh(sphere2, k.food(c.color), [0, -h * 0.04, 0], [0, 0, 0], [w, h * 0.92, d]), k.mesh(k.cyl(h * 0.02, h * 0.02, h * 0.1, 6), k.wood(5913122), [0, h * 0.45, 0]));
86270
+ };
86271
+ var dish = (c) => {
86272
+ const { k, w, h, d } = c;
86273
+ return k.G(k.mesh(k.cyl(0.5, 0.35, h, seg(c, 16)), k.plastic(c.color), [0, 0, 0], [0, 0, 0], [w, 1, d]));
86274
+ };
86275
+ var CUP_FLOOR_SHARE = 0.06;
86276
+ var cup = (c) => {
86277
+ const { k, w, h, d } = c;
86278
+ const floor2 = -h / 2 + h * CUP_FLOOR_SHARE;
86279
+ const profile = [[0, -h / 2], [0.38, -h / 2], [0.5, h / 2], [0.44, h / 2], [0.33, floor2], [0, floor2]];
86280
+ return k.G(k.mesh(k.lathe(profile, seg(c, 14)), k.plastic(c.color), [0, 0, 0], [0, 0, 0], [w, 1, d]));
86281
+ };
86282
+ var tube = (c) => {
86283
+ const { k, h } = c;
86284
+ const material = k.plastic(c.color);
86285
+ return across(c, k.G(k.mesh(k.cyl(0.5, 0.42, h * 0.86, seg(c, 12)), material, [0, -h * 0.04, 0]), k.mesh(k.cyl(0.35, 0.35, h * 0.12, seg(c, 12)), k.plastic(shade2(c.color, 0.6)), [0, h * 0.44, 0]), k.mesh(k.bx(1, h * 0.06, 0.25), material, [0, -h * 0.47, 0])));
86286
+ };
86287
+ var roll = (c) => {
86288
+ const { k, w, h, d } = c;
86289
+ const body = k.G(k.mesh(k.cyl(0.5, 0.5, 1, seg(c, 18)), k.paper(c.color)), k.mesh(k.cyl(0.18, 0.18, 0.98, seg(c, 12)), k.paper(11902328)));
86290
+ if (h <= w && h <= d) body.scale.set(w, h, d);
86291
+ else if (w <= d) {
86292
+ body.rotation.z = PI13 / 2;
86293
+ body.scale.set(h, w, d);
86294
+ } else {
86295
+ body.rotation.x = PI13 / 2;
86296
+ body.scale.set(w, d, h);
86297
+ }
86298
+ return k.G(body);
86299
+ };
86300
+ var shoe = (c) => {
86301
+ const { k, w, h, d } = c;
86302
+ const upper = k.cloth(c.color);
86303
+ return k.G(k.mesh(k.bx(w, h * 0.22, d), k.plastic(2237727), [0, -h * 0.39, 0]), k.mesh(k.bx(w * 0.42, h * 0.78, d * 0.96), upper, [-w * 0.29, h * 0.11, 0]), k.mesh(k.bx(w * 0.5, h * 0.5, d * 0.96), upper, [w * 0.25, -h * 0.03, 0]));
86304
+ };
86305
+ var tool = alongLong((c, L, a, b) => {
86306
+ const { k } = c;
86307
+ const radius = Math.max(4e-3, Math.min(a, b) / 2);
86308
+ return k.G(k.mesh(k.cyl(radius, radius, L * 0.74, seg(c, 10)), k.wood(9069628), [-L * 0.13, 0, 0], [0, 0, PI13 / 2]), k.mesh(k.bx(L * 0.26, a, b), k.metal(shade2(c.color, 1)), [L * 0.37, 0, 0]));
86309
+ });
86310
+ var longTool = alongLong((c, L, a, b) => {
86311
+ const { k } = c;
86312
+ const radius = Math.max(4e-3, Math.min(a, b) / 2) * 0.55;
86313
+ return k.G(k.mesh(k.cyl(radius, radius, L * 0.94, seg(c, 10)), k.wood(10122312), [0, 0, 0], [0, 0, PI13 / 2]), k.mesh(k.bx(L * 0.12, a, b), k.metal(c.color), [L * 0.44, 0, 0]));
86314
+ });
86315
+ var blade = alongLong((c, L, a, b) => {
86316
+ const { k } = c;
86317
+ const edge = Math.min(2e-4, b * 0.05);
86318
+ const steel = k.extrude([[0, 0], [L * 0.66, 0], [L * 0.68, a * 0.4], [0, a]], Math.max(5e-4, b * 0.4 - 2 * edge), edge);
86319
+ return k.G(k.mesh(steel, k.metal(11120048), [-L * 0.18, -a / 2, -b * 0.2 + edge]), k.mesh(k.bx(L * 0.34, a * 0.6, b), k.wood(3877408), [-L * 0.33, 0, 0]));
86320
+ });
86321
+ var garment = (c) => {
86322
+ const { k, w, h, d } = c;
86323
+ const material = k.cloth(c.color);
86324
+ return k.G(k.mesh(k.bx(w * 0.56, h, d), material), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [-w * 0.39, h * 0.29, 0]), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [w * 0.39, h * 0.29, 0]));
86325
+ };
86326
+ var backpack = (c) => {
86327
+ const { k, w, h, d } = c;
86328
+ const material = k.cloth(c.color);
86329
+ const dome = new k.T.SphereGeometry(0.5, seg(c, 12), seg(c, 6), 0, PI13 * 2, 0, PI13 / 2);
86330
+ const strap = k.cloth(shade2(c.color, 0.6));
86331
+ return k.G(k.mesh(k.bx(w, h * 0.78, d * 0.68), material, [0, -h * 0.11, -d * 0.14]), k.mesh(dome, material, [0, h * 0.28, -d * 0.14], [0, 0, 0], [w, h * 0.44, d * 0.68]), k.mesh(k.bx(w * 0.7, h * 0.4, d * 0.3), k.cloth(shade2(c.color, 0.75)), [0, -h * 0.18, d * 0.35]), k.mesh(k.bx(w * 0.1, h * 0.7, d * 0.04), strap, [-w * 0.25, -h * 0.05, -d * 0.48]), k.mesh(k.bx(w * 0.1, h * 0.7, d * 0.04), strap, [w * 0.25, -h * 0.05, -d * 0.48]));
86332
+ };
86333
+ var jerrycan = (c) => {
86334
+ const { k, w, h, d } = c;
86335
+ const material = k.plastic(c.color);
86336
+ return k.G(k.mesh(k.bx(w, h * 0.86, d), material, [0, -h * 0.07, 0]), k.mesh(k.bx(w * 0.4, h * 0.1, d * 0.5), material, [-w * 0.2, h * 0.45, 0]), k.mesh(k.cyl(d * 0.14, d * 0.18, h * 0.12, seg(c, 10)), k.plastic(14263361), [w * 0.3, h * 0.44, 0]));
86337
+ };
86338
+ var tank = (c) => {
86339
+ const { k, h } = c;
86340
+ const r = 0.5;
86341
+ const profile = [[0, -h / 2], [r * 0.9, -h / 2], [r, -h * 0.4], [r, h * 0.22], [r * 0.6, h * 0.36], [r * 0.2, h * 0.4], [0, h * 0.4]];
86342
+ const metal2 = k.metal(c.color);
86343
+ return across(c, k.G(k.mesh(k.lathe(profile, seg(c, 14)), metal2), k.mesh(k.cyl(r * 0.62, r * 0.62, h * 0.05, seg(c, 14)), metal2, [0, h * 0.3, 0]), k.mesh(k.cyl(r * 0.18, r * 0.18, h * 0.12, seg(c, 8)), k.metal(12095802), [0, h * 0.44, 0])));
86344
+ };
86345
+ var book = (c) => {
86346
+ const { k, w, h, d } = c;
86347
+ const cover = k.paper(c.color);
86348
+ return k.G(k.mesh(k.bx(w - PROUD, h - 2 * PROUD, d * 0.14), cover, [PROUD / 2, 0, d * 0.43 - PROUD]), k.mesh(k.bx(w - PROUD, h - 2 * PROUD, d * 0.14), cover, [PROUD / 2, 0, -d * 0.43 + PROUD]), k.mesh(k.bx(w * 0.94, h * 0.96, d * 0.72), k.paper(15327692), [w * 0.02, 0, 0]), k.mesh(k.bx(w * 0.08, h, d), k.paper(shade2(c.color, 0.8)), [-w * 0.46, 0, 0]));
86349
+ };
86350
+ var key = alongLong((c, L, a, b) => {
86351
+ const { k } = c;
86352
+ const metal2 = k.metal(12095802);
86353
+ const ring3 = a * 0.5;
86354
+ const tube2 = Math.min(b * 0.4, ring3 * 0.2);
86355
+ return k.G(k.mesh(new c.k.T.TorusGeometry(ring3 * 0.8, tube2, 5, seg(c, 10)), k.metal(10132896), [-L / 2 + ring3 * 0.8 + tube2, 0, 0]), k.mesh(k.bx(L * 0.62, a * 0.28, b), metal2, [L * 0.12, 0, 0]), k.mesh(k.bx(L * 0.08, a * 0.17, b), metal2, [L * 0.36, -a * 0.225, 0]), k.mesh(k.bx(L * 0.06, a * 0.17, b), metal2, [L * 0.2, -a * 0.225, 0]));
86356
+ });
86357
+ var battery2 = alongLong((c, L, a, b) => {
86358
+ const { k } = c;
86359
+ const r = Math.min(a, b) / 2;
86360
+ return k.G(k.mesh(k.cyl(r, r, L * 0.94, seg(c, 14)), k.metal(c.color), [0, 0, 0], [0, 0, PI13 / 2]), k.mesh(k.cyl(r * 0.36, r * 0.36, L * 0.06, seg(c, 8)), k.metal(12172736), [L * 0.47, 0, 0], [0, 0, PI13 / 2]));
86361
+ });
86362
+ var plank = alongLong((c, L, a, b) => {
86363
+ const { k } = c;
86364
+ const nail = k.metal(8225158);
86365
+ return k.G(k.mesh(k.bx(L, a, b), k.wood(11043929)), k.mesh(k.cyl(Math.min(a, b) * 0.1, Math.min(a, b) * 0.1, b * 0.98, 6), nail, [-L * 0.4, 0, 0], [PI13 / 2, 0, 0]), k.mesh(k.cyl(Math.min(a, b) * 0.1, Math.min(a, b) * 0.1, b * 0.98, 6), nail, [L * 0.4, 0, 0], [PI13 / 2, 0, 0]));
86366
+ });
86367
+ var device = (c) => {
86368
+ const { k, w, h, d } = c;
86369
+ const screen2 = k.M(10469258, "glass", { emissive: 3099170, emissiveIntensity: 0.6, roughness: 0.2 });
86370
+ return k.G(k.mesh(k.bx(w, h, d * 0.96), k.plastic(c.color), [0, 0, -d * 0.02]), k.mesh(k.bx(w * 0.7, h * 0.32, d * 0.06), screen2, [0, h * 0.22, d * 0.47]), k.mesh(k.cyl(Math.min(w, h) * 0.08, Math.min(w, h) * 0.08, d * 0.1, seg(c, 8)), k.metal(12172736), [w * 0.25, -h * 0.18, d * 0.45], [PI13 / 2, 0, 0]));
86371
+ };
86372
+ var DRAWERS = {
86373
+ can,
86374
+ bag,
86375
+ box: box4,
86376
+ bottle,
86377
+ tool,
86378
+ roll,
86379
+ dish,
86380
+ cloth,
86381
+ shoe,
86382
+ jar,
86383
+ paper,
86384
+ fruit,
86385
+ cup,
86386
+ tube,
86387
+ blade,
86388
+ long_tool: longTool,
86389
+ garment,
86390
+ backpack,
86391
+ jerrycan,
86392
+ tank,
86393
+ book,
86394
+ key,
86395
+ battery: battery2,
86396
+ plank,
86397
+ device
86398
+ };
86399
+ var isShape = (value) => value !== void 0 && value in DRAWERS;
86400
+ function shapeOf(subject) {
86401
+ const hint = subject.shape;
86402
+ if (!isShape(hint)) return "box";
86403
+ const [w, h, d] = subject.size;
86404
+ const { L, a, b } = canonicalFrame(subject.size);
86405
+ const long = L / Math.max(a, b, 1e-6) >= 4;
86406
+ const flat2 = Math.min(w, h, d) / Math.max(w, h, d) <= 0.2;
86407
+ switch (hint) {
86408
+ case "tool":
86409
+ if (subject.category === "keys") return "key";
86410
+ if (subject.category === "electronics") return "device";
86411
+ if (long) return subject.category === "melee" && Math.min(a, b) / L <= 0.1 && flat2 ? "blade" : "long_tool";
86412
+ return hint;
86413
+ case "cloth":
86414
+ return subject.category === "clothing" ? "garment" : hint;
86415
+ case "bag":
86416
+ return subject.category === "bags" ? "backpack" : hint;
86417
+ case "box":
86418
+ if (subject.category === "electronics") return "device";
86419
+ if (subject.category === "books") return "book";
86420
+ if (subject.category === "keys") return "key";
86421
+ return hint;
86422
+ case "paper":
86423
+ return subject.category === "books" ? "book" : hint;
86424
+ default:
86425
+ return hint;
86426
+ }
86427
+ }
86428
+ function drawShape(k, shape, size, options = {}) {
86429
+ const [w, h, d] = size;
86430
+ return DRAWERS[shape]({ k, w, h, d, color: options.color ?? DEFAULT_COLOR, detail: options.detail ?? 1 });
86431
+ }
86036
86432
  var DESTRUCTION_MATERIAL_BY_TAG = {
86037
86433
  metal: "steel",
86038
86434
  wood: "wood_soft",
@@ -86040,6 +86436,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
86040
86436
  paper: "paper",
86041
86437
  plastic: "plastic",
86042
86438
  cloth: "fabric",
86439
+ rubber: "rubber",
86043
86440
  food: "flesh_fruit"
86044
86441
  };
86045
86442
  var FAMILIES = destruction_default.families;
@@ -88738,6 +89135,16 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
88738
89135
  0.553
88739
89136
  ],
88740
89137
  scale: 0.092308
89138
+ },
89139
+ {
89140
+ id: "plunger",
89141
+ teamId: "desentupidor",
89142
+ teamBox: [
89143
+ 1.4,
89144
+ 5.5,
89145
+ 1.4
89146
+ ],
89147
+ scale: 0.1
88741
89148
  }
88742
89149
  ];
88743
89150
  var cannedBeans = ({ mesh: mesh3, cyl, torus: torus2, G, metal: metal2, paper: paper2, food }) => {
@@ -89603,6 +90010,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
89603
90010
  const nozzle = mesh3(cyl(0.04, 0.07, 0.08, 8), plastic(14211288), [0, 0.96, 0]);
89604
90011
  return G(bottle2, label, stripe, cap, nozzle);
89605
90012
  };
90013
+ var plunger = ({ mesh: mesh3, cyl, G, M, wood }) => {
90014
+ const rubber = M(11545120, "rubber", { roughness: 0.75 });
90015
+ const cup2 = mesh3(cyl(0.3, 0.7, 0.75, 16), rubber, [0, 0.455, 0]);
90016
+ const lip = mesh3(cyl(0.7, 0.7, 0.08, 16), M(9314841, "rubber", { roughness: 0.8 }), [0, 0.04, 0]);
90017
+ const neck = mesh3(cyl(0.2, 0.3, 0.3, 12), rubber, [0, 0.98, 0]);
90018
+ const handle = mesh3(cyl(0.15, 0.15, 4.4, 10), wood(10122312), [0, 3.3, 0]);
90019
+ return G(cup2, lip, neck, handle);
90020
+ };
89606
90021
  var canOpener = ({ mesh: mesh3, bx, cyl, G, metal: metal2, plastic }) => {
89607
90022
  const steel = metal2(11120050);
89608
90023
  const grip = plastic(3104138);
@@ -90541,7 +90956,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
90541
90956
  mesh3(bx(0.05, 0.081, 0.05), tan, [0, 0.0445, 0.13])
90542
90957
  );
90543
90958
  };
90544
- var backpack = ({ mesh: mesh3, bx, G, cloth: cloth2, plastic }) => {
90959
+ var backpack2 = ({ mesh: mesh3, bx, G, cloth: cloth2, plastic }) => {
90545
90960
  const main = cloth2(3099243);
90546
90961
  const trim = cloth2(1976890);
90547
90962
  return G(
@@ -91879,7 +92294,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
91879
92294
  rebar,
91880
92295
  lubricant_spray: lubricantSpray,
91881
92296
  army_camouflage_uniform: armyCamouflageUniform,
91882
- backpack,
92297
+ backpack: backpack2,
91883
92298
  ballistic_vest: ballisticVest,
91884
92299
  battery_9v: battery9V,
91885
92300
  bean_seeds: beanSeeds,
@@ -91966,7 +92381,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
91966
92381
  tshirt,
91967
92382
  watering_can: wateringCan,
91968
92383
  wheelbarrow,
91969
- windup_alarm_clock: windupAlarmClock
92384
+ windup_alarm_clock: windupAlarmClock,
92385
+ plunger
91970
92386
  };
91971
92387
  var SHIPPED_MODELS = models_default2.map((entry2) => {
91972
92388
  const builder = BUILDERS3[entry2.id];
@@ -91990,234 +92406,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
91990
92406
  var defaultRegistry;
91991
92407
  var defaultItemModels = () => defaultRegistry ?? (defaultRegistry = registryOver(new Map(SHIPPED_MODELS.map(({ entry: entry2 }) => [entry2.id, entry2])), new Map(SHIPPED_MODELS.map(({ entry: entry2, builder }) => [entry2.id, builder]))));
91992
92408
  var hasItemModel = (id) => defaultItemModels().has(id);
91993
- var DEFAULT_COLOR = 9080724;
91994
- var PI13 = Math.PI;
91995
- function shade2(color2, factor2) {
91996
- const channel = (shift) => Math.max(0, Math.min(255, Math.round((color2 >> shift & 255) * factor2)));
91997
- return channel(16) << 16 | channel(8) << 8 | channel(0);
91998
- }
91999
- var PROUD = 2e-3;
92000
- var seg = (c, n) => Math.max(5, Math.round(n * c.detail));
92001
- function canonicalFrame(size) {
92002
- const [w, h, d] = size;
92003
- if (h >= w && h >= d) return { axis: 1, L: h, a: w, b: d };
92004
- if (d >= w && d >= h) return { axis: 2, L: d, a: h, b: w };
92005
- return { axis: 0, L: w, a: h, b: d };
92006
- }
92007
- function orient(c, group, axis2) {
92008
- if (axis2 === 0) return group;
92009
- const holder = c.k.G(group);
92010
- if (axis2 === 1) holder.rotation.z = PI13 / 2;
92011
- else holder.rotation.y = -PI13 / 2;
92012
- return holder;
92013
- }
92014
- var alongLong = (draw2) => (c) => {
92015
- const { axis: axis2, L, a, b } = canonicalFrame([c.w, c.h, c.d]);
92016
- return orient(c, draw2(c, L, a, b), axis2);
92017
- };
92018
- var across = (c, group) => {
92019
- group.scale.set(c.w, 1, c.d);
92020
- return c.k.G(group);
92021
- };
92022
- var can = (c) => {
92023
- const { k, h } = c;
92024
- const body = k.metal(9277590);
92025
- const r = 0.5 - PROUD / Math.min(c.w, c.d);
92026
- return across(c, k.G(k.mesh(k.cyl(r, r, h * 0.94, seg(c, 14)), body), k.mesh(k.cyl(0.5, 0.5, h * 0.5, seg(c, 14)), k.food(c.color)), k.mesh(k.cyl(0.5, 0.5, h * 0.03, seg(c, 14)), body, [0, h * 0.485, 0]), k.mesh(k.cyl(0.5, 0.5, h * 0.03, seg(c, 14)), body, [0, -h * 0.485, 0])));
92027
- };
92028
- var bottle = (c) => {
92029
- const { k, h } = c;
92030
- const r = 0.5;
92031
- const profile = [[0, -h / 2], [r, -h / 2], [r, h * 0.12], [r * 0.45, h * 0.3], [r * 0.4, h * 0.4], [0, h * 0.4]];
92032
- return across(c, k.G(k.mesh(k.lathe(profile, seg(c, 14)), k.glass(c.color, 0.6)), k.mesh(k.cyl(r * 0.42, r * 0.42, h * 0.1, seg(c, 10)), k.plastic(shade2(c.color, 0.5)), [0, h * 0.45, 0])));
92033
- };
92034
- var jar = (c) => {
92035
- const { k, h } = c;
92036
- return across(c, k.G(k.mesh(k.cyl(0.5, 0.5, h * 0.82, seg(c, 14)), k.glass(c.color, 0.55), [0, -h * 0.09, 0]), k.mesh(k.cyl(0.5, 0.5, h * 0.18, seg(c, 14)), k.metal(12095802), [0, h * 0.41, 0])));
92037
- };
92038
- var bag = (c) => {
92039
- const { k, w, h, d } = c;
92040
- return k.G(k.mesh(k.bx(w, h * 0.88, d - 2 * PROUD), k.paper(c.color), [0, -h * 0.06, 0]), k.mesh(k.bx(w * 1, h * 0.12, d * 0.5), k.paper(shade2(c.color, 0.85)), [0, h * 0.44, 0]), k.mesh(k.bx(w * 0.7, h * 0.3, d), k.paper(shade2(c.color, 1.2)), [0, 0, 0]));
92041
- };
92042
- var box4 = (c) => {
92043
- const { k, w, h, d } = c;
92044
- return k.G(k.mesh(k.bx(w - 2 * PROUD, h - PROUD, d - 2 * PROUD), k.paper(c.color), [0, -PROUD / 2, 0]), k.mesh(k.bx(w, h * 0.12, d), k.paper(shade2(c.color, 0.8)), [0, h * 0.44, 0]), k.mesh(k.bx(w * 0.62, h * 0.4, d), k.paper(shade2(c.color, 1.25)), [0, -h * 0.02, 0]));
92045
- };
92046
- var cloth = (c) => {
92047
- const { k, w, h, d } = c;
92048
- const material = k.cloth(c.color);
92049
- return k.G(k.mesh(k.bx(w, h * 0.55, d), material, [0, -h * 0.225, 0]), k.mesh(k.bx(w * 0.96, h * 0.45, d * 0.96), k.cloth(shade2(c.color, 0.9)), [0, h * 0.275, 0]));
92050
- };
92051
- var paper = (c) => {
92052
- const { k, w, h, d } = c;
92053
- const sheet = k.paper(c.color);
92054
- return k.G(k.mesh(k.bx(w, h / 3, d), sheet, [0, -h / 3, 0]), k.mesh(k.bx(w * 0.98, h / 3, d * 0.98), k.paper(shade2(c.color, 0.95)), [0, 0, 0]), k.mesh(k.bx(w, h / 3, d), sheet, [0, h / 3, 0]));
92055
- };
92056
- var fruit = (c) => {
92057
- const { k, w, h, d } = c;
92058
- const sphere2 = new k.T.SphereGeometry(0.5, seg(c, 12), seg(c, 8));
92059
- return k.G(k.mesh(sphere2, k.food(c.color), [0, -h * 0.04, 0], [0, 0, 0], [w, h * 0.92, d]), k.mesh(k.cyl(h * 0.02, h * 0.02, h * 0.1, 6), k.wood(5913122), [0, h * 0.45, 0]));
92060
- };
92061
- var dish = (c) => {
92062
- const { k, w, h, d } = c;
92063
- return k.G(k.mesh(k.cyl(0.5, 0.35, h, seg(c, 16)), k.plastic(c.color), [0, 0, 0], [0, 0, 0], [w, 1, d]));
92064
- };
92065
- var cup = (c) => {
92066
- const { k, w, h, d } = c;
92067
- const profile = [[0, -h / 2], [0.38, -h / 2], [0.5, h / 2], [0.44, h / 2], [0.33, -h / 2 + h * 0.06], [0, -h / 2 + h * 0.06]];
92068
- return k.G(k.mesh(k.lathe(profile, seg(c, 14)), k.plastic(c.color), [0, 0, 0], [0, 0, 0], [w, 1, d]));
92069
- };
92070
- var tube = (c) => {
92071
- const { k, h } = c;
92072
- const material = k.plastic(c.color);
92073
- return across(c, k.G(k.mesh(k.cyl(0.5, 0.42, h * 0.86, seg(c, 12)), material, [0, -h * 0.04, 0]), k.mesh(k.cyl(0.35, 0.35, h * 0.12, seg(c, 12)), k.plastic(shade2(c.color, 0.6)), [0, h * 0.44, 0]), k.mesh(k.bx(1, h * 0.06, 0.25), material, [0, -h * 0.47, 0])));
92074
- };
92075
- var roll = (c) => {
92076
- const { k, w, h, d } = c;
92077
- const body = k.G(k.mesh(k.cyl(0.5, 0.5, 1, seg(c, 18)), k.paper(c.color)), k.mesh(k.cyl(0.18, 0.18, 0.98, seg(c, 12)), k.paper(11902328)));
92078
- if (h <= w && h <= d) body.scale.set(w, h, d);
92079
- else if (w <= d) {
92080
- body.rotation.z = PI13 / 2;
92081
- body.scale.set(h, w, d);
92082
- } else {
92083
- body.rotation.x = PI13 / 2;
92084
- body.scale.set(w, d, h);
92085
- }
92086
- return k.G(body);
92087
- };
92088
- var shoe = (c) => {
92089
- const { k, w, h, d } = c;
92090
- const upper = k.cloth(c.color);
92091
- return k.G(k.mesh(k.bx(w, h * 0.22, d), k.plastic(2237727), [0, -h * 0.39, 0]), k.mesh(k.bx(w * 0.42, h * 0.78, d * 0.96), upper, [-w * 0.29, h * 0.11, 0]), k.mesh(k.bx(w * 0.5, h * 0.5, d * 0.96), upper, [w * 0.25, -h * 0.03, 0]));
92092
- };
92093
- var tool = alongLong((c, L, a, b) => {
92094
- const { k } = c;
92095
- const radius = Math.max(4e-3, Math.min(a, b) / 2);
92096
- return k.G(k.mesh(k.cyl(radius, radius, L * 0.74, seg(c, 10)), k.wood(9069628), [-L * 0.13, 0, 0], [0, 0, PI13 / 2]), k.mesh(k.bx(L * 0.26, a, b), k.metal(shade2(c.color, 1)), [L * 0.37, 0, 0]));
92097
- });
92098
- var longTool = alongLong((c, L, a, b) => {
92099
- const { k } = c;
92100
- const radius = Math.max(4e-3, Math.min(a, b) / 2) * 0.55;
92101
- return k.G(k.mesh(k.cyl(radius, radius, L * 0.94, seg(c, 10)), k.wood(10122312), [0, 0, 0], [0, 0, PI13 / 2]), k.mesh(k.bx(L * 0.12, a, b), k.metal(c.color), [L * 0.44, 0, 0]));
92102
- });
92103
- var blade = alongLong((c, L, a, b) => {
92104
- const { k } = c;
92105
- const edge = Math.min(2e-4, b * 0.05);
92106
- const steel = k.extrude([[0, 0], [L * 0.66, 0], [L * 0.68, a * 0.4], [0, a]], Math.max(5e-4, b * 0.4 - 2 * edge), edge);
92107
- return k.G(k.mesh(steel, k.metal(11120048), [-L * 0.18, -a / 2, -b * 0.2 + edge]), k.mesh(k.bx(L * 0.34, a * 0.6, b), k.wood(3877408), [-L * 0.33, 0, 0]));
92108
- });
92109
- var garment = (c) => {
92110
- const { k, w, h, d } = c;
92111
- const material = k.cloth(c.color);
92112
- return k.G(k.mesh(k.bx(w * 0.56, h, d), material), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [-w * 0.39, h * 0.29, 0]), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [w * 0.39, h * 0.29, 0]));
92113
- };
92114
- var backpack2 = (c) => {
92115
- const { k, w, h, d } = c;
92116
- const material = k.cloth(c.color);
92117
- const dome = new k.T.SphereGeometry(0.5, seg(c, 12), seg(c, 6), 0, PI13 * 2, 0, PI13 / 2);
92118
- const strap = k.cloth(shade2(c.color, 0.6));
92119
- return k.G(k.mesh(k.bx(w, h * 0.78, d * 0.68), material, [0, -h * 0.11, -d * 0.14]), k.mesh(dome, material, [0, h * 0.28, -d * 0.14], [0, 0, 0], [w, h * 0.44, d * 0.68]), k.mesh(k.bx(w * 0.7, h * 0.4, d * 0.3), k.cloth(shade2(c.color, 0.75)), [0, -h * 0.18, d * 0.35]), k.mesh(k.bx(w * 0.1, h * 0.7, d * 0.04), strap, [-w * 0.25, -h * 0.05, -d * 0.48]), k.mesh(k.bx(w * 0.1, h * 0.7, d * 0.04), strap, [w * 0.25, -h * 0.05, -d * 0.48]));
92120
- };
92121
- var jerrycan = (c) => {
92122
- const { k, w, h, d } = c;
92123
- const material = k.plastic(c.color);
92124
- return k.G(k.mesh(k.bx(w, h * 0.86, d), material, [0, -h * 0.07, 0]), k.mesh(k.bx(w * 0.4, h * 0.1, d * 0.5), material, [-w * 0.2, h * 0.45, 0]), k.mesh(k.cyl(d * 0.14, d * 0.18, h * 0.12, seg(c, 10)), k.plastic(14263361), [w * 0.3, h * 0.44, 0]));
92125
- };
92126
- var tank = (c) => {
92127
- const { k, h } = c;
92128
- const r = 0.5;
92129
- const profile = [[0, -h / 2], [r * 0.9, -h / 2], [r, -h * 0.4], [r, h * 0.22], [r * 0.6, h * 0.36], [r * 0.2, h * 0.4], [0, h * 0.4]];
92130
- const metal2 = k.metal(c.color);
92131
- return across(c, k.G(k.mesh(k.lathe(profile, seg(c, 14)), metal2), k.mesh(k.cyl(r * 0.62, r * 0.62, h * 0.05, seg(c, 14)), metal2, [0, h * 0.3, 0]), k.mesh(k.cyl(r * 0.18, r * 0.18, h * 0.12, seg(c, 8)), k.metal(12095802), [0, h * 0.44, 0])));
92132
- };
92133
- var book = (c) => {
92134
- const { k, w, h, d } = c;
92135
- const cover = k.paper(c.color);
92136
- return k.G(k.mesh(k.bx(w - PROUD, h - 2 * PROUD, d * 0.14), cover, [PROUD / 2, 0, d * 0.43 - PROUD]), k.mesh(k.bx(w - PROUD, h - 2 * PROUD, d * 0.14), cover, [PROUD / 2, 0, -d * 0.43 + PROUD]), k.mesh(k.bx(w * 0.94, h * 0.96, d * 0.72), k.paper(15327692), [w * 0.02, 0, 0]), k.mesh(k.bx(w * 0.08, h, d), k.paper(shade2(c.color, 0.8)), [-w * 0.46, 0, 0]));
92137
- };
92138
- var key = alongLong((c, L, a, b) => {
92139
- const { k } = c;
92140
- const metal2 = k.metal(12095802);
92141
- const ring3 = a * 0.5;
92142
- const tube2 = Math.min(b * 0.4, ring3 * 0.2);
92143
- return k.G(k.mesh(new c.k.T.TorusGeometry(ring3 * 0.8, tube2, 5, seg(c, 10)), k.metal(10132896), [-L / 2 + ring3 * 0.8 + tube2, 0, 0]), k.mesh(k.bx(L * 0.62, a * 0.28, b), metal2, [L * 0.12, 0, 0]), k.mesh(k.bx(L * 0.08, a * 0.17, b), metal2, [L * 0.36, -a * 0.225, 0]), k.mesh(k.bx(L * 0.06, a * 0.17, b), metal2, [L * 0.2, -a * 0.225, 0]));
92144
- });
92145
- var battery2 = alongLong((c, L, a, b) => {
92146
- const { k } = c;
92147
- const r = Math.min(a, b) / 2;
92148
- return k.G(k.mesh(k.cyl(r, r, L * 0.94, seg(c, 14)), k.metal(c.color), [0, 0, 0], [0, 0, PI13 / 2]), k.mesh(k.cyl(r * 0.36, r * 0.36, L * 0.06, seg(c, 8)), k.metal(12172736), [L * 0.47, 0, 0], [0, 0, PI13 / 2]));
92149
- });
92150
- var plank = alongLong((c, L, a, b) => {
92151
- const { k } = c;
92152
- const nail = k.metal(8225158);
92153
- return k.G(k.mesh(k.bx(L, a, b), k.wood(11043929)), k.mesh(k.cyl(Math.min(a, b) * 0.1, Math.min(a, b) * 0.1, b * 0.98, 6), nail, [-L * 0.4, 0, 0], [PI13 / 2, 0, 0]), k.mesh(k.cyl(Math.min(a, b) * 0.1, Math.min(a, b) * 0.1, b * 0.98, 6), nail, [L * 0.4, 0, 0], [PI13 / 2, 0, 0]));
92154
- });
92155
- var device = (c) => {
92156
- const { k, w, h, d } = c;
92157
- const screen2 = k.M(10469258, "glass", { emissive: 3099170, emissiveIntensity: 0.6, roughness: 0.2 });
92158
- return k.G(k.mesh(k.bx(w, h, d * 0.96), k.plastic(c.color), [0, 0, -d * 0.02]), k.mesh(k.bx(w * 0.7, h * 0.32, d * 0.06), screen2, [0, h * 0.22, d * 0.47]), k.mesh(k.cyl(Math.min(w, h) * 0.08, Math.min(w, h) * 0.08, d * 0.1, seg(c, 8)), k.metal(12172736), [w * 0.25, -h * 0.18, d * 0.45], [PI13 / 2, 0, 0]));
92159
- };
92160
- var DRAWERS = {
92161
- can,
92162
- bag,
92163
- box: box4,
92164
- bottle,
92165
- tool,
92166
- roll,
92167
- dish,
92168
- cloth,
92169
- shoe,
92170
- jar,
92171
- paper,
92172
- fruit,
92173
- cup,
92174
- tube,
92175
- blade,
92176
- long_tool: longTool,
92177
- garment,
92178
- backpack: backpack2,
92179
- jerrycan,
92180
- tank,
92181
- book,
92182
- key,
92183
- battery: battery2,
92184
- plank,
92185
- device
92186
- };
92187
- var isShape = (value) => value !== void 0 && value in DRAWERS;
92188
- function shapeOf(subject) {
92189
- const hint = subject.shape;
92190
- if (!isShape(hint)) return "box";
92191
- const [w, h, d] = subject.size;
92192
- const { L, a, b } = canonicalFrame(subject.size);
92193
- const long = L / Math.max(a, b, 1e-6) >= 4;
92194
- const flat2 = Math.min(w, h, d) / Math.max(w, h, d) <= 0.2;
92195
- switch (hint) {
92196
- case "tool":
92197
- if (subject.category === "keys") return "key";
92198
- if (subject.category === "electronics") return "device";
92199
- if (long) return subject.category === "melee" && Math.min(a, b) / L <= 0.1 && flat2 ? "blade" : "long_tool";
92200
- return hint;
92201
- case "cloth":
92202
- return subject.category === "clothing" ? "garment" : hint;
92203
- case "bag":
92204
- return subject.category === "bags" ? "backpack" : hint;
92205
- case "box":
92206
- if (subject.category === "electronics") return "device";
92207
- if (subject.category === "books") return "book";
92208
- if (subject.category === "keys") return "key";
92209
- return hint;
92210
- case "paper":
92211
- return subject.category === "books" ? "book" : hint;
92212
- default:
92213
- return hint;
92214
- }
92215
- }
92216
- function drawShape(k, shape, size, options = {}) {
92217
- const [w, h, d] = size;
92218
- return DRAWERS[shape]({ k, w, h, d, color: options.color ?? DEFAULT_COLOR, detail: options.detail ?? 1 });
92219
- }
92220
- var WEAR_TARGET = { food: 6122286, metal: 8011293, wood: 4141862, cloth: 4866099, plastic: 7038294, paper: 9075282, glass: 5591098 };
92409
+ var WEAR_TARGET = { food: 6122286, metal: 8011293, wood: 4141862, cloth: 4866099, plastic: 7038294, paper: 9075282, glass: 5591098, rubber: 4860452 };
92221
92410
  var WEAR_AMOUNT = [0, 0.3, 0.62];
92222
92411
  var hexToRgb = (hex2) => [(hex2 >> 16 & 255) / 255, (hex2 >> 8 & 255) / 255, (hex2 & 255) / 255];
92223
92412
  var dataOf = (material) => {
@@ -92335,10 +92524,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
92335
92524
  }
92336
92525
  function restOnFloor({ THREE, group, root }, grips) {
92337
92526
  group.updateMatrixWorld(true);
92338
- const laid = new THREE.Box3().setFromObject(root);
92339
- const centre = laid.getCenter(new THREE.Vector3());
92340
- root.position.sub(new THREE.Vector3(centre.x, laid.min.y, centre.z));
92341
- const length2 = laid.max.x - laid.min.x;
92527
+ const laid2 = new THREE.Box3().setFromObject(root);
92528
+ const centre = laid2.getCenter(new THREE.Vector3());
92529
+ root.position.sub(new THREE.Vector3(centre.x, laid2.min.y, centre.z));
92530
+ const length2 = laid2.max.x - laid2.min.x;
92342
92531
  const handle = new THREE.Object3D();
92343
92532
  handle.name = "handle";
92344
92533
  handle.position.set(grips.handleAt ? grips.handleAt[0] : length2 * grips.handle, grips.handleAt ? grips.handleAt[1] : 0, 0);
@@ -101212,7 +101401,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
101212
101401
  }
101213
101402
  var CAPACITY3 = 400;
101214
101403
  var IDENTITY3 = [0, 0, 0, 1];
101215
- function multiply2(a, b) {
101404
+ function multiply3(a, b) {
101216
101405
  const [ax, ay, az, aw] = a;
101217
101406
  const [bx, by, bz, bw] = b;
101218
101407
  return [aw * bx + ax * bw + ay * bz - az * by, aw * by - ax * bz + ay * bw + az * bx, aw * bz + ax * by - ay * bx + az * bw, aw * bw - ax * bx - ay * by - az * bz];
@@ -101243,7 +101432,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
101243
101432
  x: options.p[0],
101244
101433
  y: options.p[1],
101245
101434
  z: options.p[2],
101246
- frame: options.roll ? multiply2(frame2, aboutX(options.roll)) : frame2,
101435
+ frame: options.roll ? multiply3(frame2, aboutX(options.roll)) : frame2,
101247
101436
  roll: options.roll ? aboutX(options.roll) : void 0,
101248
101437
  carried,
101249
101438
  drift: [0, 0, 0],
@@ -101325,7 +101514,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
101325
101514
  particle.y = y + drift[1];
101326
101515
  particle.z = z + drift[2];
101327
101516
  const turn2 = carried.carrier.orientation;
101328
- if (turn2) particle.frame = particle.roll ? multiply2(turn2, particle.roll) : turn2;
101517
+ if (turn2) particle.frame = particle.roll ? multiply3(turn2, particle.roll) : turn2;
101329
101518
  }
101330
101519
  };
101331
101520
  var DEFAULT_FADE_IN = 0.1;
@@ -106895,7 +107084,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
106895
107084
  var P13_VALVE_MESH = "valve";
106896
107085
  var P13_VALVE_COLOR = 12095802;
106897
107086
  var P13_WALL = 25e-4;
106898
- var SHAPES3 = {
107087
+ var SHAPES4 = {
106899
107088
  fuel_barrel: { shape: { kind: "cylinder", radius: 0.3, height: 0.9 }, position: [0, 0.45, 0], color: 3104666 },
106900
107089
  propane_p13: {
106901
107090
  shape: { kind: "cylinder", radius: 0.176, height: 0.49 },
@@ -106906,7 +107095,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
106906
107095
  },
106907
107096
  car_fuel_tank: { shape: { kind: "box", size: [0.9, 0.25, 0.5] }, position: [0, 0.4, 0], color: 4935509 }
106908
107097
  };
106909
- var WORLD_EXPLOSIVE_IDS = Object.keys(SHAPES3);
107098
+ var WORLD_EXPLOSIVE_IDS = Object.keys(SHAPES4);
106910
107099
  var SHELL = { thickness: 1e-3, fill: 0.03 };
106911
107100
  var explosivePart = (def, shape, scale) => ({
106912
107101
  id: "tank",
@@ -106952,7 +107141,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
106952
107141
  return [centre.x, centre.y, centre.z];
106953
107142
  };
106954
107143
  var worldExplosiveShell = (THREE, defId, items) => {
106955
- const shape = SHAPES3[defId];
107144
+ const shape = SHAPES4[defId];
106956
107145
  const model = shape ? modelOf(THREE, shape, items, 2) : void 0;
106957
107146
  if (!model) return void 0;
106958
107147
  model.traverse((node) => {
@@ -106984,7 +107173,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
106984
107173
  };
106985
107174
  };
106986
107175
  var worldExplosiveItem = (def, name, options = {}) => {
106987
- const shape = SHAPES3[def.id];
107176
+ const shape = SHAPES4[def.id];
106988
107177
  if (!shape) return void 0;
106989
107178
  const scale = () => options.scale?.() ?? 1;
106990
107179
  const spec = () => ({ name, parts: [explosivePart(def, shape, scale())], joints: [], tags: ["explosive"] });