@adatechnology/game-items-three 0.14.0 → 0.14.2

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.
@@ -2516,6 +2516,11 @@ var GameItemsThree = (() => {
2516
2516
  { id: "collectibles", name: "Collectibles" },
2517
2517
  { id: "keys", name: "Keys" }
2518
2518
  ];
2519
+ var consumableLiters = (spec) => spec?.form === "liquid" && spec.unit === "ml" ? spec.amount / 1e3 : void 0;
2520
+ var itemFluid = (item) => {
2521
+ if (!item.fluid) return void 0;
2522
+ return { liquid: item.fluid.liquid, liters: consumableLiters(item.consumable) ?? item.fluid.liters ?? 0 };
2523
+ };
2519
2524
  var storageRuleOf = (rules, storage) => {
2520
2525
  const rule = rules.storage[storage];
2521
2526
  if (!rule) throw new Error(`game-items: unknown storage "${storage}"`);
@@ -3578,6 +3583,26 @@ var GameItemsThree = (() => {
3578
3583
  "brake_fluid"
3579
3584
  ]
3580
3585
  },
3586
+ {
3587
+ id: "detergent",
3588
+ color: 15916378,
3589
+ opacity: 0.6,
3590
+ stainColor: 14077068,
3591
+ viscosity: 400,
3592
+ density: 1030,
3593
+ dryTime: 1800,
3594
+ gloss: 0.95,
3595
+ leavesMark: true,
3596
+ drink: {
3597
+ thirst: 0,
3598
+ effects: [
3599
+ "poison"
3600
+ ]
3601
+ },
3602
+ tags: [
3603
+ "soap"
3604
+ ]
3605
+ },
3581
3606
  {
3582
3607
  id: "shampoo",
3583
3608
  color: 6069216,
@@ -3599,6 +3624,65 @@ var GameItemsThree = (() => {
3599
3624
  "sticky"
3600
3625
  ]
3601
3626
  },
3627
+ {
3628
+ id: "fabric_softener",
3629
+ color: 9225452,
3630
+ opacity: 0.8,
3631
+ stainColor: 11061470,
3632
+ viscosity: 80,
3633
+ density: 1e3,
3634
+ dryTime: 1800,
3635
+ gloss: 0.8,
3636
+ leavesMark: true,
3637
+ drink: {
3638
+ thirst: 0,
3639
+ effects: [
3640
+ "poison"
3641
+ ]
3642
+ },
3643
+ tags: [
3644
+ "soap"
3645
+ ]
3646
+ },
3647
+ {
3648
+ id: "disinfectant",
3649
+ color: 14205040,
3650
+ opacity: 0.6,
3651
+ stainColor: 13154442,
3652
+ viscosity: 1.5,
3653
+ density: 1e3,
3654
+ dryTime: 600,
3655
+ gloss: 0.85,
3656
+ leavesMark: true,
3657
+ drink: {
3658
+ thirst: 0,
3659
+ effects: [
3660
+ "poison"
3661
+ ]
3662
+ },
3663
+ tags: [
3664
+ "corrosive"
3665
+ ]
3666
+ },
3667
+ {
3668
+ id: "yogurt",
3669
+ color: 15986404,
3670
+ opacity: 1,
3671
+ stainColor: 15130576,
3672
+ viscosity: 1500,
3673
+ density: 1040,
3674
+ dryTime: 7200,
3675
+ gloss: 0.5,
3676
+ leavesMark: true,
3677
+ drink: {
3678
+ thirst: 10,
3679
+ effects: []
3680
+ },
3681
+ tags: [
3682
+ "food",
3683
+ "sticky"
3684
+ ]
3685
+ },
3602
3686
  {
3603
3687
  id: "toothpaste",
3604
3688
  color: 16054008,
@@ -4115,14 +4199,15 @@ var GameItemsThree = (() => {
4115
4199
  var WALL_SHARE = 0.9;
4116
4200
  var OPENING_RADIUS = 0.012;
4117
4201
  function itemContents(subject) {
4118
- const contents = subject.model === void 0 ? void 0 : CONTENTS[subject.model];
4202
+ const known = subject.model === void 0 ? void 0 : CONTENTS[subject.model];
4203
+ const contents = known ?? (subject.fluid ? { liquid: subject.fluid.liquid, fill: 1, ...subject.box ? { box: true } : {} } : void 0);
4119
4204
  if (!contents) return void 0;
4120
4205
  const [width, height, depth] = subject.size;
4121
4206
  const radius = Math.min(width, depth) / 2;
4122
4207
  const innerLiters = (contents.box ? width * depth : Math.PI * radius * radius) * height * WALL_SHARE * 1e3;
4123
4208
  const density = LIQUIDS.find((liquid) => liquid.id === contents.liquid)?.density ?? 1e3;
4124
4209
  const heaviest = subject.weight === void 0 ? Infinity : subject.weight * 1e3 / density;
4125
- const liters = Math.min(innerLiters * contents.fill, heaviest);
4210
+ const liters = Math.min(known ? innerLiters * contents.fill : subject.fluid?.liters ?? 0, innerLiters, heaviest);
4126
4211
  const container = {
4127
4212
  capacity: innerLiters,
4128
4213
  liquid: contents.liquid,
@@ -4133,6 +4218,10 @@ var GameItemsThree = (() => {
4133
4218
  };
4134
4219
  return { container, liquid: contents.liquid, liters };
4135
4220
  }
4221
+ function containsOf(contents) {
4222
+ const viscosity = LIQUIDS.find((liquid) => liquid.id === contents.liquid)?.viscosity ?? 1;
4223
+ return { fluid: contents.liquid, liters: contents.liters, viscosity };
4224
+ }
4136
4225
  var VESSEL_FLOORS = { cup: CUP_FLOOR_SHARE };
4137
4226
  function itemVessel(subject) {
4138
4227
  const capacity = subject.capacityLiters;
@@ -4258,14 +4347,23 @@ var GameItemsThree = (() => {
4258
4347
  if (powder) mesh2.userData.destructionPowder = { color: powder.color };
4259
4348
  solid.push(mesh2);
4260
4349
  });
4261
- if (!rule?.welded || solid.length < 2) return;
4262
- const anchor = solid.reduce((largest, mesh2) => volumeOf(mesh2) > volumeOf(largest) ? mesh2 : largest);
4350
+ const largest = () => solid.reduce((big, mesh2) => volumeOf(mesh2) > volumeOf(big) ? mesh2 : big);
4351
+ if (!rule?.welded || solid.length < 2) {
4352
+ const held = options.fluid && size !== void 0 && solid.length > 0 ? itemContents({ size, ...weight === void 0 ? {} : { weight }, fluid: options.fluid }) : void 0;
4353
+ if (!held) return;
4354
+ const body2 = largest();
4355
+ body2.userData.destructionPart = { id: SHELL_PART_ID };
4356
+ body2.userData.hollow = true;
4357
+ body2.userData.destructionContains = containsOf(held);
4358
+ return;
4359
+ }
4360
+ const anchor = largest();
4263
4361
  solid.forEach((mesh2, index) => {
4264
4362
  mesh2.userData.destructionPart = mesh2 === anchor ? { id: SHELL_PART_ID } : { id: `shell_${index}`, parent: SHELL_PART_ID, kind: "weld" };
4265
4363
  if (rule.wall) mesh2.userData.destructionThickness = mesh2 === anchor ? rule.wall.body : rule.wall.ends;
4266
4364
  });
4267
4365
  const contents = size === void 0 ? void 0 : itemContents({ ...modelId === void 0 ? {} : { model: modelId }, size, ...weight === void 0 ? {} : { weight } });
4268
- if (contents) anchor.userData.destructionContains = { fluid: contents.liquid, liters: contents.liters };
4366
+ if (contents) anchor.userData.destructionContains = containsOf(contents);
4269
4367
  }
4270
4368
 
4271
4369
  // src/data/models.json
@@ -10801,7 +10899,8 @@ var GameItemsThree = (() => {
10801
10899
  const materials = kit.materials.slice(first);
10802
10900
  if (options.wear) setWear(materials, options.wear);
10803
10901
  root.userData.wear = options.wear ?? 0;
10804
- if (options.destructible) tagForDestruction(root, { ...kind === "model" && item.model !== void 0 ? { modelId: item.model } : {}, ...shape === void 0 ? {} : { shapeId: shape }, ...item.weight === void 0 ? {} : { weight: item.weight }, size: item.size, ...item.powder ? { powder: item.powder } : {}, ...item.parts ? { parts: item.parts } : {}, three: T2 });
10902
+ const held = itemFluid(item);
10903
+ if (options.destructible) tagForDestruction(root, { ...kind === "model" && item.model !== void 0 ? { modelId: item.model } : {}, ...shape === void 0 ? {} : { shapeId: shape }, ...item.weight === void 0 ? {} : { weight: item.weight }, size: item.size, ...item.powder ? { powder: item.powder } : {}, ...item.parts ? { parts: item.parts } : {}, ...held ? { fluid: held } : {}, three: T2 });
10805
10904
  markKitOrigin(root, { owner: "game-items-three", kind: "item", id: item.id, ...kind === "shape" ? { standIn: true } : {} });
10806
10905
  return { root, kind, ...shape ? { shape } : {}, size: item.size, materials };
10807
10906
  }
@@ -18198,6 +18297,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
18198
18297
  return { ...base2, mesh: { vertices, indices: piece3.mesh.indices } };
18199
18298
  };
18200
18299
  var THIN_SHEET_DISHING = 5e-3;
18300
+ var LAMINAR_VISCOSITY = 800;
18201
18301
  var TEAR_CALIBERS = 1.1;
18202
18302
  var SHELL_YIELD_SHARE = 0.5;
18203
18303
  var STEEL_YIELD_MPA = 250;
@@ -20916,7 +21016,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
20916
21016
  setStage(o, p, 1, {}, src);
20917
21017
  };
20918
21018
  const debris = (o, p, kind, point, normal, count, speed, src, material) => emit({ ...base2(o, src), type: "debris", part: p.spec.id, kind, point, normal, count, speed, ...material && material !== p.spec.material ? { material } : {} });
20919
- const holeRate = (hole, pressurized) => (pressurized ? 0.5 : 0.1) * (hole.diameter / 9e-3);
21019
+ const holeRate = (hole, pressurized, viscosity = 1) => (pressurized ? 0.5 : 0.1) * (hole.diameter / 9e-3) / (1 + Math.max(0, viscosity - 1) / LAMINAR_VISCOSITY);
20920
21020
  const detachEvents = (o, opened, by, src) => {
20921
21021
  for (const j of opened) emit({ ...base2(o, src), type: "detach", joint: j.spec.id, parts: [j.spec.a, j.spec.b], by, groups: o.st.groups.map((g) => [...g]) });
20922
21022
  };
@@ -22535,7 +22635,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
22535
22635
  fluid: p.spec.contains.fluid,
22536
22636
  point: entry2,
22537
22637
  direction: p.spec.contains.outflow ? vec.normalize(rotateVec(o.st.rotation, rotateVec(p.q, p.spec.contains.outflow))) : n,
22538
- rate: holeRate(hole, !!p.spec.contains.pressurized),
22638
+ rate: holeRate(hole, !!p.spec.contains.pressurized, p.spec.contains.viscosity),
22539
22639
  pressurized: !!p.spec.contains.pressurized
22540
22640
  });
22541
22641
  rollIgnition(o, p, round3);
@@ -23624,7 +23724,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
23624
23724
  const cont = p.spec.contains;
23625
23725
  if (cont && (s.liters ?? 0) > 0) {
23626
23726
  let rate = 0;
23627
- for (const h of s.holes) if (h.through) rate += holeRate(h, !!cont.pressurized);
23727
+ for (const h of s.holes) if (h.through) rate += holeRate(h, !!cont.pressurized, cont.viscosity);
23628
23728
  if (rate > 0) {
23629
23729
  s.liters = Math.max(0, (s.liters ?? 0) - rate * dt);
23630
23730
  hot = true;
@@ -24213,7 +24313,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
24213
24313
  fluid: c.fluid,
24214
24314
  point: wp,
24215
24315
  direction: c.outflow ? vec.normalize(rotateVec(o.st.rotation, rotateVec(p.q, c.outflow))) : wn,
24216
- rate: holeRate(hole, !!c.pressurized),
24316
+ rate: holeRate(hole, !!c.pressurized, c.viscosity),
24217
24317
  pressurized: !!c.pressurized
24218
24318
  });
24219
24319
  return true;
@@ -27643,6 +27743,19 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
27643
27743
  isTakeable: true,
27644
27744
  weight: 0.7,
27645
27745
  isSupply: false
27746
+ },
27747
+ {
27748
+ type: "talheres",
27749
+ item: "cutlery",
27750
+ name: "Talheres",
27751
+ qty: [
27752
+ 1,
27753
+ 2
27754
+ ],
27755
+ viewerCategory: "utensilio",
27756
+ isTakeable: true,
27757
+ weight: 1.5,
27758
+ isSupply: false
27646
27759
  }
27647
27760
  ],
27648
27761
  aereo: [
@@ -37463,15 +37576,28 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
37463
37576
  shape: "jar",
37464
37577
  color: 15786216,
37465
37578
  rarity: "common",
37579
+ parts: [
37580
+ {
37581
+ id: "body",
37582
+ material: "plastic",
37583
+ thickness: 6e-4
37584
+ }
37585
+ ],
37466
37586
  nutrition: {
37467
37587
  satiety: 10,
37468
37588
  hydration: 5
37469
37589
  },
37470
37590
  shelfLife: 28,
37471
37591
  estimated: [
37592
+ "parts",
37472
37593
  "nutrition",
37473
- "shelfLife"
37474
- ]
37594
+ "shelfLife",
37595
+ "fluid"
37596
+ ],
37597
+ fluid: {
37598
+ liquid: "yogurt",
37599
+ liters: 0.17
37600
+ }
37475
37601
  },
37476
37602
  {
37477
37603
  id: "apple",
@@ -37573,12 +37699,20 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
37573
37699
  shape: "jar",
37574
37700
  color: 15784160,
37575
37701
  rarity: "common",
37702
+ parts: [
37703
+ {
37704
+ id: "body",
37705
+ material: "plastic",
37706
+ thickness: 6e-4
37707
+ }
37708
+ ],
37576
37709
  nutrition: {
37577
37710
  satiety: 10,
37578
37711
  hydration: 4
37579
37712
  },
37580
37713
  shelfLife: 180,
37581
37714
  estimated: [
37715
+ "parts",
37582
37716
  "nutrition",
37583
37717
  "shelfLife"
37584
37718
  ]
@@ -37812,8 +37946,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
37812
37946
  }
37813
37947
  ],
37814
37948
  estimated: [
37949
+ "fluid",
37815
37950
  "parts"
37816
- ]
37951
+ ],
37952
+ fluid: {
37953
+ liquid: "shampoo"
37954
+ }
37817
37955
  },
37818
37956
  {
37819
37957
  id: "toothpaste",
@@ -37990,8 +38128,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
37990
38128
  ],
37991
38129
  estimated: [
37992
38130
  "parts",
38131
+ "fluid",
37993
38132
  "consumable"
37994
38133
  ],
38134
+ fluid: {
38135
+ liquid: "detergent"
38136
+ },
37995
38137
  consumable: {
37996
38138
  form: "liquid",
37997
38139
  unit: "ml",
@@ -38026,8 +38168,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
38026
38168
  }
38027
38169
  ],
38028
38170
  estimated: [
38029
- "parts"
38030
- ]
38171
+ "parts",
38172
+ "fluid"
38173
+ ],
38174
+ fluid: {
38175
+ liquid: "bleach",
38176
+ liters: 1
38177
+ }
38031
38178
  },
38032
38179
  {
38033
38180
  id: "sponge",
@@ -38630,7 +38777,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
38630
38777
  stack: 1,
38631
38778
  shape: "can",
38632
38779
  color: 15261904,
38633
- rarity: "common"
38780
+ rarity: "common",
38781
+ estimated: [
38782
+ "fluid"
38783
+ ],
38784
+ fluid: {
38785
+ liquid: "paint",
38786
+ liters: 3.6
38787
+ }
38634
38788
  },
38635
38789
  {
38636
38790
  id: "ice_pack",
@@ -38990,8 +39144,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
38990
39144
  }
38991
39145
  ],
38992
39146
  estimated: [
38993
- "parts"
38994
- ]
39147
+ "parts",
39148
+ "fluid"
39149
+ ],
39150
+ fluid: {
39151
+ liquid: "disinfectant",
39152
+ liters: 0.5
39153
+ }
38995
39154
  },
38996
39155
  {
38997
39156
  id: "seasoning",
@@ -39211,8 +39370,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39211
39370
  }
39212
39371
  ],
39213
39372
  estimated: [
39214
- "parts"
39215
- ]
39373
+ "parts",
39374
+ "powder"
39375
+ ],
39376
+ powder: {
39377
+ color: 15659508
39378
+ }
39216
39379
  },
39217
39380
  {
39218
39381
  id: "broom",
@@ -39324,8 +39487,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39324
39487
  }
39325
39488
  ],
39326
39489
  estimated: [
39327
- "parts"
39328
- ]
39490
+ "parts",
39491
+ "fluid"
39492
+ ],
39493
+ fluid: {
39494
+ liquid: "fabric_softener",
39495
+ liters: 2
39496
+ }
39329
39497
  },
39330
39498
  {
39331
39499
  id: "clothespins",
@@ -39752,9 +39920,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39752
39920
  shed: false
39753
39921
  },
39754
39922
  use: {
39755
- clip: "open_can_eat",
39923
+ clip: "eat_food",
39756
39924
  sounds: [
39757
- "can_open",
39758
39925
  "chew"
39759
39926
  ]
39760
39927
  },
@@ -39922,9 +40089,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39922
40089
  shed: false
39923
40090
  },
39924
40091
  use: {
39925
- clip: "open_can_drink",
40092
+ clip: "drink",
39926
40093
  sounds: [
39927
- "can_open",
39928
40094
  "gulp"
39929
40095
  ]
39930
40096
  },
@@ -44233,6 +44399,17 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
44233
44399
  clip: "turn_key"
44234
44400
  }
44235
44401
  },
44402
+ {
44403
+ id: "eat_with_cutlery",
44404
+ effect: "eat_with",
44405
+ consumes: false,
44406
+ items: [
44407
+ "cutlery"
44408
+ ],
44409
+ params: {
44410
+ clip: "eat_with_cutlery"
44411
+ }
44412
+ },
44236
44413
  {
44237
44414
  id: "swap_bag",
44238
44415
  effect: "swap_bag",
@@ -44417,7 +44594,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
44417
44594
  var liquidContainer = {
44418
44595
  id: "liquid_container",
44419
44596
  check: (item) => {
44420
- const fluid = item.fluid;
44597
+ const fluid = itemFluid(item);
44421
44598
  if (fluid) {
44422
44599
  const problems = [];
44423
44600
  if (typeof fluid.liquid !== "string" || !SNAKE_CASE.test(fluid.liquid)) problems.push("fluid.liquid must be a liquid id");
@@ -45539,7 +45716,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
45539
45716
  };
45540
45717
  var GOODS_STRINGS = { en: en_default2, "pt-BR": pt_BR_default2 };
45541
45718
  var drinkHydrationOf = (item, liquids = LIQUIDS) => {
45542
- const fluid = item.fluid;
45719
+ const fluid = itemFluid(item);
45543
45720
  const drink = fluid ? liquids.find((liquid) => liquid.id === fluid.liquid)?.drink : void 0;
45544
45721
  if (!fluid || !drink) return void 0;
45545
45722
  const doses = item.durability?.kind === "doses" ? Math.max(1, item.durability.amount ?? 1) : 1;
@@ -48293,8 +48470,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
48293
48470
  { type: "tv_unit", category: "tv_unit", w: 1.6, d: 0.45, h: 0.55, opening: 0.4 },
48294
48471
  { type: "tv_unit_small", category: "tv_unit", w: 1.2, d: 0.4, h: 0.5, opening: 0.4 },
48295
48472
  { type: "tv_unit_large", category: "tv_unit", w: 1.9, d: 0.45, h: 0.6, opening: 0.4 },
48296
- { type: "tv", category: "tv", w: 0.9, d: 0.1, h: 0.55 },
48297
- { type: "tv_large", category: "tv", w: 1.2, d: 0.1, h: 0.7 },
48473
+ { type: "tv", category: "tv", w: 0.9, d: 0.1, h: 0.55, massKg: 12, partMaterials: { metal_0: "glass" } },
48474
+ { type: "tv_large", category: "tv", w: 1.2, d: 0.1, h: 0.7, massKg: 16, partMaterials: { metal_0: "glass" } },
48298
48475
  { type: "coffee_table", category: "coffee_table", w: 0.9, d: 0.55, h: 0.42 },
48299
48476
  { type: "coffee_table_round", category: "coffee_table", w: 0.6, d: 0.6, h: 0.4 },
48300
48477
  { type: "rug", category: "rug", w: 2.4, d: 1.7, h: 0.02, flat: true, color: { role: "fabric_accent" } },
@@ -48319,7 +48496,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
48319
48496
  { type: "dining_table", category: "dining_table", w: 1.1, d: 0.8, h: 0.78 },
48320
48497
  { type: "dining_table_small", category: "dining_table", w: 0.9, d: 0.7, h: 0.75 },
48321
48498
  { type: "dining_table_round", category: "dining_table", w: 0.9, d: 0.9, h: 0.75 },
48322
- { type: "microwave", category: "appliance", w: 0.5, d: 0.4, h: 0.3, color: { role: "metal" } },
48499
+ { type: "microwave", category: "appliance", w: 0.5, d: 0.4, h: 0.3, color: { role: "metal" }, material: "steel", massKg: 14 },
48323
48500
  { type: "trash_bin", category: "trash_bin", w: 0.3, d: 0.3, h: 0.6 },
48324
48501
  { type: "pantry", category: "pantry", w: 1.2, d: 0.4, h: 2, opening: 0.5 },
48325
48502
  { type: "double_bed", category: "bed", w: 1.6, d: 2.05, h: 0.62, color: { role: "fabric_main" } },
@@ -48340,7 +48517,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
48340
48517
  { type: "shower_large", category: "shower", windowHeight: 1.95, w: 1.1, d: 1.1, h: 0.1, color: { role: "ceiling" } },
48341
48518
  { type: "hamper", category: "hamper", w: 0.35, d: 0.3, h: 0.5 },
48342
48519
  { type: "laundry_tub", category: "laundry_tub", w: 0.6, d: 0.55, h: 0.9, color: { role: "metal" } },
48343
- { type: "washing_machine", category: "washing_machine", w: 0.6, d: 0.65, h: 0.9, opening: 0.5, color: { role: "metal" } },
48520
+ { type: "washing_machine", category: "washing_machine", w: 0.6, d: 0.65, h: 0.9, opening: 0.5, color: { role: "metal" }, material: "steel", massKg: 70 },
48344
48521
  { type: "laundry_cabinet", category: "laundry_cabinet", w: 0.8, d: 0.4, h: 1.8, opening: 0.45 },
48345
48522
  { type: "laundry_shelf", category: "laundry_shelf", w: 1, d: 0.35, h: 1.6 },
48346
48523
  { type: "car", category: "car", w: 1.85, d: 4.3, h: 1.5, color: { pick: [1842206, 15263974, 10132897, 8003359, 2046559, 4016698, 12103834] } },
@@ -49471,7 +49648,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
49471
49648
  }
49472
49649
  var residentialTower = residentialTowerTemplate();
49473
49650
 
49474
- // ../game-floorplan-three/dist/chunk-BTAHA26H.js
49651
+ // ../game-floorplan-three/dist/chunk-LEMQWENS.js
49475
49652
  var __defProp3 = Object.defineProperty;
49476
49653
  var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp3(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
49477
49654
  var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
@@ -49486,6 +49663,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
49486
49663
  "what.door": "the door",
49487
49664
  "what.curtain": "the curtain",
49488
49665
  "what.mailbox": "the mailbox",
49666
+ "what.lid": "the lid",
49667
+ "what.tankLid": "the tank lid",
49489
49668
  "what.stallDoor": "the shower door",
49490
49669
  "what.pedestrianGate": "the small gate",
49491
49670
  "what.garageGate": "the garage gate",
@@ -49514,6 +49693,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
49514
49693
  "what.door": "a porta",
49515
49694
  "what.curtain": "a cortina",
49516
49695
  "what.mailbox": "a caixa de correio",
49696
+ "what.lid": "a tampa",
49697
+ "what.tankLid": "a tampa da caixa d'\xE1gua",
49517
49698
  "what.stallDoor": "a porta do box",
49518
49699
  "what.pedestrianGate": "o port\xE3ozinho",
49519
49700
  "what.garageGate": "o port\xE3o da garagem",
@@ -50272,13 +50453,23 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
50272
50453
  (groups[A.group] || (groups[A.group] = new THREE.Group())).add(m);
50273
50454
  }
50274
50455
  cursor.accs.clear();
50456
+ const owners = /* @__PURE__ */ new Map();
50275
50457
  for (const P of PARTS) {
50276
50458
  const g = groups[P.name] || new THREE.Group();
50277
50459
  delete groups[P.name];
50278
- g.name = P.name;
50279
- g.position.set(P.pos[0], P.pos[1], P.pos[2]);
50280
- g.rotation.y = P.ry || 0;
50460
+ const owner = owners.get(P.parent), ry = P.ry || 0;
50461
+ if (owner) {
50462
+ const dx = P.pos[0] - owner.pos[0], dz = P.pos[2] - owner.pos[2], c = Math.cos(owner.ry), s = Math.sin(owner.ry);
50463
+ g.name = P.name;
50464
+ g.position.set(dx * c - dz * s, P.pos[1] - owner.pos[1], dx * s + dz * c);
50465
+ g.rotation.y = ry - owner.ry;
50466
+ } else {
50467
+ g.name = P.name;
50468
+ g.position.set(P.pos[0], P.pos[1], P.pos[2]);
50469
+ g.rotation.y = ry;
50470
+ }
50281
50471
  g.updateMatrix();
50472
+ owners.set(P.name, { g, pos: P.pos, ry });
50282
50473
  Object.assign(g.userData, P.meta, { part: P.type, pivot: true, ...P.stage ? { constructionStage: P.stage } : {} });
50283
50474
  g.traverse((o) => {
50284
50475
  if (o !== g) o.userData.part = P.type;
@@ -50289,7 +50480,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
50289
50480
  applyPart(g, 0);
50290
50481
  if (P.meta.t0) applyPart(g, P.meta.t0);
50291
50482
  }
50292
- (groups[P.parent] || (groups[P.parent] = new THREE.Group())).add(g);
50483
+ (owner ? owner.g : groups[P.parent] || (groups[P.parent] = new THREE.Group())).add(g);
50293
50484
  if (P.meta.id) (shared2.ctx.parts || (shared2.ctx.parts = {}))[P.meta.id] = g;
50294
50485
  }
50295
50486
  PARTS.length = 0;
@@ -55286,9 +55477,15 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
55286
55477
  for (const sx of [-1, 1]) for (const sz of [-1, 1]) lb("wood", sx * (w / 2 - 0.06), 0, sz * (d / 2 - 0.06), 0.05, h - 0.04, 0.05, sh(wood, 0.75));
55287
55478
  }
55288
55479
  if (o.tablecloth) lb("fabric", 0, h, 0, w * 0.7, 5e-3, d * 0.95, paletteColor(M, "fabric_accent", 14207144));
55480
+ if (o.drawer && !o.round && !M.visorScene) {
55481
+ const cw = Math.min(0.42, w / 2 - 0.175), cx = w / 2 - 0.1 - cw / 2, ch = 0.14, cy = h - 0.04 - ch, back2 = -d / 2 + 0.1, front = d / 2 - 0.01;
55482
+ lb("wood", cx, cy, (back2 + front) / 2, cw, ch, front - back2, sh(wood, 0.9));
55483
+ lb("wood", cx, cy + 0.015, front + 5e-3, cw - 0.03, ch - 0.03, 0.012, sh(wood, 1.12));
55484
+ lc("metal", cx, cy + ch / 2 - 0.015, front + 0.02, 0.015, 0.02, 11575408, PE);
55485
+ }
55289
55486
  if (o.noChairs) return;
55290
55487
  const chair = (u, v, g) => {
55291
- const C = { x: M.x + u * Math.cos(M.ry) + v * Math.sin(M.ry), z: M.z - u * Math.sin(M.ry) + v * Math.cos(M.ry), ry: M.ry + g, base: M.base, palette: M.palette }, k = kk(C, A);
55488
+ const C = { x: M.x + u * Math.cos(M.ry) + v * Math.sin(M.ry), z: M.z - u * Math.sin(M.ry) + v * Math.cos(M.ry), ry: M.ry + g, base: M.base, palette: M.palette, chair: true }, k = kk(C, A);
55292
55489
  k.b("wood", 0, 0.44, 0, 0.42, 0.04, 0.42, chairColor);
55293
55490
  for (const sx of [-1, 1]) for (const sz of [-1, 1]) k.b("wood", sx * 0.18, 0, sz * 0.18, 0.035, 0.44, 0.035, sh(chairColor, 0.7));
55294
55491
  k.b("wood", 0, 0.48, -0.19, 0.42, 0.45, 0.03, chairColor);
@@ -55503,9 +55700,26 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
55503
55700
  lb("plain", 0, h - 0.18, d / 2 + 5e-3, w - 0.1, 0.1, 0.01, 3816e3);
55504
55701
  },
55505
55702
  hamper(M, A) {
55506
- const { c: lc } = kk(M, A), r = M.visorScene ? M.w / 2 : Math.min(M.w, M.d) / 2;
55507
- lc("plain", 0, 0, 0, r, M.h, paletteColor(M, "fabric_accent", 10127978));
55508
- lc("plain", 0, M.h - 0.01, 0, r - 0.03, 0.02, 2763306);
55703
+ if (M.visorScene) {
55704
+ const { c: lc } = kk(M, A), r23 = M.w / 2;
55705
+ lc("plain", 0, 0, 0, r23, M.h, paletteColor(M, "fabric_accent", 10127978));
55706
+ lc("plain", 0, M.h - 0.01, 0, r23 - 0.03, 0.02, 2763306);
55707
+ return;
55708
+ }
55709
+ const K2 = kit2(M, A), r = Math.min(M.w, M.d) / 2, color2 = paletteColor(M, "fabric_accent", 10127978), rim = M.h - 0.03;
55710
+ K2.c("plain", 0, 0, 0, r, rim, color2);
55711
+ K2.c("plain", 0, rim, 0, r - 0.03, 2e-3, 2763306);
55712
+ K2.part(
55713
+ "lid",
55714
+ 0,
55715
+ rim + 5e-3,
55716
+ -r,
55717
+ () => {
55718
+ K2.c("plain", 0, rim + 5e-3, 0, r + 5e-3, 0.025, sh(color2, 0.9));
55719
+ K2.c("plain", 0, M.h, r * 0.7, 0.02, 0.012, sh(color2, 0.6));
55720
+ },
55721
+ { id: "lid_" + M.seed, lid: { hand: [0, 0.03, r * 1.7] }, opens: { type: "swing", axis: [1, 0, 0], angle: -1.75 } }
55722
+ );
55509
55723
  },
55510
55724
  // (outside the Visor's scene the round basket fits its footprint's narrow side: it stood 2.5 cm in the wall behind it)
55511
55725
  trash_bin(M, A) {
@@ -55801,9 +56015,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
55801
56015
  mine("outdoor_table", (M, A) => FURNITURE.table(M, A, { headboard: true }));
55802
56016
  mine("gourmet_table", (M, A) => FURNITURE.table(M, A, { headboard: true }));
55803
56017
  mine("gourmet_table_small", (M, A) => FURNITURE.table(M, A, {}));
55804
- mine("office_desk", (M, A) => FURNITURE.table(M, A, { oneSide: true }));
55805
- mine("office_desk_large", (M, A) => FURNITURE.table(M, A, { oneSide: true }));
55806
- mine("desk", (M, A) => FURNITURE.table(M, A, { oneSide: true }));
56018
+ mine("office_desk", (M, A) => FURNITURE.table(M, A, { oneSide: true, drawer: true }));
56019
+ mine("office_desk_large", (M, A) => FURNITURE.table(M, A, { oneSide: true, drawer: true }));
56020
+ mine("desk", (M, A) => FURNITURE.table(M, A, { oneSide: true, drawer: true }));
55807
56021
  mine("double_bed", FURNITURE.bed);
55808
56022
  mine("queen_bed", FURNITURE.bed);
55809
56023
  mine("king_bed", FURNITURE.bed);
@@ -56330,8 +56544,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
56330
56544
  K2.c("plain", 0, y0, 0, r, th, color2);
56331
56545
  for (const f of [0.18, 0.5, 0.82]) K2.c("plain", 0, y0 + th * f - 0.025, 0, r * 1.028, 0.05, sh(color2, 0.88));
56332
56546
  K2.e("plain", 0, y0 + th + 0.03, 0, r * 1, 0.16, sh(color2, 0.95));
56333
- K2.c("plain", 0, y0 + th + 0.09, 0, r * 0.5, 0.05, sh(color2, 0.8));
56334
- K2.c("plain", 0, y0 + th + 0.14, 0, r * 0.18, 0.035, 1916262);
56547
+ const hatch = () => {
56548
+ K2.c("plain", 0, y0 + th + 0.09, 0, r * 0.5, 0.05, sh(color2, 0.8));
56549
+ K2.c("plain", 0, y0 + th + 0.14, 0, r * 0.18, 0.035, 1916262);
56550
+ };
56551
+ if (shared2.ctx.visorScene) hatch();
56552
+ else K2.part("lid", 0, y0 + th + 0.09, -r * 0.5, hatch, { id: "lid_" + M.seed, lid: { hand: [0, 0.06, r * 0.9] }, opens: { type: "swing", axis: [1, 0, 0], angle: -1.75 } });
56335
56553
  }, { id: "tank_" + M.seed, breakable: true, fluid: "water", volume: Math.PI * r * r * th, radius: r, height: th });
56336
56554
  K2.t("metal", [r * 0.7, y0 + th * 0.25, 0], [r * 0.7, y0 + 0.03, 0], 0.02, 3159096);
56337
56555
  K2.t("metal", [r * 0.7, y0 + 0.03, 0], [r * 0.7 + 0.2, y0 + 0.03, 0], 0.02, 3159096);
@@ -57241,6 +57459,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
57241
57459
  sauna: ({ d }) => [{ id: "bench", pose: "sit", pos: [0, SAUNA_BENCH, -d / 4], ry: 0, exit: [0, 0, d / 2 + 0.5] }]
57242
57460
  };
57243
57461
  var planFurnitureSeats = (type, size) => PLAN_FURNITURE_SEATS[type]?.(size) ?? [];
57462
+ var PLAN_FURNITURE_HAND_PARTS = {
57463
+ desk: "drawer",
57464
+ office_desk: "drawer",
57465
+ office_desk_large: "drawer",
57466
+ vanity_table: "drawer",
57467
+ hamper: "lid",
57468
+ water_tank: "lid"
57469
+ };
57244
57470
  function installInteractionItems(K, shared2) {
57245
57471
  const { t, LIGHTS, cursor, definePiece, localOf, registerCollision, togglePiece } = K;
57246
57472
  const DOOR_ITEM = /^(tv_unit|tv_unit_small|tv_unit_large|sideboard|china_cabinet|filing_cabinet|pantry|laundry_cabinet|wardrobe|wardrobe_small|wardrobe_large|closet_wardrobe|kitchen_cabinet|kitchen_cabinet_large|kitchen_cabinet_small|fridge|fridge_large|display_fridge_medium|display_fridge)$/;
@@ -57263,7 +57489,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
57263
57489
  seatItem(m, M);
57264
57490
  if (LIGHT_TYPES.has(type)) return lightItem(m, M, ent, api, parent);
57265
57491
  if (type === "curtain") return curtainItem(m, M, ent, api, parent);
57266
- if (DOOR_ITEM.test(type) || DRAWER_ITEM.test(type)) return furnitureItem(m, M, ent, api, parent, DRAWER_ITEM.test(type));
57492
+ const drawer2 = DRAWER_ITEM.test(type) || !M.visorScene && PLAN_FURNITURE_HAND_PARTS[type] === "drawer";
57493
+ if (DOOR_ITEM.test(type) || drawer2) return furnitureItem(m, M, ent, api, parent, drawer2);
57267
57494
  ent.f(M, api);
57268
57495
  }
57269
57496
  function seatItem(m, M) {
@@ -57485,6 +57712,21 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
57485
57712
  applyPiece(def);
57486
57713
  }
57487
57714
  }
57715
+ function lidsInteractive() {
57716
+ const parts2 = shared2.ctx.parts;
57717
+ if (!parts2) return;
57718
+ for (const m of house().items) {
57719
+ const g = parts2["lid_" + m.id];
57720
+ if (!g) continue;
57721
+ const lid = g.userData.lid, hand = lid?.hand ?? [0, 0, 0];
57722
+ const def = definePiece("ix:lid:" + m.id, { kind: "part", pivot: [0, 0, 0], ry: 0, parent: "lot" });
57723
+ def.inner = g;
57724
+ g.updateWorldMatrix(true, false);
57725
+ const at2 = g.localToWorld(new K.THREE.Vector3(hand[0], hand[1], hand[2]));
57726
+ I().items.push({ type: "lid", id: m.id, floor: m.floor ?? 0, anchor: [at2.x, at2.y, at2.z], range: 1.6, angle: 0.9, pieces: [def], text: () => t(def.target > 0.5 ? "prompt.close" : "prompt.open", { what: t("what." + (m.type === "water_tank" ? "tankLid" : "lid")) }), action: () => togglePiece(def) });
57727
+ applyPiece(def);
57728
+ }
57729
+ }
57488
57730
  function placeSwitches() {
57489
57731
  const R = house(), used = /* @__PURE__ */ new Set();
57490
57732
  for (const c of R.rooms) {
@@ -57538,7 +57780,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
57538
57780
  }
57539
57781
  return false;
57540
57782
  }
57541
- const defined = { walkInInteractive, gatesInteractive, mailboxInteractive, placeSwitches, putSwitch };
57783
+ const defined = { walkInInteractive, gatesInteractive, mailboxInteractive, lidsInteractive, placeSwitches, putSwitch };
57542
57784
  Object.assign(K, defined);
57543
57785
  }
57544
57786
  function installInteractionDoors(K, shared2) {
@@ -61529,7 +61771,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
61529
61771
  return { u: P.u - Math.sign(P.frontU || 0) * PANEL_RECESS, v: P.v - Math.sign(P.frontV || 0) * PANEL_RECESS, y0: P.y - h / 2 + PANEL_LIFT - BOX_CHASE_CLEAR, y1: P.y + h / 2 + PANEL_LIFT + BOX_CHASE_CLEAR, radius: w / 2, depth: 0 };
61530
61772
  }
61531
61773
  function installBuildBuild(K, shared2) {
61532
- const { THREE, cfg, rectsOf: rectsOf2, invalidateShadow, colliderChanged, VERSION: VERSION2, CARS, EPS: EPS42, LIGHTS, MIRRORS, Y0, animateClotheslines, animateDoors, animateInteractive, applyLeaf, applyOutbuildings, applyPart, applyPiece, assembleInteractive, baseboardAndSidewalk, buildStairs, building, carModel, chooseMirror, closeScene, collideAt, createWater, cursor, doorText, doors, electricalStructure, elevator, floorsAndSlabs, gatesInteractive, houseItems, ivAssemble, ivBuild, ivDispose, ivParts, ivPublish, ivUpdate, lightOn, linkDoorLeaves, mailboxInteractive, walkInInteractive, newInteractiveState, newMirrorState, outbuildings, paths, perimeter, placeSwitches, roofs, roomAt, solar, targetOf, terrain, toggleDoor, toggleLight, walls, waterPipes, drainPipes, windows, props, TYPES, IVK, VEG, vegMaterials, markGroups, assembleStructure, pieceRecord, createHouseDestruction, newState, enter, tagDamage } = K;
61774
+ const { THREE, cfg, rectsOf: rectsOf2, invalidateShadow, colliderChanged, VERSION: VERSION2, CARS, EPS: EPS42, LIGHTS, MIRRORS, Y0, animateClotheslines, animateDoors, animateInteractive, applyLeaf, applyOutbuildings, applyPart, applyPiece, assembleInteractive, baseboardAndSidewalk, buildStairs, building, carModel, chooseMirror, closeScene, collideAt, createWater, cursor, doorText, doors, electricalStructure, elevator, floorsAndSlabs, gatesInteractive, houseItems, ivAssemble, ivBuild, ivDispose, ivParts, ivPublish, ivUpdate, lightOn, linkDoorLeaves, mailboxInteractive, lidsInteractive, walkInInteractive, newInteractiveState, newMirrorState, outbuildings, paths, perimeter, placeSwitches, roofs, roomAt, solar, targetOf, terrain, toggleDoor, toggleLight, walls, waterPipes, drainPipes, windows, props, TYPES, IVK, VEG, vegMaterials, markGroups, assembleStructure, pieceRecord, createHouseDestruction, newState, enter, tagDamage } = K;
61533
61775
  function build(r0, options) {
61534
61776
  const opts = options || {};
61535
61777
  const r = withLaidConduits(applyOutbuildings(r0), !!(opts.constructionStages || opts.constructionLevel != null));
@@ -61676,6 +61918,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
61676
61918
  assembleInteractive(gs);
61677
61919
  linkDoorLeaves();
61678
61920
  mailboxInteractive();
61921
+ lidsInteractive();
61679
61922
  walkInInteractive();
61680
61923
  if (cs) {
61681
61924
  for (const def of shared2.inter.defs.values()) {
@@ -62339,7 +62582,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
62339
62582
  }
62340
62583
  }
62341
62584
  if (!best) return null;
62342
- const [joint] = inferJoints([best.a, best.b], best.gap + 0.05);
62585
+ const [joint] = inferJoints([best.a, best.b], Infinity);
62343
62586
  return joint ? { ...joint, id: `${best.a.id}~${best.b.id}` } : null;
62344
62587
  }
62345
62588
  var FLOOR_TOUCH = 5e-3;
@@ -62804,7 +63047,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
62804
63047
  return [M.x + lx * c + lz * s, M.z - lx * s + lz * c];
62805
63048
  };
62806
63049
  const record = (M, key2, shape, px, py, pz, rx, ry, rz, color2) => {
62807
- if (o.chairs === false && M !== root || key2 === "water") return;
63050
+ if (o.chairs === false && M.chair === true || key2 === "water") return;
62808
63051
  q.setFromEuler(eul.set(rx, ry, rz, "YXZ"));
62809
63052
  const turned = rx !== 0 || ry !== 0 || rz !== 0;
62810
63053
  const size = shape.kind === "box" ? shape.size : shape.kind === "cylinder" ? [shape.radius * 2, shape.height, shape.radius * 2] : [shape.radius * 2, shape.radius * 2, shape.radius * 2];
@@ -62850,7 +63093,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
62850
63093
  const boardsOf = splitTopsIntoBoards(drawn, materialOf, Boolean(opts.carcass));
62851
63094
  const parts2 = drawn.map((p) => {
62852
63095
  const thin = Math.min(...p.shape.kind === "box" ? p.shape.size : p.shape.kind === "cylinder" ? [p.shape.radius * 2, p.shape.height] : [p.shape.radius * 2]);
62853
- let material = p.material ?? materialOf[p.key] ?? "plastic";
63096
+ let material = p.material ?? opts.byPart?.[p.id] ?? materialOf[p.key] ?? "plastic";
62854
63097
  if (p.material) {
62855
63098
  } else if (p.key === "wood" && material === "wood_hard" && opts.carcass && !opts.materials?.wood) material = "mdf";
62856
63099
  else if (p.key === "wood" && material === "wood_hard" && thin < WOOD_THIN) material = "wood_soft";
@@ -62973,12 +63216,25 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
62973
63216
  shared2.ctx = saved.ctx;
62974
63217
  }
62975
63218
  },
62976
- { materials: { plain: plain2, ...o.materials }, chairs: o.chairs, carcass: SHELVING.test(type) }
63219
+ { materials: { plain: plain2, ...o.materials }, chairs: o.chairs, carcass: SHELVING.test(type), ...entry2?.partMaterials ? { byPart: entry2.partMaterials } : {} }
62977
63220
  );
62978
63221
  const spouts = K.PARTS.slice(before).filter((p) => p.type === "water_tap").map((p) => [p.pos[0] - root.x, p.pos[1], p.pos[2] - root.z]);
62979
63222
  K.PARTS.length = before;
63223
+ if (entry2?.massKg !== void 0) shareMass(made2.spec.parts, entry2.massKg);
62980
63224
  return { spec: made2.spec, build: made2.build, top: made2.top, size: { w, d, h }, spouts, fixed: made2.fixed };
62981
63225
  }
63226
+ function shareMass(parts2, massKg) {
63227
+ const own = parts2.map((part) => {
63228
+ const material = MATERIALS2.find((m) => m.id === part.material);
63229
+ const { mass: _drawn, ...bare } = part;
63230
+ return material ? partMass(bare, material) : 0;
63231
+ });
63232
+ const total = own.reduce((sum, kg) => sum + kg, 0);
63233
+ if (!(total > 0)) return;
63234
+ parts2.forEach((part, at2) => {
63235
+ part.mass = Math.round((own[at2] ?? 0) / total * massKg * 1e4) / 1e4;
63236
+ });
63237
+ }
62982
63238
 
62983
63239
  // src/area-layout.ts
62984
63240
  var SHELF_HEIGHT = 0.9;
@@ -63286,7 +63542,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
63286
63542
  };
63287
63543
  const usesOf = (def) => {
63288
63544
  const use = options.itemUse?.(def);
63289
- const contents = fluidOf({ ...def.model === void 0 ? {} : { model: def.model }, size: def.size, weight: def.weight });
63545
+ const held = itemFluid(def);
63546
+ const contents = fluidOf({ ...def.model === void 0 ? {} : { model: def.model }, size: def.size, weight: def.weight, ...held ? { fluid: held } : {} });
63290
63547
  const liquid = sealOf(def, contents.fluid ? contents : vesselOf(def));
63291
63548
  if (!use) return liquid;
63292
63549
  const edible2 = def.category === "food" || def.category === "drink";