@adatechnology/game-weapons-three 0.24.0 → 0.24.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.
- package/dist/index.global.js +300 -139
- package/dist/index.global.js.map +1 -1
- package/package.json +12 -12
package/dist/index.global.js
CHANGED
|
@@ -26168,7 +26168,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26168
26168
|
const dz = Math.max(box5.min[2] - loss.z, 0, loss.z - box5.max[2]);
|
|
26169
26169
|
return Math.hypot(dx, dz) < loss.radius + loss.depth * groundCfg.spread;
|
|
26170
26170
|
};
|
|
26171
|
-
const
|
|
26171
|
+
const footprintOf2 = (o, b, loss) => {
|
|
26172
26172
|
const box5 = aabbOf(b.p.spec.shape, b.p.pos, b.p.q);
|
|
26173
26173
|
const long = box5.max[0] - box5.min[0] >= box5.max[2] - box5.min[2] ? 0 : 2;
|
|
26174
26174
|
const across2 = long === 0 ? 2 : 0;
|
|
@@ -26611,7 +26611,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26611
26611
|
const opened = [];
|
|
26612
26612
|
const settled = [];
|
|
26613
26613
|
let lost = false;
|
|
26614
|
-
const touched = bearersOf(o).filter((b) => nearLoss(o, b.p, loss)).map((b) => ({ b, fp:
|
|
26614
|
+
const touched = bearersOf(o).filter((b) => nearLoss(o, b.p, loss)).map((b) => ({ b, fp: footprintOf2(o, b, loss) })).filter(({ fp }) => fp.share > 0 || fp.drop >= SUBSIDE_MIN);
|
|
26615
26615
|
const bearers = bearersOf(o);
|
|
26616
26616
|
const pillarFirst = (b) => b.p.spec.structure?.role === "column" ? 0 : 1;
|
|
26617
26617
|
const order2 = [...touched].sort((x, y) => pillarFirst(x.b) - pillarFirst(y.b));
|
|
@@ -38854,7 +38854,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
38854
38854
|
kind: "material",
|
|
38855
38855
|
size: [
|
|
38856
38856
|
0.13,
|
|
38857
|
-
0.
|
|
38857
|
+
0.0335,
|
|
38858
38858
|
0.05
|
|
38859
38859
|
],
|
|
38860
38860
|
weight: 0.5,
|
|
@@ -51904,7 +51904,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51904
51904
|
h: 4.4,
|
|
51905
51905
|
y: 0,
|
|
51906
51906
|
solid: true,
|
|
51907
|
-
massKg: 14
|
|
51907
|
+
massKg: 14,
|
|
51908
|
+
fixed: true
|
|
51908
51909
|
},
|
|
51909
51910
|
{
|
|
51910
51911
|
id: "electrical_panel",
|
|
@@ -52759,6 +52760,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
52759
52760
|
// was `maquina`
|
|
52760
52761
|
});
|
|
52761
52762
|
var OWN_TYPES = Object.freeze({ lamp: true, gas_piped: true });
|
|
52763
|
+
var KITCHEN_SINK_WORKTOP = 0.9;
|
|
52762
52764
|
var sourceOf = (result2) => result2;
|
|
52763
52765
|
var ADAPTER_VERSION = "0.3.0";
|
|
52764
52766
|
var r3 = (n) => Math.round(n * 1e3) / 1e3;
|
|
@@ -53149,7 +53151,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
53149
53151
|
list2.push(sink);
|
|
53150
53152
|
let cabinet2 = null;
|
|
53151
53153
|
if (rest2 >= 0.35) {
|
|
53152
|
-
cabinet2 = part(m.id + "#cabinet", "kitchen_cabinet_base", rest2, m.d, m.h, 0, left ? width / 2 - rest2 / 2 : -(width / 2) + rest2 / 2, 0);
|
|
53154
|
+
cabinet2 = part(m.id + "#cabinet", "kitchen_cabinet_base", rest2, m.d, opts.visor ? m.h : KITCHEN_SINK_WORKTOP, 0, left ? width / 2 - rest2 / 2 : -(width / 2) + rest2 / 2, 0);
|
|
53153
53155
|
list2.push(cabinet2);
|
|
53154
53156
|
}
|
|
53155
53157
|
if (contents[m.id]) store(cabinet2 ? [["kitchen_cabinet_base", cabinet2.item], ["sink_kitchen", sink.item]] : [["sink_kitchen", sink.item]], contents[m.id]);
|
|
@@ -53663,9 +53665,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
53663
53665
|
{ type: "sofa_3seat", category: "sofa", w: 2.1, d: 0.9, h: 0.85, color: { role: "fabric_main" } },
|
|
53664
53666
|
{ type: "sofa_2seat", category: "sofa", w: 1.6, d: 0.85, h: 0.85, color: { role: "fabric_main" } },
|
|
53665
53667
|
{ type: "sofa_l", category: "sofa", w: 2.4, d: 0.95, h: 0.85, color: { role: "fabric_main" } },
|
|
53666
|
-
{ type: "tv_unit", category: "tv_unit", w: 1.6, d: 0.45, h: 0.55 },
|
|
53667
|
-
{ type: "tv_unit_small", category: "tv_unit", w: 1.2, d: 0.4, h: 0.5 },
|
|
53668
|
-
{ type: "tv_unit_large", category: "tv_unit", w: 1.9, d: 0.45, h: 0.6 },
|
|
53668
|
+
{ type: "tv_unit", category: "tv_unit", w: 1.6, d: 0.45, h: 0.55, opening: 0.4 },
|
|
53669
|
+
{ type: "tv_unit_small", category: "tv_unit", w: 1.2, d: 0.4, h: 0.5, opening: 0.4 },
|
|
53670
|
+
{ type: "tv_unit_large", category: "tv_unit", w: 1.9, d: 0.45, h: 0.6, opening: 0.4 },
|
|
53669
53671
|
{ type: "tv", category: "tv", w: 0.9, d: 0.1, h: 0.55 },
|
|
53670
53672
|
{ type: "tv_large", category: "tv", w: 1.2, d: 0.1, h: 0.7 },
|
|
53671
53673
|
{ type: "coffee_table", category: "coffee_table", w: 0.9, d: 0.55, h: 0.42 },
|
|
@@ -53677,33 +53679,33 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
53677
53679
|
{ type: "shelf_unit", category: "shelf_unit", w: 1.4, d: 0.4, h: 1.8 },
|
|
53678
53680
|
{ type: "shelf_unit_small", category: "shelf_unit", w: 1, d: 0.35, h: 1.5 },
|
|
53679
53681
|
{ type: "floor_lamp", category: "lamp", w: 0.3, d: 0.3, h: 1.5 },
|
|
53680
|
-
{ type: "sideboard", category: "sideboard", w: 1.2, d: 0.4, h: 0.85 },
|
|
53682
|
+
{ type: "sideboard", category: "sideboard", w: 1.2, d: 0.4, h: 0.85, opening: 0.4 },
|
|
53681
53683
|
{ type: "console_table", category: "console_table", w: 0.9, d: 0.3, h: 0.85 },
|
|
53682
53684
|
{ type: "bench", category: "bench", w: 1, d: 0.35, h: 0.45 },
|
|
53683
53685
|
{ type: "workbench", category: "workbench", w: 1.2, d: 0.6, h: 0.95 },
|
|
53684
53686
|
{ type: "floor_mirror", category: "mirror", w: 0.5, d: 0.12, h: 1.8 },
|
|
53685
|
-
{ type: "fridge", category: "fridge", w: 0.7, d: 0.68, h: 1.8, color: { role: "metal" } },
|
|
53686
|
-
{ type: "fridge_large", category: "fridge", w: 0.8, d: 0.72, h: 1.85, color: { role: "metal" } },
|
|
53687
|
-
{ type: "stove", category: "stove", w: 0.62, d: 0.6, h: 0.95, color: { role: "metal" } },
|
|
53688
|
-
{ type: "stove_4burner", category: "stove", w: 0.7, d: 0.62, h: 0.95, color: { role: "metal" } },
|
|
53689
|
-
{ type: "kitchen_cabinet", category: "kitchen_cabinet", overhead: true, w: 1.6, d: 0.6, h: 0.95, color: { role: "metal" } },
|
|
53690
|
-
{ type: "kitchen_cabinet_large", category: "kitchen_cabinet", overhead: true, w: 2, d: 0.6, h: 0.95, color: { role: "metal" } },
|
|
53691
|
-
{ type: "kitchen_cabinet_small", category: "kitchen_cabinet", overhead: true, w: 1.2, d: 0.6, h: 0.95, color: { role: "metal" } },
|
|
53687
|
+
{ type: "fridge", category: "fridge", w: 0.7, d: 0.68, h: 1.8, opening: 0.6, color: { role: "metal" } },
|
|
53688
|
+
{ type: "fridge_large", category: "fridge", w: 0.8, d: 0.72, h: 1.85, opening: 0.6, color: { role: "metal" } },
|
|
53689
|
+
{ type: "stove", category: "stove", w: 0.62, d: 0.6, h: 0.95, opening: 0.5, color: { role: "metal" } },
|
|
53690
|
+
{ type: "stove_4burner", category: "stove", w: 0.7, d: 0.62, h: 0.95, opening: 0.5, color: { role: "metal" } },
|
|
53691
|
+
{ type: "kitchen_cabinet", category: "kitchen_cabinet", overhead: true, w: 1.6, d: 0.6, h: 0.95, opening: 0.5, color: { role: "metal" } },
|
|
53692
|
+
{ type: "kitchen_cabinet_large", category: "kitchen_cabinet", overhead: true, w: 2, d: 0.6, h: 0.95, opening: 0.5, color: { role: "metal" } },
|
|
53693
|
+
{ type: "kitchen_cabinet_small", category: "kitchen_cabinet", overhead: true, w: 1.2, d: 0.6, h: 0.95, opening: 0.5, color: { role: "metal" } },
|
|
53692
53694
|
{ type: "dining_table", category: "dining_table", w: 1.1, d: 0.8, h: 0.78 },
|
|
53693
53695
|
{ type: "dining_table_small", category: "dining_table", w: 0.9, d: 0.7, h: 0.75 },
|
|
53694
53696
|
{ type: "dining_table_round", category: "dining_table", w: 0.9, d: 0.9, h: 0.75 },
|
|
53695
53697
|
{ type: "microwave", category: "appliance", w: 0.5, d: 0.4, h: 0.3, color: { role: "metal" } },
|
|
53696
53698
|
{ type: "trash_bin", category: "trash_bin", w: 0.3, d: 0.3, h: 0.6 },
|
|
53697
|
-
{ type: "pantry", category: "pantry", w: 1.2, d: 0.4, h: 2 },
|
|
53699
|
+
{ type: "pantry", category: "pantry", w: 1.2, d: 0.4, h: 2, opening: 0.5 },
|
|
53698
53700
|
{ type: "double_bed", category: "bed", w: 1.6, d: 2.05, h: 0.62, color: { role: "fabric_main" } },
|
|
53699
53701
|
{ type: "queen_bed", category: "bed", w: 1.8, d: 2.1, h: 0.62, color: { role: "fabric_main" } },
|
|
53700
53702
|
{ type: "single_bed", category: "bed", w: 0.95, d: 2, h: 0.55, color: { role: "fabric_main" } },
|
|
53701
53703
|
{ type: "king_bed", category: "bed_king", w: 2, d: 2.15, h: 0.65, color: { role: "fabric_main" } },
|
|
53702
|
-
{ type: "nightstand", category: "nightstand", w: 0.45, d: 0.42, h: 0.6 },
|
|
53703
|
-
{ type: "wardrobe", category: "wardrobe", w: 1.6, d: 0.6, h: 2 },
|
|
53704
|
-
{ type: "wardrobe_small", category: "wardrobe", w: 1, d: 0.55, h: 1.9 },
|
|
53705
|
-
{ type: "wardrobe_large", category: "wardrobe_large", w: 2.4, d: 0.65, h: 2.1 },
|
|
53706
|
-
{ type: "dresser", category: "dresser", w: 1, d: 0.45, h: 0.85 },
|
|
53704
|
+
{ type: "nightstand", category: "nightstand", w: 0.45, d: 0.42, h: 0.6, opening: 0.45 },
|
|
53705
|
+
{ type: "wardrobe", category: "wardrobe", w: 1.6, d: 0.6, h: 2, opening: 0.5 },
|
|
53706
|
+
{ type: "wardrobe_small", category: "wardrobe", w: 1, d: 0.55, h: 1.9, opening: 0.5 },
|
|
53707
|
+
{ type: "wardrobe_large", category: "wardrobe_large", w: 2.4, d: 0.65, h: 2.1, opening: 0.5 },
|
|
53708
|
+
{ type: "dresser", category: "dresser", w: 1, d: 0.45, h: 0.85, opening: 0.5 },
|
|
53707
53709
|
{ type: "desk", category: "desk", w: 1.1, d: 0.6, h: 0.75 },
|
|
53708
53710
|
{ type: "vanity_table", category: "vanity_table", w: 1, d: 0.5, h: 0.8 },
|
|
53709
53711
|
{ type: "toilet", category: "toilet", w: 0.4, d: 0.62, h: 0.75, color: { role: "ceiling" } },
|
|
@@ -53713,8 +53715,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
53713
53715
|
{ type: "shower_large", category: "shower", windowHeight: 1.95, w: 1.1, d: 1.1, h: 0.1, color: { role: "ceiling" } },
|
|
53714
53716
|
{ type: "hamper", category: "hamper", w: 0.35, d: 0.3, h: 0.5 },
|
|
53715
53717
|
{ type: "laundry_tub", category: "laundry_tub", w: 0.6, d: 0.55, h: 0.9, color: { role: "metal" } },
|
|
53716
|
-
{ type: "washing_machine", category: "washing_machine", w: 0.6, d: 0.65, h: 0.9, color: { role: "metal" } },
|
|
53717
|
-
{ type: "laundry_cabinet", category: "laundry_cabinet", w: 0.8, d: 0.4, h: 1.8 },
|
|
53718
|
+
{ type: "washing_machine", category: "washing_machine", w: 0.6, d: 0.65, h: 0.9, opening: 0.5, color: { role: "metal" } },
|
|
53719
|
+
{ type: "laundry_cabinet", category: "laundry_cabinet", w: 0.8, d: 0.4, h: 1.8, opening: 0.45 },
|
|
53718
53720
|
{ type: "laundry_shelf", category: "laundry_shelf", w: 1, d: 0.35, h: 1.6 },
|
|
53719
53721
|
{ type: "car", category: "car", w: 1.85, d: 4.3, h: 1.5, color: { pick: [1842206, 15263974, 10132897, 8003359, 2046559, 4016698, 12103834] } },
|
|
53720
53722
|
{ type: "car_small", category: "car", w: 1.7, d: 3.8, h: 1.45, color: { pick: [1842206, 15263974, 10132897, 8003359, 2046559, 4016698, 12103834] } },
|
|
@@ -53724,10 +53726,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
53724
53726
|
{ type: "office_desk", category: "office_desk", w: 1.4, d: 0.7, h: 0.75 },
|
|
53725
53727
|
{ type: "office_desk_large", category: "office_desk", w: 1.6, d: 0.8, h: 0.75 },
|
|
53726
53728
|
{ type: "bookcase", category: "bookcase", w: 1.2, d: 0.35, h: 2 },
|
|
53727
|
-
{ type: "filing_cabinet", category: "filing_cabinet", w: 0.5, d: 0.6, h: 1.3 },
|
|
53729
|
+
{ type: "filing_cabinet", category: "filing_cabinet", w: 0.5, d: 0.6, h: 1.3, opening: 0.5 },
|
|
53728
53730
|
{ type: "dining_table_large", category: "dining_table_large", w: 2.4, d: 1.1, h: 0.78 },
|
|
53729
|
-
{ type: "buffet", category: "buffet", w: 1.6, d: 0.5, h: 0.9 },
|
|
53730
|
-
{ type: "china_cabinet", category: "china_cabinet", w: 1.2, d: 0.45, h: 2 },
|
|
53731
|
+
{ type: "buffet", category: "buffet", w: 1.6, d: 0.5, h: 0.9, opening: 0.45 },
|
|
53732
|
+
{ type: "china_cabinet", category: "china_cabinet", w: 1.2, d: 0.45, h: 2, opening: 0.45 },
|
|
53731
53733
|
{ type: "stairs", category: "stairs", w: 1, d: 3.2, h: 2.8 },
|
|
53732
53734
|
{ type: "planter_bed", category: "planter_bed", w: 3, d: 0.7, h: 0.4, color: { role: "dirt" } },
|
|
53733
53735
|
{ type: "planter_bed_small", category: "planter_bed", w: 1.8, d: 0.6, h: 0.4, color: { role: "dirt" } },
|
|
@@ -53767,7 +53769,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
53767
53769
|
{ type: "breakfast_bar", category: "breakfast_bar", w: 2, d: 0.55, h: 1, window: true },
|
|
53768
53770
|
{ type: "sauna", category: "sauna", w: 2, d: 2, h: 2.1 },
|
|
53769
53771
|
{ type: "soaking_tub", category: "soaking_tub", w: 1.6, d: 1.6, h: 0.8 },
|
|
53770
|
-
{ type: "closet_wardrobe", category: "wardrobe_large", w: 2, d: 0.6, h: 2.2 },
|
|
53772
|
+
{ type: "closet_wardrobe", category: "wardrobe_large", w: 2, d: 0.6, h: 2.2, opening: 0.5 },
|
|
53771
53773
|
{ type: "sofa_xl", category: "sofa", w: 3, d: 1, h: 0.85, color: { role: "fabric_main" } },
|
|
53772
53774
|
{ type: "gourmet_counter", category: "gourmet", w: 3, d: 0.7, h: 1, window: true, equip: ["bbq_grill", "kitchen_cabinet"] },
|
|
53773
53775
|
{ type: "gourmet_counter_small", category: "gourmet", w: 1.8, d: 0.65, h: 1, window: true, equip: ["bbq_grill", "kitchen_cabinet"] },
|
|
@@ -54844,7 +54846,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
54844
54846
|
}
|
|
54845
54847
|
var residentialTower = residentialTowerTemplate();
|
|
54846
54848
|
|
|
54847
|
-
// ../game-floorplan-three/dist/chunk-
|
|
54849
|
+
// ../game-floorplan-three/dist/chunk-FDMQUIRF.js
|
|
54848
54850
|
var __defProp4 = Object.defineProperty;
|
|
54849
54851
|
var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp4(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
54850
54852
|
var __publicField2 = (obj, key2, value) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
@@ -56593,10 +56595,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
56593
56595
|
}
|
|
56594
56596
|
function floorLamp(M, A) {
|
|
56595
56597
|
const K2 = kit2(M, A, M.y || 0), color2 = colorTemperature(M), id = "lamp_pe_" + M.seed, h = Math.min(1.6, M.h || 1.5), meta = { id, room: M.room, on: !!M.on, color: color2, lightType: "floor", hidden: !M.on };
|
|
56596
|
-
|
|
56598
|
+
const shade3 = M.visorScene ? 0.17 : Math.min(0.17, Math.min(M.w || 0.34, M.d || 0.34) / 2 - 6e-3);
|
|
56599
|
+
K2.c("metal", 0, 0, 0, Math.min(0.13, shade3), 0.025, 2763308);
|
|
56597
56600
|
K2.c("metal", 0, 0.025, 0, 0.011, h - 0.3, 2763308);
|
|
56598
|
-
K2.c("plain", 0, h - 0.28, 0,
|
|
56599
|
-
K2.part("lamp", 0, h - 0.28, 0, () => K2.c("emissive", 0, h - 0.28, 0,
|
|
56601
|
+
K2.c("plain", 0, h - 0.28, 0, shade3, 0.26, 15656656);
|
|
56602
|
+
K2.part("lamp", 0, h - 0.28, 0, () => K2.c("emissive", 0, h - 0.28, 0, shade3 + 3e-3, 0.262, color2), meta);
|
|
56600
56603
|
if (M.on && A.light) A.light(Object.assign({}, M, { lampId: id }), 0, h - 0.15, 0, color2, 5, "floor");
|
|
56601
56604
|
}
|
|
56602
56605
|
function sconce(M, A) {
|
|
@@ -60573,7 +60576,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
60573
60576
|
dresser(M, A) {
|
|
60574
60577
|
const { b: lb, c: lc } = kk(M, A), w = M.w, d = M.d, h = M.h, wood = paletteColor(M, "wood", 6965812), ng = h > 0.7 ? 3 : 2, gh = (h - 0.12) / ng;
|
|
60575
60578
|
lb("wood", 0, 0.04, 0, w, h - 0.08, d, wood);
|
|
60576
|
-
lb("wood", 0, h - 0.04, 0, w + 0.03, 0.04, d + 0.03, sh(wood, 1.15));
|
|
60579
|
+
if (M.visorScene) lb("wood", 0, h - 0.04, 0, w + 0.03, 0.04, d + 0.03, sh(wood, 1.15));
|
|
60580
|
+
else lb("wood", 0, h - 0.04, 75e-4, w, 0.04, d + 0.015, sh(wood, 1.15));
|
|
60577
60581
|
for (const sx of [-1, 1]) for (const sz of [-1, 1]) lb("wood", sx * (w / 2 - 0.04), 0, sz * (d / 2 - 0.04), 0.04, 0.04, 0.04, sh(wood, 0.4));
|
|
60578
60582
|
for (let k = 0; k < ng; k++) {
|
|
60579
60583
|
lb("wood", 0, 0.08 + k * gh, d / 2 + 5e-3, w - 0.06, gh - 0.03, 0.012, sh(wood, 1.12));
|
|
@@ -60838,10 +60842,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
60838
60842
|
lb("plain", 0, h - 0.18, d / 2 + 5e-3, w - 0.1, 0.1, 0.01, 3816e3);
|
|
60839
60843
|
},
|
|
60840
60844
|
hamper(M, A) {
|
|
60841
|
-
const { c: lc } = kk(M, A);
|
|
60842
|
-
lc("plain", 0, 0, 0,
|
|
60843
|
-
lc("plain", 0, M.h - 0.01, 0,
|
|
60845
|
+
const { c: lc } = kk(M, A), r = M.visorScene ? M.w / 2 : Math.min(M.w, M.d) / 2;
|
|
60846
|
+
lc("plain", 0, 0, 0, r, M.h, paletteColor(M, "fabric_accent", 10127978));
|
|
60847
|
+
lc("plain", 0, M.h - 0.01, 0, r - 0.03, 0.02, 2763306);
|
|
60844
60848
|
},
|
|
60849
|
+
// (outside the Visor's scene the round basket fits its footprint's narrow side: it stood 2.5 cm in the wall behind it)
|
|
60845
60850
|
trash_bin(M, A) {
|
|
60846
60851
|
const { c: lc } = kk(M, A);
|
|
60847
60852
|
lc("plain", 0, 0, 0, M.w / 2, M.h, 6974574);
|
|
@@ -61383,6 +61388,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
61383
61388
|
return (r * r + r0 * r0 - d * d) / (2 * r * r0) > BLOB_CROSSING;
|
|
61384
61389
|
});
|
|
61385
61390
|
}
|
|
61391
|
+
var FICUS_SPREAD = 1.32;
|
|
61386
61392
|
function installFurniturePlants(K, shared3) {
|
|
61387
61393
|
const seedKey = (id) => K.seedKey(id);
|
|
61388
61394
|
const { SEED, kit2, rngString, sh } = K;
|
|
@@ -61479,19 +61485,20 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
61479
61485
|
}
|
|
61480
61486
|
function potPlant(M, A, o = {}) {
|
|
61481
61487
|
const K2 = kit2(M, A), rnd2 = rngString(SEED() + "|" + seedKey(M.seed) + "|vaso"), h = M.h || 0.9, r = Math.min(0.26, Math.min(M.w || 0.4, M.d || 0.4) * 0.42), pot2 = M.color != null ? M.color : [11886652, 11034686, 15262420, 4868684, 8030860][rnd2() * 5 | 0];
|
|
61482
|
-
const
|
|
61488
|
+
const reach2 = M.visorScene || M.reach == null ? Number.POSITIVE_INFINITY : M.reach, rp = Math.min(r, reach2 / 1.1);
|
|
61489
|
+
const ph = Math.min(0.34, h * 0.38), top = potModel(K2, 0, 0, 0, rp, ph, pot2), green2 = M.palette && M.palette.plant != null ? M.palette.plant : GREENS2[rnd2() * 5 | 0], type = o.type || ["ficus", "dracena", "samambaia"][rnd2() * 3 | 0];
|
|
61483
61490
|
if (type === "ficus") {
|
|
61484
61491
|
K2.t("wood", [0, top, 0], [0.02, top + (h - ph) * 0.45, 0], 0.014, 6965808);
|
|
61485
|
-
blobs(K2, 0, top + (h - ph) * 0.35, 0, Math.max(0.2, (h - ph) * 0.4), 9, green2, rnd2);
|
|
61492
|
+
blobs(K2, 0, top + (h - ph) * 0.35, 0, Math.min(Math.max(0.2, (h - ph) * 0.4), reach2 / FICUS_SPREAD), 9, green2, rnd2);
|
|
61486
61493
|
} else if (type === "dracena") {
|
|
61487
61494
|
for (let i = 0; i < 3; i++) {
|
|
61488
61495
|
const a = i * 2.1, hh = (h - ph) * (0.5 + 0.2 * i / 2);
|
|
61489
61496
|
const foot = M.visorScene ? 0 : 0.02;
|
|
61490
61497
|
K2.t("wood", [Math.cos(a) * foot, top, Math.sin(a) * foot], [Math.cos(a) * 0.04, top + hh, Math.sin(a) * 0.04], 0.012, 8022600);
|
|
61491
|
-
for (let k = 0; k < 7; k++) arcLeaf(K2, Math.cos(a) * 0.04, top + hh, Math.sin(a) * 0.04, k * 0.9 + a, 0.22 + rnd2() * 0.08, 0.35 - k % 3 * 0.1, 0.3, 0.028, sh(green2, 0.85 + rnd2() * 0.3), false, 4);
|
|
61498
|
+
for (let k = 0; k < 7; k++) arcLeaf(K2, Math.cos(a) * 0.04, top + hh, Math.sin(a) * 0.04, k * 0.9 + a, (0.22 + rnd2() * 0.08) * Math.min(1, (reach2 - 0.04) / 0.3), 0.35 - k % 3 * 0.1, 0.3, 0.028, sh(green2, 0.85 + rnd2() * 0.3), false, 4);
|
|
61492
61499
|
}
|
|
61493
61500
|
} else {
|
|
61494
|
-
for (let k = 0; k < 11; k++) arcLeaf(K2, 0, top, 0, k * 0.6 + rnd2() * 0.3, (h - ph) * (0.7 + rnd2() * 0.4), 0.9 - k % 3 * 0.25, 1.2, 0.05, sh(green2, 0.8 + rnd2() * 0.35), true, 6);
|
|
61501
|
+
for (let k = 0; k < 11; k++) arcLeaf(K2, 0, top, 0, k * 0.6 + rnd2() * 0.3, (h - ph) * (0.7 + rnd2() * 0.4) * Math.min(1, reach2 / ((h - ph) * 1.1)), 0.9 - k % 3 * 0.25, 1.2, 0.05, sh(green2, 0.8 + rnd2() * 0.35), true, 6);
|
|
61495
61502
|
}
|
|
61496
61503
|
}
|
|
61497
61504
|
function tablePot(M, A) {
|
|
@@ -61814,6 +61821,57 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
61814
61821
|
const defined = { extraTypes };
|
|
61815
61822
|
Object.assign(K, defined);
|
|
61816
61823
|
}
|
|
61824
|
+
var POTTED_PLANT_TYPES = /* @__PURE__ */ new Set(["floor_plant", "floor_plant_tall", "floor_plant_low", "plant_tall", "plant_short", "outdoor_pot", "table_plant"]);
|
|
61825
|
+
var PLANT_CLEAR = 0.04;
|
|
61826
|
+
var PLANT_MIN_REACH = 0.14;
|
|
61827
|
+
var PLANT_SPAN = [0.03, 2.4];
|
|
61828
|
+
function footprintOf(m) {
|
|
61829
|
+
const c = Math.abs(Math.cos(m.ry || 0)), s = Math.abs(Math.sin(m.ry || 0)), hx = ((m.w || 0) * c + (m.d || 0) * s) / 2, hz2 = ((m.w || 0) * s + (m.d || 0) * c) / 2;
|
|
61830
|
+
return [m.x - hx, m.z - hz2, m.x + hx, m.z + hz2];
|
|
61831
|
+
}
|
|
61832
|
+
var reachTo = (x, z, x0, z0, x1, z1) => Math.hypot(Math.max(x0 - x, 0, x - x1), Math.max(z0 - z, 0, z - z1));
|
|
61833
|
+
function freeReachOf(p) {
|
|
61834
|
+
const y0 = p.y + PLANT_SPAN[0], y1 = p.y + PLANT_SPAN[1];
|
|
61835
|
+
let reach2 = Number.POSITIVE_INFINITY;
|
|
61836
|
+
for (const b of p.boxes) if (b[1] < y1 && b[4] > y0) reach2 = Math.min(reach2, reachTo(p.x, p.z, b[0], b[2], b[3], b[5]));
|
|
61837
|
+
for (const m of p.items) {
|
|
61838
|
+
if (m === p.self || m.id === p.self.id || m.floor !== p.self.floor || m.flat || m.category === "ground_cover" || m.w == null || m.d == null) continue;
|
|
61839
|
+
const bottom = p.base + (m.y || 0), top = bottom + (m.h || 0);
|
|
61840
|
+
if (bottom >= y1 || top <= y0) continue;
|
|
61841
|
+
const r = footprintOf(m);
|
|
61842
|
+
reach2 = Math.min(reach2, reachTo(p.x, p.z, r[0], r[1], r[2], r[3]));
|
|
61843
|
+
}
|
|
61844
|
+
return reach2 - PLANT_CLEAR;
|
|
61845
|
+
}
|
|
61846
|
+
function vertexMark(accs) {
|
|
61847
|
+
const mark = /* @__PURE__ */ new Map();
|
|
61848
|
+
for (const a of accs.values()) mark.set(a, a.nv);
|
|
61849
|
+
return mark;
|
|
61850
|
+
}
|
|
61851
|
+
function partToHouse(parts2, group, p) {
|
|
61852
|
+
let at4 = p, name = group;
|
|
61853
|
+
for (let part = parts2.get(name); part; part = parts2.get(name)) {
|
|
61854
|
+
const c = Math.cos(part.ry), s = Math.sin(part.ry);
|
|
61855
|
+
at4 = [at4[0] * c + at4[2] * s + (part.pos[0] ?? 0), at4[1] + (part.pos[1] ?? 0), -at4[0] * s + at4[2] * c + (part.pos[2] ?? 0)];
|
|
61856
|
+
name = part.parent;
|
|
61857
|
+
}
|
|
61858
|
+
return at4;
|
|
61859
|
+
}
|
|
61860
|
+
function boundsSince(accs, mark, parts2) {
|
|
61861
|
+
const byName = new Map(parts2.map((p) => [p.name, p]));
|
|
61862
|
+
const box5 = [Infinity, Infinity, Infinity, -Infinity, -Infinity, -Infinity];
|
|
61863
|
+
for (const a of accs.values()) {
|
|
61864
|
+
for (let v = mark.get(a) ?? 0; v < a.nv; v++) {
|
|
61865
|
+
const local2 = [a.p[v * 3], a.p[v * 3 + 1], a.p[v * 3 + 2]];
|
|
61866
|
+
const p = a.group.startsWith("part:") ? partToHouse(byName, a.group, local2) : local2;
|
|
61867
|
+
for (let k = 0; k < 3; k++) {
|
|
61868
|
+
box5[k] = Math.min(box5[k], p[k]);
|
|
61869
|
+
box5[k + 3] = Math.max(box5[k + 3], p[k]);
|
|
61870
|
+
}
|
|
61871
|
+
}
|
|
61872
|
+
}
|
|
61873
|
+
return box5[0] <= box5[3] ? box5 : null;
|
|
61874
|
+
}
|
|
61817
61875
|
var COVER_STEP = 3e-3;
|
|
61818
61876
|
var PANEL_CLEAR = 0.05;
|
|
61819
61877
|
function installFurniturePlaceItems(K, shared3) {
|
|
@@ -61860,6 +61918,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
61860
61918
|
M.base += COVER_STEP * under;
|
|
61861
61919
|
covers.push(own);
|
|
61862
61920
|
}
|
|
61921
|
+
if (!shared3.ctx.visorScene && POTTED_PLANT_TYPES.has(m.type)) {
|
|
61922
|
+
const reach2 = freeReachOf({ x: M.x, z: M.z, y: M.base + (M.y ?? 0), boxes: (exterior ? shared3.ctx.occupied : keepOut).concat((drawn.get(cursor.group) ?? []).flat()), items: list2, self: m, base: M.base });
|
|
61923
|
+
if (reach2 < PLANT_MIN_REACH) continue;
|
|
61924
|
+
M.reach = reach2;
|
|
61925
|
+
}
|
|
61863
61926
|
if (shared3.ctx.veg && vegItem(m, M, exterior ? "lot" : "f" + f)) continue;
|
|
61864
61927
|
if (m.type === "cooking_gas_cylinder" && m.shelter && T2.gas_shelter) {
|
|
61865
61928
|
const st = cursor.stage;
|
|
@@ -61911,8 +61974,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
61911
61974
|
}
|
|
61912
61975
|
const mine = shared3.ctx.itemBoxes;
|
|
61913
61976
|
if (mine) drawn.set(cursor.group, (drawn.get(cursor.group) ?? []).concat([mine]));
|
|
61977
|
+
const mark = shared3.ctx.itemBounds ? vertexMark(cursor.accs) : null;
|
|
61914
61978
|
try {
|
|
61915
61979
|
buildItem2(m, M, ent, api, cursor.group);
|
|
61980
|
+
if (mark) recordBounds(m, mark);
|
|
61916
61981
|
} catch (e) {
|
|
61917
61982
|
cursor.group = exterior ? "lot" : "f" + f;
|
|
61918
61983
|
console.warn("builder", m.type, e);
|
|
@@ -61941,6 +62006,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
61941
62006
|
}
|
|
61942
62007
|
return noModel;
|
|
61943
62008
|
}
|
|
62009
|
+
function recordBounds(m, mark) {
|
|
62010
|
+
const box5 = boundsSince(cursor.accs, mark, K.PARTS);
|
|
62011
|
+
if (box5) shared3.ctx.itemBounds?.push({ id: m.id, type: m.type, category: m.category ?? null, room: m.room ?? null, floor: m.floor, by: "furniture", box: box5 });
|
|
62012
|
+
}
|
|
61944
62013
|
const ROOF_CLEAR = 0.06;
|
|
61945
62014
|
function overRoof(m, M, f) {
|
|
61946
62015
|
const R = shared3.ctx.r, inside22 = (rooms) => rooms.find((c) => rectsOf2(c).some((r) => r[0] < m.x && m.x < r[2] && r[1] < m.z && m.z < r[3]));
|
|
@@ -62056,6 +62125,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62056
62125
|
const defined = { houseItems, waterTankOfHouse, hashColor, labeledBox };
|
|
62057
62126
|
Object.assign(K, defined);
|
|
62058
62127
|
}
|
|
62128
|
+
var PLANT_RADIUS_MARGIN = 1.08;
|
|
62129
|
+
var PLANT_MIN_SCALE = 0.4;
|
|
62059
62130
|
function installVegetationBridge(K, shared3) {
|
|
62060
62131
|
const seedKey = (id) => K.seedKey(id);
|
|
62061
62132
|
const { THREE, SEED, rngString } = K;
|
|
@@ -62070,7 +62141,6 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62070
62141
|
floor_plant_tall: VEG_POT,
|
|
62071
62142
|
floor_plant: VEG_POT,
|
|
62072
62143
|
outdoor_pot: VEG_POT,
|
|
62073
|
-
toilet: VEG_POT,
|
|
62074
62144
|
floor_plant_low: ["potted_succulents", "potted_cactus"],
|
|
62075
62145
|
table_plant: ["potted_succulents", "potted_cactus"],
|
|
62076
62146
|
clump: ["lawn_tuft"],
|
|
@@ -62119,9 +62189,41 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62119
62189
|
}
|
|
62120
62190
|
return true;
|
|
62121
62191
|
}
|
|
62122
|
-
|
|
62192
|
+
if (M.reach != null) {
|
|
62193
|
+
const fit = fitted(V3, lst, pick3(lst), sd, M.reach);
|
|
62194
|
+
if (!fit) return true;
|
|
62195
|
+
G.pl.push({ species: fit.species, x: M.x, z: M.z, ry: M.ry || 0, scale: fit.scale, seed: sd });
|
|
62196
|
+
const r = fit.radius * fit.scale;
|
|
62197
|
+
shared3.ctx.itemBounds?.push({ id: m.id, type: m.type, category: m.category ?? null, room: m.room ?? null, floor: m.floor, by: "vegetation", box: [M.x - r, y, M.z - r, M.x + r, y + fit.height * fit.scale, M.z + r] });
|
|
62198
|
+
return true;
|
|
62199
|
+
}
|
|
62200
|
+
const species = pick3(lst);
|
|
62201
|
+
G.pl.push({ species, x: M.x, z: M.z, ry: M.ry || 0, scale: 1, seed: sd });
|
|
62202
|
+
if (shared3.ctx.itemBounds) {
|
|
62203
|
+
const size = speciesSize(V3, species, sd);
|
|
62204
|
+
shared3.ctx.itemBounds.push({ id: m.id, type: m.type, category: m.category ?? null, room: m.room ?? null, floor: m.floor, by: "vegetation", box: [M.x - size.radius, y, M.z - size.radius, M.x + size.radius, y + size.height, M.z + size.radius] });
|
|
62205
|
+
}
|
|
62123
62206
|
return true;
|
|
62124
62207
|
}
|
|
62208
|
+
function speciesSize(V3, id, seed) {
|
|
62209
|
+
const key2 = id + "|" + seed;
|
|
62210
|
+
let r = V3.sizes.get(key2);
|
|
62211
|
+
if (!r) {
|
|
62212
|
+
r = V3.G.generate ? V3.G.generate(V3.S.toSpec(id), { seed }).bounds : { radius: 0, height: 0 };
|
|
62213
|
+
V3.sizes.set(key2, r);
|
|
62214
|
+
}
|
|
62215
|
+
return r;
|
|
62216
|
+
}
|
|
62217
|
+
function fitted(V3, species, first, seed, reach2) {
|
|
62218
|
+
const sizeOf2 = (id) => speciesSize(V3, id, seed);
|
|
62219
|
+
let best = null;
|
|
62220
|
+
for (const id of [first, ...species.filter((s) => s !== first)]) {
|
|
62221
|
+
const size = sizeOf2(id), r = size.radius * PLANT_RADIUS_MARGIN, scale = r > reach2 ? reach2 / r : 1;
|
|
62222
|
+
if (scale === 1) return { species: id, scale, ...size };
|
|
62223
|
+
if (!best || scale > best.scale) best = { species: id, scale, ...size };
|
|
62224
|
+
}
|
|
62225
|
+
return best && best.scale >= PLANT_MIN_SCALE ? best : null;
|
|
62226
|
+
}
|
|
62125
62227
|
function assembleVegetation(groups) {
|
|
62126
62228
|
const V3 = shared3.ctx.veg;
|
|
62127
62229
|
if (!V3) return;
|
|
@@ -62158,7 +62260,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62158
62260
|
shared3.partState = /* @__PURE__ */ new Map();
|
|
62159
62261
|
const newInteractiveState = () => ({ defs: /* @__PURE__ */ new Map(), items: [], pieces: [], lights: /* @__PURE__ */ new Map(), litRooms: /* @__PURE__ */ new Set(), objs: [], anim: /* @__PURE__ */ new Set(), msg: null, target: null });
|
|
62160
62262
|
shared3.inter = newInteractiveState();
|
|
62161
|
-
const MESSAGE_MS = 2200;
|
|
62263
|
+
const MESSAGE_MS = 2200, LAMP_OFF_COLOR = 15658214, LAMP_DIFFUSER_MATERIAL = "glass";
|
|
62162
62264
|
UV_SCALE.doorWood = 1;
|
|
62163
62265
|
UV_SCALE.doorPaint = 1;
|
|
62164
62266
|
function createInteractiveMaterials(mats) {
|
|
@@ -62209,6 +62311,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62209
62311
|
mats.doorWood = new THREE.MeshLambertMaterial({ vertexColors: true, map: wood });
|
|
62210
62312
|
mats.doorPaint = new THREE.MeshLambertMaterial({ vertexColors: true, map: paint2 });
|
|
62211
62313
|
mats.off = new THREE.MeshBasicMaterial({ vertexColors: true, color: 9078656 });
|
|
62314
|
+
mats.lampOff = new THREE.MeshPhongMaterial({ color: LAMP_OFF_COLOR, shininess: 70, specular: 6710886, transparent: true, opacity: 0.9 });
|
|
62212
62315
|
}
|
|
62213
62316
|
const _EY = new THREE.Vector3(0, 1, 0), _UM3 = new THREE.Vector3(1, 1, 1);
|
|
62214
62317
|
const hudMessage = (text) => {
|
|
@@ -62249,6 +62352,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62249
62352
|
o.geometry.applyMatrix4(inv);
|
|
62250
62353
|
o.userData.piece = def;
|
|
62251
62354
|
def.meshes.push(o);
|
|
62355
|
+
if (def.roomId && o.name.endsWith("/emissive")) o.userData.destructionMaterial = LAMP_DIFFUSER_MATERIAL;
|
|
62252
62356
|
}
|
|
62253
62357
|
});
|
|
62254
62358
|
outer.add(g);
|
|
@@ -62335,7 +62439,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62335
62439
|
};
|
|
62336
62440
|
function applyLight(roomId) {
|
|
62337
62441
|
const on = lightOn(roomId), inter = I(), mats = shared3.mats;
|
|
62338
|
-
for (const d of inter.lights.get(roomId) || []) for (const m of d.meshes) if (m.name.endsWith("/emissive")) m.material = on ? mats.emissive : mats.off;
|
|
62442
|
+
for (const d of inter.lights.get(roomId) || []) for (const m of d.meshes) if (m.name.endsWith("/emissive")) m.material = on ? mats.emissive : shared3.ctx.visorScene ? mats.off : mats.lampOff;
|
|
62339
62443
|
const sw = inter.defs.get("ix:int:" + roomId);
|
|
62340
62444
|
if (sw) {
|
|
62341
62445
|
sw.target = on ? 1 : 0;
|
|
@@ -62840,7 +62944,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62840
62944
|
Object.assign(K, defined);
|
|
62841
62945
|
}
|
|
62842
62946
|
function installInteractablesBridge(K, shared3) {
|
|
62843
|
-
const { t, THREE, invalidate, invalidateShadow, cfg, DOC, LIGHT_TYPES, _Y, _q, _v3, accFor, applyLight, cursor, hashString, hudMessage, lightBase, pieceRecord,
|
|
62947
|
+
const { t, THREE, invalidate, invalidateShadow, cfg, DOC, LIGHT_TYPES, _Y, _q, _v3, accFor, applyLight, cursor, hashString, hudMessage, lightBase, pieceRecord, rgbOf, wallBlocks } = K;
|
|
62844
62948
|
const enter = (...a) => K.enter(...a);
|
|
62845
62949
|
const roomLightMask = (...a) => K.roomLightMask(...a);
|
|
62846
62950
|
const IV_MATERIAL = { plain: "plain", metal: "metal", wood: "wood", glass: "glass", fabric: "fabric", plant: "plant", water: "water", emissive: "emissive", atlas_picture: "picture", atlas_floor: "floor" };
|
|
@@ -62894,7 +62998,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62894
62998
|
void world0;
|
|
62895
62999
|
const source = r;
|
|
62896
63000
|
const plane2 = A.plan(source, { seed: r.seed });
|
|
62897
|
-
const IV = { k: ik, plane: plane2, world: null, water, entries: /* @__PURE__ */ new Map(), roots: [], replace: /* @__PURE__ */ new Set(), roomStates: /* @__PURE__ */ new Map(), lampRoom: /* @__PURE__ */ new Map(), anim: /* @__PURE__ */ new Map(), screens: /* @__PURE__ */ new Map(), efx: null,
|
|
63001
|
+
const IV = { k: ik, plane: plane2, world: null, water, entries: /* @__PURE__ */ new Map(), roots: [], replace: /* @__PURE__ */ new Set(), roomStates: /* @__PURE__ */ new Map(), lampRoom: /* @__PURE__ */ new Map(), anim: /* @__PURE__ */ new Map(), screens: /* @__PURE__ */ new Map(), efx: null, contents: /* @__PURE__ */ new Map(), itemsDirty: true, itemsT: 0, dirty: true, list: null, listT: 0, t: 0, circuits: [], switchRooms: /* @__PURE__ */ new Set(), warnings: [], tBuild: 0 };
|
|
62898
63002
|
h.IV = IV;
|
|
62899
63003
|
const t0 = performance.now();
|
|
62900
63004
|
const lamps = new Set(plane2.items.filter((e) => e.type === "lamp").map((e) => e.id));
|
|
@@ -63064,20 +63168,18 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63064
63168
|
if (!d.plug) continue;
|
|
63065
63169
|
const wire = (spec.wires || []).find((x) => x.id === d.id + "_cord"), pts = (wire ? wire.points : [d.plug]).map((p) => wl(o, p));
|
|
63066
63170
|
const sid = w.power.pluggedInto(E.id, d.id);
|
|
63067
|
-
|
|
63068
|
-
|
|
63069
|
-
|
|
63070
|
-
|
|
63071
|
-
|
|
63072
|
-
|
|
63073
|
-
|
|
63074
|
-
|
|
63075
|
-
|
|
63076
|
-
|
|
63077
|
-
for (const p of hang) pts.push(p);
|
|
63078
|
-
}
|
|
63079
|
-
}
|
|
63171
|
+
const cut = sid ? sid.indexOf(":") : -1, so = sid ? w.get(sid.slice(0, cut)) : void 0, sk = sid && so ? (so.spec.sockets || []).find((s) => s.id === sid.slice(cut + 1)) : void 0;
|
|
63172
|
+
if (!so || !sk) continue;
|
|
63173
|
+
const sp = wl(so, sk.pos), dir = [Math.sin(so.transform.ry), Math.cos(so.transform.ry)], last = pts[pts.length - 1];
|
|
63174
|
+
if (last[1] < 0.3 + E.pos[1]) {
|
|
63175
|
+
const foot = [sp[0] + dir[0] * 0.035, E.pos[1] + 0.012, sp[2] + dir[1] * 0.035];
|
|
63176
|
+
pts.push([last[0] + (foot[0] - last[0]) * 0.4, E.pos[1] + 0.012, last[2] + (foot[2] - last[2]) * 0.4], [last[0] + (foot[0] - last[0]) * 0.75, E.pos[1] + 0.012, last[2] + (foot[2] - last[2]) * 0.75], foot, [foot[0], Math.max(E.pos[1] + 0.1, sp[1] - 0.04), foot[2]], [sp[0] + dir[0] * 0.012, sp[1] - 0.01, sp[2] + dir[1] * 0.012]);
|
|
63177
|
+
} else {
|
|
63178
|
+
const hang = ik.gfx.catenary(last, [sp[0] + dir[0] * 0.012, sp[1] - 0.01, sp[2] + dir[1] * 0.012], 0.1, 8);
|
|
63179
|
+
hang.shift();
|
|
63180
|
+
for (const p of hang) pts.push(p);
|
|
63080
63181
|
}
|
|
63182
|
+
shared3.ctx.cordPaths?.push({ object: E.id, device: d.id, points: pts.map((p) => [p[0], p[1], p[2]]) });
|
|
63081
63183
|
tube2(pts, 6e-3, IV_WIRE.cord, 0, 0, 0, 0);
|
|
63082
63184
|
}
|
|
63083
63185
|
}
|
|
@@ -63113,12 +63215,16 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63113
63215
|
}
|
|
63114
63216
|
IV.dirty = true;
|
|
63115
63217
|
switch (e.type) {
|
|
63116
|
-
case "part":
|
|
63218
|
+
case "part": {
|
|
63117
63219
|
if (e.part === "_x") break;
|
|
63118
63220
|
IV.anim.set(e.object + "|" + e.part, { object: e.object, part: e.part, target: e.target, t0: IV.t });
|
|
63119
63221
|
IV.itemsDirty = true;
|
|
63222
|
+
const E = e.target > 0 ? IV.entries.get(e.object) : void 0;
|
|
63223
|
+
if (E) ivContents(IV, E)?.sync();
|
|
63120
63224
|
invalidate();
|
|
63121
63225
|
break;
|
|
63226
|
+
}
|
|
63227
|
+
// the contents are drawn before the part moves, so they ride it from its first frame
|
|
63122
63228
|
case "device": {
|
|
63123
63229
|
const roomId = IV.lampRoom.get(e.object);
|
|
63124
63230
|
if (roomId) shared3.partState.set("light:" + roomId, !!e.on);
|
|
@@ -63129,6 +63235,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63129
63235
|
hudMessage(e.text);
|
|
63130
63236
|
break;
|
|
63131
63237
|
case "pickup":
|
|
63238
|
+
IV.contents.get(e.object)?.sync();
|
|
63132
63239
|
IV.itemsDirty = true;
|
|
63133
63240
|
if (e.actor === "player" && e.stack) {
|
|
63134
63241
|
const d = IV.world.t("item." + e.stack.type);
|
|
@@ -63173,6 +63280,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63173
63280
|
for (const [k, a] of IV.anim) {
|
|
63174
63281
|
const E = IV.entries.get(a.object);
|
|
63175
63282
|
if (E && E.parts) ik.gfx.syncObject(w, a.object, E.parts, { time: IV.t });
|
|
63283
|
+
IV.contents.get(a.object)?.sync();
|
|
63176
63284
|
if (w.partT(a.object, a.part) === a.target || IV.t - a.t0 > 4) IV.anim.delete(k);
|
|
63177
63285
|
}
|
|
63178
63286
|
invalidateShadow();
|
|
@@ -63212,28 +63320,23 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63212
63320
|
invalidate();
|
|
63213
63321
|
}
|
|
63214
63322
|
}
|
|
63215
|
-
if (ivk.items && IV.itemsDirty && IV.t - IV.itemsT > 0.1
|
|
63216
|
-
}
|
|
63217
|
-
|
|
63218
|
-
|
|
63219
|
-
|
|
63220
|
-
|
|
63221
|
-
|
|
63222
|
-
|
|
63223
|
-
|
|
63224
|
-
|
|
63225
|
-
|
|
63226
|
-
|
|
63227
|
-
|
|
63228
|
-
cloth: [["box", 1, 1, 1, 0, 1]],
|
|
63229
|
-
paper: [["box", 1, 1, 1, 0, 1]],
|
|
63230
|
-
tool: [["box", 1, 1, 1, 0, 1]],
|
|
63231
|
-
shoe: [["box", 1, 0.7, 1, 0, 1]]
|
|
63232
|
-
};
|
|
63323
|
+
if (ivk.items && IV.itemsDirty && IV.t - IV.itemsT > 0.1) ivItems(IV, h);
|
|
63324
|
+
}
|
|
63325
|
+
function ivContents(IV, E) {
|
|
63326
|
+
const had = IV.contents.get(E.id);
|
|
63327
|
+
if (had) return had;
|
|
63328
|
+
const ik = IV.k, make3 = ik.GT.createContentsView;
|
|
63329
|
+
if (!ik.items || !ik.itemModel || !make3 || !(E.spec.containers || []).length) return null;
|
|
63330
|
+
const view = make3(THREE, { world: IV.world, objectId: E.id, root: E.root, buildItem: ik.itemModel });
|
|
63331
|
+
IV.contents.set(E.id, view);
|
|
63332
|
+
view.sync();
|
|
63333
|
+
invalidateShadow();
|
|
63334
|
+
return view;
|
|
63335
|
+
}
|
|
63233
63336
|
function ivItems(IV, h) {
|
|
63234
63337
|
IV.itemsDirty = false;
|
|
63235
63338
|
IV.itemsT = IV.t;
|
|
63236
|
-
const w = IV.world,
|
|
63339
|
+
const w = IV.world, f = IV.focus;
|
|
63237
63340
|
let fl = null;
|
|
63238
63341
|
if (f) {
|
|
63239
63342
|
h.houseGroup.updateWorldMatrix(true, false);
|
|
@@ -63241,56 +63344,19 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63241
63344
|
h.houseGroup.worldToLocal(fl);
|
|
63242
63345
|
}
|
|
63243
63346
|
for (const E of IV.entries.values()) {
|
|
63347
|
+
const view = IV.contents.get(E.id);
|
|
63348
|
+
if (view) {
|
|
63349
|
+
view.sync();
|
|
63350
|
+
continue;
|
|
63351
|
+
}
|
|
63244
63352
|
if (fl && E.floor >= 0 && Math.hypot(E.pos[0] - fl.x, E.pos[2] - fl.z) > 14) continue;
|
|
63245
63353
|
for (const c of E.spec.containers || []) {
|
|
63246
|
-
if (
|
|
63247
|
-
if (
|
|
63248
|
-
|
|
63249
|
-
|
|
63250
|
-
const stack = st[i];
|
|
63251
|
-
if (stack && items[stack.type]) list2.push([E, c.id, i, items[stack.type]]);
|
|
63252
|
-
}
|
|
63253
|
-
}
|
|
63254
|
-
}
|
|
63255
|
-
if (!list2.length) {
|
|
63256
|
-
if (IV.items) IV.items.visible = false;
|
|
63257
|
-
return;
|
|
63258
|
-
}
|
|
63259
|
-
cursor.group = "iv-items";
|
|
63260
|
-
try {
|
|
63261
|
-
for (const [E, cid, slot, def] of list2) {
|
|
63262
|
-
const p = w.slotPosition(E.id, cid, slot), form = IV_SHAPE[def.shape] || IV_SHAPE.box;
|
|
63263
|
-
for (const [geo, fx, fy, fz, y0, tone] of form) {
|
|
63264
|
-
const sx = def.size[0] * fx, sy = def.size[1] * fy, sz = def.size[2] * fz;
|
|
63265
|
-
_q.setFromAxisAngle(_Y, E.ry);
|
|
63266
|
-
const color2 = def.color == null ? 13421772 : def.color;
|
|
63267
|
-
put("plain", geo, p[0], p[1] + def.size[1] * y0 + sy / 2, p[2], _q, sx, sy, sz, tone === 1 ? color2 : sh(color2, tone));
|
|
63354
|
+
if (c.access && w.partT(E.id, c.access) <= 0) continue;
|
|
63355
|
+
if (w.contents(E.id, c.id).some((st) => st !== null)) {
|
|
63356
|
+
ivContents(IV, E);
|
|
63357
|
+
break;
|
|
63268
63358
|
}
|
|
63269
63359
|
}
|
|
63270
|
-
const A = cursor.accs.get("iv-items|plain");
|
|
63271
|
-
cursor.accs.delete("iv-items|plain");
|
|
63272
|
-
const gm = new THREE.BufferGeometry();
|
|
63273
|
-
gm.setAttribute("position", new THREE.BufferAttribute(A.p.slice(0, A.nv * 3), 3));
|
|
63274
|
-
gm.setAttribute("normal", new THREE.BufferAttribute(A.n.slice(0, A.nv * 3), 3));
|
|
63275
|
-
gm.setAttribute("color", new THREE.BufferAttribute(A.c.slice(0, A.nv * 3), 3));
|
|
63276
|
-
gm.setAttribute("uv", new THREE.BufferAttribute(A.u.slice(0, A.nv * 2), 2));
|
|
63277
|
-
gm.setIndex(new THREE.BufferAttribute(A.i.slice(0, A.ni), 1));
|
|
63278
|
-
gm.computeBoundingSphere();
|
|
63279
|
-
if (!IV.items) {
|
|
63280
|
-
const mesh3 = new THREE.Mesh(gm, shared3.mats.plain);
|
|
63281
|
-
IV.items = mesh3;
|
|
63282
|
-
mesh3.name = "iv-items";
|
|
63283
|
-
mesh3.castShadow = false;
|
|
63284
|
-
mesh3.receiveShadow = true;
|
|
63285
|
-
mesh3.frustumCulled = false;
|
|
63286
|
-
h.houseGroup.add(mesh3);
|
|
63287
|
-
} else {
|
|
63288
|
-
IV.items.geometry.dispose();
|
|
63289
|
-
IV.items.geometry = gm;
|
|
63290
|
-
}
|
|
63291
|
-
IV.items.visible = true;
|
|
63292
|
-
} finally {
|
|
63293
|
-
cursor.group = g0;
|
|
63294
63360
|
}
|
|
63295
63361
|
invalidateShadow();
|
|
63296
63362
|
}
|
|
@@ -63350,7 +63416,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63350
63416
|
}
|
|
63351
63417
|
}
|
|
63352
63418
|
for (const sc of IV.screens.values()) sc.dispose();
|
|
63353
|
-
|
|
63419
|
+
for (const view of IV.contents.values()) view.dispose();
|
|
63420
|
+
IV.contents.clear();
|
|
63354
63421
|
}
|
|
63355
63422
|
function ivPublish(h) {
|
|
63356
63423
|
const IV = h.IV, w = IV.world, ik = IV.k, com = (fn) => (...a) => {
|
|
@@ -63417,7 +63484,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63417
63484
|
};
|
|
63418
63485
|
return IV.pub;
|
|
63419
63486
|
}
|
|
63420
|
-
const defined = { IV_MATERIAL, IV_WIRE, IV_DOOR, ivGroup, ivAccumulate, ivBuild, ivRoomEffective, ivDraw, ivCords, ivAssemble, ivScreen, ivEvent, ivSeat, ivUpdate,
|
|
63487
|
+
const defined = { IV_MATERIAL, IV_WIRE, IV_DOOR, ivGroup, ivAccumulate, ivBuild, ivRoomEffective, ivDraw, ivCords, ivAssemble, ivScreen, ivEvent, ivSeat, ivUpdate, ivItems, ivContents, ivTarget, ivRoomLight, ivParts, ivDispose, ivPublish };
|
|
63421
63488
|
Object.assign(K, defined);
|
|
63422
63489
|
}
|
|
63423
63490
|
function installAnimationClotheslines(K, shared3) {
|
|
@@ -63480,7 +63547,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
63480
63547
|
return null;
|
|
63481
63548
|
}
|
|
63482
63549
|
const A = AD.plan ? AD : AD.create({ ...o.adapterOptions || {}, GameInteractables: GI, GameInteractablesHousehold: HH, locale: o.locale || cfg.locale, region: o.region, ...cfg.seedKey ? { seedKey: cfg.seedKey } : {} });
|
|
63483
|
-
return { GI, HH, GT, A, gfx: GT.createThreeAdapter(THREE, { document: DOC, Reflector }), items: o.items !== false, effects: o.effects !== false, effectSink: o.effectSink || null, camera: o.camera || null, onEvent: o.onEvent || null, onSeat: o.onSeat || null };
|
|
63550
|
+
return { GI, HH, GT, A, gfx: GT.createThreeAdapter(THREE, { document: DOC, Reflector }), items: o.items !== false, itemModel: o.itemModel || null, effects: o.effects !== false, effectSink: o.effectSink || null, camera: o.camera || null, onEvent: o.onEvent || null, onSeat: o.onSeat || null };
|
|
63484
63551
|
})();
|
|
63485
63552
|
const VEG = (() => {
|
|
63486
63553
|
const l = cfg.vegetation || null, G = l && (l.GameVegetation || (l.buildLot ? l : null)), S = l && (l.GameVegetationSpecies || (l.toSpec ? l : null));
|
|
@@ -64038,14 +64105,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
64038
64105
|
}
|
|
64039
64106
|
return best;
|
|
64040
64107
|
};
|
|
64041
|
-
const
|
|
64108
|
+
const gapOf2 = (p, q) => Math.hypot(Math.max(0, q.aabb[0] - p.aabb[2], p.aabb[0] - q.aabb[2]), Math.max(0, q.y0 - p.y1, p.y0 - q.y1), Math.max(0, q.aabb[1] - p.aabb[3], p.aabb[1] - q.aabb[3]));
|
|
64042
64109
|
const centreGapOf = (p, q) => Math.hypot((p.aabb[0] + p.aabb[2] - q.aabb[0] - q.aabb[2]) / 2, (p.y0 + p.y1 - q.y0 - q.y1) / 2, (p.aabb[1] + p.aabb[3] - q.aabb[1] - q.aabb[3]) / 2);
|
|
64043
64110
|
const wallBeside = (p, reach2) => {
|
|
64044
64111
|
for (const roles of [WALL_ROLES, SPAN_ROLES]) {
|
|
64045
64112
|
let best = null, bd = Infinity, bc = Infinity;
|
|
64046
64113
|
for (const q of parts2) {
|
|
64047
64114
|
if (q === p || !(q.extra ? roles === WALL_ROLES && Array.isArray(q.tags) && q.tags.includes("wall") : roles.has(q.role))) continue;
|
|
64048
|
-
const d =
|
|
64115
|
+
const d = gapOf2(p, q);
|
|
64049
64116
|
if (d > reach2) continue;
|
|
64050
64117
|
const c = centreGapOf(p, q);
|
|
64051
64118
|
if (d < bd || d === bd && (c < bc || c === bc && best !== null && q.id < best.id)) {
|
|
@@ -66326,8 +66393,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66326
66393
|
shared3.ctx.pu = Math.max(0, pr.unit != null ? pr.unit : 0);
|
|
66327
66394
|
shared3.ctx.showBuilding = shared3.ctx.apartment && (pr.showIt == null ? true : !!pr.showIt);
|
|
66328
66395
|
shared3.ctx.limits = { x0: -2, z0: -2, x1: r.w + 2, z1: r.d + 2 };
|
|
66329
|
-
shared3.ctx.veg = VEG ? { G: VEG.G, S: VEG.S, mats: vegMaterials, groups: /* @__PURE__ */ new Map(), ok: /* @__PURE__ */ new Map(), opts: shared3.quality === "game" ? { quality: "game" } : { quality: "high", lod: 0, triangleBudget: 6e4 } } : null;
|
|
66396
|
+
shared3.ctx.veg = VEG ? { G: VEG.G, S: VEG.S, mats: vegMaterials, groups: /* @__PURE__ */ new Map(), ok: /* @__PURE__ */ new Map(), sizes: /* @__PURE__ */ new Map(), opts: shared3.quality === "game" ? { quality: "game" } : { quality: "high", lod: 0, triangleBudget: 6e4 } } : null;
|
|
66330
66397
|
shared3.ctx.vegInfo = null;
|
|
66398
|
+
shared3.ctx.itemBounds = opts.itemBounds ? [] : void 0;
|
|
66399
|
+
shared3.ctx.cordPaths = opts.itemBounds ? [] : void 0;
|
|
66331
66400
|
const cs = !!(opts.constructionStages || opts.constructionLevel != null);
|
|
66332
66401
|
shared3.ctx.constructionStages = cs;
|
|
66333
66402
|
if (Y0(0) > 0 && !shared3.ctx.visorScene) shared3.ctx.unitGround = Y0(0);
|
|
@@ -66975,6 +67044,90 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66975
67044
|
installBuildBuild(K, shared3);
|
|
66976
67045
|
return buildApi(K, shared3);
|
|
66977
67046
|
}
|
|
67047
|
+
var HOLD_REACH2 = 0.05;
|
|
67048
|
+
var BACK_TOUCH = 0.02;
|
|
67049
|
+
var SOFT = /* @__PURE__ */ new Set(["fabric", "paper", "foliage"]);
|
|
67050
|
+
var gapOf = (a, b) => Math.max(0, ...[0, 1, 2].map((k) => Math.max(a.min[k] - b.max[k], b.min[k] - a.max[k])));
|
|
67051
|
+
function groupsOf(parts2, joints) {
|
|
67052
|
+
const root = new Map(parts2.map((part) => [part.id, part.id]));
|
|
67053
|
+
const find = (id) => {
|
|
67054
|
+
let at4 = id;
|
|
67055
|
+
while (root.get(at4) !== at4) at4 = root.get(at4);
|
|
67056
|
+
root.set(id, at4);
|
|
67057
|
+
return at4;
|
|
67058
|
+
};
|
|
67059
|
+
for (const joint2 of joints) root.set(find(joint2.a), find(joint2.b));
|
|
67060
|
+
const groups = /* @__PURE__ */ new Map();
|
|
67061
|
+
for (const part of parts2) {
|
|
67062
|
+
const at4 = find(part.id);
|
|
67063
|
+
groups.set(at4, [...groups.get(at4) ?? [], part.id]);
|
|
67064
|
+
}
|
|
67065
|
+
return [...groups.values()];
|
|
67066
|
+
}
|
|
67067
|
+
function nearestJoint(loose, held, boxOf3, reach2) {
|
|
67068
|
+
let best = null;
|
|
67069
|
+
for (const a of loose) {
|
|
67070
|
+
for (const b of held) {
|
|
67071
|
+
const gap = gapOf(boxOf3(a.id), boxOf3(b.id));
|
|
67072
|
+
if (gap <= reach2 && (!best || gap < best.gap)) best = { gap, a, b };
|
|
67073
|
+
}
|
|
67074
|
+
}
|
|
67075
|
+
if (!best) return null;
|
|
67076
|
+
const [joint2] = inferJoints([best.a, best.b], best.gap + 0.05);
|
|
67077
|
+
return joint2 ? { ...joint2, id: `${best.a.id}~${best.b.id}` } : null;
|
|
67078
|
+
}
|
|
67079
|
+
var FLOOR_TOUCH = 5e-3;
|
|
67080
|
+
var STANDS_ALONE = 0.3;
|
|
67081
|
+
function standsAlone(group, boxOf3) {
|
|
67082
|
+
const feet = group.map((part) => boxOf3(part.id)).filter((box5) => box5.min[1] <= FLOOR_TOUCH);
|
|
67083
|
+
if (feet.length === 0) return false;
|
|
67084
|
+
const height = Math.max(...group.map((part) => boxOf3(part.id).max[1]));
|
|
67085
|
+
const across2 = (k) => Math.max(...feet.map((box5) => box5.max[k])) - Math.min(...feet.map((box5) => box5.min[k]));
|
|
67086
|
+
return Math.min(across2(0), across2(2)) >= STANDS_ALONE * height;
|
|
67087
|
+
}
|
|
67088
|
+
function joinBodies({ parts: parts2, joints, boxOf: boxOf3 }, byId) {
|
|
67089
|
+
const groups = groupsOf(parts2, joints).map((ids) => ids.map((id) => byId.get(id))).sort((a, b) => b.length - a.length);
|
|
67090
|
+
const [main, ...rest2] = groups;
|
|
67091
|
+
if (!main) return;
|
|
67092
|
+
for (const group of rest2) {
|
|
67093
|
+
if (standsAlone(group, boxOf3)) continue;
|
|
67094
|
+
const joint2 = nearestJoint(group, main, boxOf3, Infinity);
|
|
67095
|
+
if (joint2) joints.push(joint2);
|
|
67096
|
+
}
|
|
67097
|
+
}
|
|
67098
|
+
function holdLooseGroups(params) {
|
|
67099
|
+
const byId = new Map(params.parts.map((part) => [part.id, part]));
|
|
67100
|
+
holdHanging(params, byId);
|
|
67101
|
+
joinBodies(params, byId);
|
|
67102
|
+
}
|
|
67103
|
+
function holdHanging({ parts: parts2, joints, boxOf: boxOf3 }, byId) {
|
|
67104
|
+
const back = Math.min(...parts2.map((part) => boxOf3(part.id).min[2]));
|
|
67105
|
+
for (let pass = 0; pass < parts2.length; pass++) {
|
|
67106
|
+
const groups = groupsOf(parts2, joints).map((ids) => ids.map((id) => byId.get(id)));
|
|
67107
|
+
const held = groups.filter((group) => group.some((part) => part.anchored)).flat();
|
|
67108
|
+
const loose = groups.filter((group) => !group.some((part) => part.anchored));
|
|
67109
|
+
if (loose.length === 0) return;
|
|
67110
|
+
let changed = false;
|
|
67111
|
+
for (const group of loose) {
|
|
67112
|
+
const joint2 = nearestJoint(group, held, boxOf3, HOLD_REACH2);
|
|
67113
|
+
if (joint2) {
|
|
67114
|
+
joints.push(joint2);
|
|
67115
|
+
changed = true;
|
|
67116
|
+
continue;
|
|
67117
|
+
}
|
|
67118
|
+
const onWall = group.filter((part) => !SOFT.has(part.material) && boxOf3(part.id).min[2] <= back + BACK_TOUCH);
|
|
67119
|
+
if (onWall.length === 0) continue;
|
|
67120
|
+
for (const part of onWall) part.anchored = true;
|
|
67121
|
+
changed = true;
|
|
67122
|
+
}
|
|
67123
|
+
if (changed) continue;
|
|
67124
|
+
for (const group of loose) {
|
|
67125
|
+
const joint2 = nearestJoint(group, held, boxOf3, Infinity);
|
|
67126
|
+
if (joint2) joints.push(joint2);
|
|
67127
|
+
}
|
|
67128
|
+
return;
|
|
67129
|
+
}
|
|
67130
|
+
}
|
|
66978
67131
|
var WOOD_THIN = 0.035;
|
|
66979
67132
|
var BOARD_TOP_THICK = 0.07;
|
|
66980
67133
|
var BOARD_TOP_WIDTH = 0.5;
|
|
@@ -67026,7 +67179,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67026
67179
|
const channel = (shift) => Math.min(255, Math.round((color2 >> shift & 255) * k)) << shift;
|
|
67027
67180
|
return channel(16) | channel(8) | channel(0);
|
|
67028
67181
|
}
|
|
67029
|
-
var
|
|
67182
|
+
var FLOOR_TOUCH2 = 5e-3;
|
|
67030
67183
|
var LOOSE = /* @__PURE__ */ new Set(["paper"]);
|
|
67031
67184
|
var BASE_MATERIAL = {
|
|
67032
67185
|
wood: "wood_hard",
|
|
@@ -67111,7 +67264,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67111
67264
|
else if (p.key === "wood" && material === "wood_hard" && thin < WOOD_THIN) material = "wood_soft";
|
|
67112
67265
|
const part = { id: p.id, material, shape: p.shape, position: p.position };
|
|
67113
67266
|
if (p.rotation) part.rotation = p.rotation;
|
|
67114
|
-
if (!LOOSE.has(material) && p.min[1] <=
|
|
67267
|
+
if (!LOOSE.has(material) && p.min[1] <= FLOOR_TOUCH2) part.anchored = true;
|
|
67115
67268
|
if (opts.carcass && LOOSE.has(material)) {
|
|
67116
67269
|
part.hands = 1;
|
|
67117
67270
|
part.tags = ["book"];
|
|
@@ -67134,6 +67287,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67134
67287
|
}
|
|
67135
67288
|
joints.push(j);
|
|
67136
67289
|
}
|
|
67290
|
+
holdLooseGroups({ parts: parts2, joints, boxOf: (id) => byId.get(id) });
|
|
67291
|
+
const low = (part) => byId.get(part.id).min[1];
|
|
67292
|
+
const wallMounted = parts2.some((part) => part.anchored && low(part) > FLOOR_TOUCH2);
|
|
67293
|
+
const sunk = parts2.some((part) => low(part) < -FLOOR_TOUCH2);
|
|
67294
|
+
const rooted = parts2.some((part) => part.material === "foliage") && parts2.some((part) => part.material.startsWith("wood") && low(part) <= FLOOR_TOUCH2);
|
|
67295
|
+
const fixed2 = wallMounted || sunk || rooted;
|
|
67137
67296
|
const all = drawn.reduce(
|
|
67138
67297
|
(m, p) => ({ x0: Math.min(m.x0, p.min[0]), x1: Math.max(m.x1, p.max[0]), z0: Math.min(m.z0, p.min[2]), z1: Math.max(m.z1, p.max[2]) }),
|
|
67139
67298
|
{ x0: Infinity, x1: -Infinity, z0: Infinity, z1: -Infinity }
|
|
@@ -67155,7 +67314,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67155
67314
|
if ((max2[0] - min2[0]) * (max2[1] - min2[1]) >= 0.6 * footprint && mid.max[1] >= 0.2) top = { part: mid.id, y: mid.max[1], parts: boards.map((b) => b.id) };
|
|
67156
67315
|
}
|
|
67157
67316
|
if (opts.carcass) carcass(parts2, byId);
|
|
67158
|
-
const spec = { name, parts: parts2, joints, tags: ["furniture"] };
|
|
67317
|
+
const spec = { name, parts: parts2, joints, tags: ["furniture"], ...fixed2 ? { fixed: fixed2 } : {} };
|
|
67159
67318
|
const colors = new Map(drawn.map((p) => [p.id, p.color]));
|
|
67160
67319
|
const build = (T3) => {
|
|
67161
67320
|
const group = markKitOrigin(new T3.Group(), { owner: "game-floorplan-three", kind: "furniture", id: name });
|
|
@@ -67185,7 +67344,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67185
67344
|
}
|
|
67186
67345
|
return group;
|
|
67187
67346
|
};
|
|
67188
|
-
return { spec, build, top };
|
|
67347
|
+
return { spec, build, top, fixed: fixed2 };
|
|
67189
67348
|
}
|
|
67190
67349
|
function furnitureSpec(THREE, type, opts = {}) {
|
|
67191
67350
|
const renderer = rendererOf(THREE, opts.document);
|
|
@@ -67221,7 +67380,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67221
67380
|
);
|
|
67222
67381
|
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]);
|
|
67223
67382
|
K.PARTS.length = before;
|
|
67224
|
-
return { spec: made.spec, build: made.build, top: made.top, size: { w, d, h }, spouts };
|
|
67383
|
+
return { spec: made.spec, build: made.build, top: made.top, size: { w, d, h }, spouts, fixed: made.fixed };
|
|
67225
67384
|
}
|
|
67226
67385
|
|
|
67227
67386
|
// src/attachments-key.ts
|
|
@@ -81763,7 +81922,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
81763
81922
|
rules: { dropCapacity: 400, curbCatch: false, guardBehindWall: false, clipRoadEnd: false, dripStyle: "workshop" }
|
|
81764
81923
|
});
|
|
81765
81924
|
|
|
81766
|
-
// ../game-items-three/dist/chunk-
|
|
81925
|
+
// ../game-items-three/dist/chunk-S4UUQQOL.js
|
|
81767
81926
|
var destruction_default = {
|
|
81768
81927
|
families: {
|
|
81769
81928
|
drink_can: {
|
|
@@ -83739,7 +83898,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
83739
83898
|
teamId: "pregos",
|
|
83740
83899
|
teamBox: [
|
|
83741
83900
|
1.3,
|
|
83742
|
-
0.
|
|
83901
|
+
0.335,
|
|
83743
83902
|
0.5
|
|
83744
83903
|
],
|
|
83745
83904
|
scale: 0.1
|
|
@@ -86383,7 +86542,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
86383
86542
|
mesh3(cyl(0.035, 0.035, 1.1, 6), steel, [direction * 0.06, y, z], [0, 0, R]),
|
|
86384
86543
|
mesh3(new T2.ConeGeometry(0.035, 0.16, 6), steel, [-direction * 0.57, y, z], [0, 0, direction * R])
|
|
86385
86544
|
];
|
|
86386
|
-
|
|
86545
|
+
const LOW = -0.0675;
|
|
86546
|
+
const HIGH = LOW + 0.135;
|
|
86547
|
+
return G(...nail(LOW, -0.15, 1), ...nail(LOW, 0.15, -1), ...nail(HIGH, -0.15, -1), ...nail(HIGH, 0.15, 1));
|
|
86387
86548
|
};
|
|
86388
86549
|
var raffiaSack = ({ mesh: mesh3, bx, G, cloth: cloth2 }) => {
|
|
86389
86550
|
return G(
|