@adatechnology/game-items-three 0.10.7 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-S4UUQQOL.js → chunk-64JEKMFT.js} +18 -10
- package/dist/chunk-64JEKMFT.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +454 -106
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{testing-CBYX7wTL.d.ts → testing-D2tqWTG4.d.ts} +4 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +15 -13
- package/dist/chunk-S4UUQQOL.js.map +0 -1
package/dist/index.global.js
CHANGED
|
@@ -93,7 +93,7 @@ var GameItemsThree = (() => {
|
|
|
93
93
|
wearableMaterials: () => wearableMaterials
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
// ../game-shapes/dist/chunk-
|
|
96
|
+
// ../game-shapes/dist/chunk-QETSTM6M.js
|
|
97
97
|
function canonicalJson(value) {
|
|
98
98
|
if (value === null) return "null";
|
|
99
99
|
if (typeof value === "number") return Object.is(value, -0) ? "-0" : Number.isFinite(value) ? String(value) : JSON.stringify(String(value));
|
|
@@ -1793,6 +1793,12 @@ var GameItemsThree = (() => {
|
|
|
1793
1793
|
const flame = flameBase * (1 - rules.flameFillInfluence * (1 - k));
|
|
1794
1794
|
return 1 - (1 - Math.min(1, Math.max(0, spark))) * (1 - Math.min(1, Math.max(0, flame)));
|
|
1795
1795
|
};
|
|
1796
|
+
var sealBlock = (seal, state) => {
|
|
1797
|
+
if (seal.spoilsWhenBreached && state.breached) return "breached";
|
|
1798
|
+
if (seal.spoilsWhenBreached && state.leaked) return "leaked";
|
|
1799
|
+
if (!state.opened) return "sealed";
|
|
1800
|
+
return void 0;
|
|
1801
|
+
};
|
|
1796
1802
|
var DEFERRED_QUEUE_ID = {
|
|
1797
1803
|
DESTRUCTION_EVENTS: "destruction.events",
|
|
1798
1804
|
BREACH_PAINT: "floorplan.breach-paint",
|
|
@@ -1941,6 +1947,7 @@ var GameItemsThree = (() => {
|
|
|
1941
1947
|
};
|
|
1942
1948
|
return registry;
|
|
1943
1949
|
};
|
|
1950
|
+
var resolveEntry = (registry, entry2, kindField = "kind") => deepMerge(registry.defaults(String(entry2[kindField])), entry2);
|
|
1944
1951
|
var KIT_ORIGIN_KEY = "kitOrigin";
|
|
1945
1952
|
function markKitOrigin(object2, origin) {
|
|
1946
1953
|
const node = object2;
|
|
@@ -8167,13 +8174,13 @@ var GameItemsThree = (() => {
|
|
|
8167
8174
|
const hole = metal(1842463);
|
|
8168
8175
|
const corners = [[2.5, 1.8], [-2.5, 1.8], [2.5, -1.8], [-2.5, -1.8]];
|
|
8169
8176
|
return G(
|
|
8170
|
-
mesh2(bx(
|
|
8171
|
-
mesh2(bx(6, 0.
|
|
8172
|
-
mesh2(bx(6, 0.
|
|
8173
|
-
mesh2(bx(0.16, 0.
|
|
8174
|
-
mesh2(bx(0.16, 0.
|
|
8175
|
-
mesh2(bx(1.2, 0.
|
|
8176
|
-
...corners.map(([x, z]) => mesh2(cyl(0.12, 0.12, 0.
|
|
8177
|
+
mesh2(bx(5.68, 6e-3, 4.18), zinc, [0, 0, 0]),
|
|
8178
|
+
mesh2(bx(6, 0.03, 0.16), edge, [0, 0, 2.17]),
|
|
8179
|
+
mesh2(bx(6, 0.03, 0.16), edge, [0, 0, -2.17]),
|
|
8180
|
+
mesh2(bx(0.16, 0.03, 4.18), edge, [2.92, 0, 0]),
|
|
8181
|
+
mesh2(bx(0.16, 0.03, 4.18), edge, [-2.92, 0, 0]),
|
|
8182
|
+
mesh2(bx(1.2, 0.03, 0.8), metal(8014380), [-0.8, 0, -0.4]),
|
|
8183
|
+
...corners.map(([x, z]) => mesh2(cyl(0.12, 0.12, 0.03, 8), hole, [x, 0, z]))
|
|
8177
8184
|
);
|
|
8178
8185
|
};
|
|
8179
8186
|
|
|
@@ -9173,7 +9180,8 @@ var GameItemsThree = (() => {
|
|
|
9173
9180
|
// src/models/laptop.ts
|
|
9174
9181
|
var laptop = ({ mesh: mesh2, cyl, bx, G, metal, plastic }) => G(
|
|
9175
9182
|
mesh2(bx(0.36, 0.012, 0.25), metal(9277588), [0, 6e-3, 0]),
|
|
9176
|
-
mesh2(bx(0.
|
|
9183
|
+
mesh2(bx(0.356, 0.012, 0.246), metal(2895667), [0, 0.017, 0]),
|
|
9184
|
+
// the lid 2 mm inside the base's sides (CLAUDE.md §13)
|
|
9177
9185
|
mesh2(cyl(6e-3, 6e-3, 0.2, 8), plastic(1842204), [0, 0.0125, -0.12], [0, 0, Math.PI / 2]),
|
|
9178
9186
|
mesh2(bx(0.05, 42e-4, 0.03), metal(11843514), [0, 0.0231, 0])
|
|
9179
9187
|
);
|
|
@@ -11245,7 +11253,7 @@ var GameItemsThree = (() => {
|
|
|
11245
11253
|
K.cyl("metal", 0, y - 0.06, 0, 0.14, 0.015, gold);
|
|
11246
11254
|
for (let i = 0; i < 6; i++) {
|
|
11247
11255
|
const an = i * Math.PI / 3, cx = Math.cos(an), cz = Math.sin(an);
|
|
11248
|
-
K.box("metal", cx * 0.14, y - 0.06, cz * 0.14, 0.28, 0.012, 0.012, gold, -an);
|
|
11256
|
+
K.box("metal", cx * 0.14, y - (M.visorScene ? 0.06 : 0.062), cz * 0.14, 0.28, 0.012, 0.012, gold, -an);
|
|
11249
11257
|
K.cyl("plain", cx * 0.28, y - 0.06, cz * 0.28, 0.02, 0.09, 15787720);
|
|
11250
11258
|
K.cyl(on ? "emissive" : "plain", cx * 0.28, y + 0.03, cz * 0.28, 0.012, 0.03, on ? 16767120 : 15128752, 0, 0, "sphere");
|
|
11251
11259
|
K.box("glass", cx * 0.3, y - 0.2, cz * 0.3, 0.025, 0.14, 0.025, 16777215, -an);
|
|
@@ -11308,10 +11316,17 @@ var GameItemsThree = (() => {
|
|
|
11308
11316
|
B.sofa_l = (M, a) => {
|
|
11309
11317
|
const K = kit(M, a), { w, d } = K.dim("sofa_l"), c = K.fabric(pick(K, [7237752, 9075304, 4544618])), cd = shade2(c, 0.82), zb = -d / 2, pf = 0.95, ac = K.accent(13146698), cw = 0.95;
|
|
11310
11318
|
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("wood", sx * (w / 2 - 0.1), 0, sz * (d / 2 - 0.1), 0.05, 0.08, 0.05, K.wood(2759956));
|
|
11311
|
-
|
|
11312
|
-
|
|
11319
|
+
if (M.visorScene) {
|
|
11320
|
+
K.box("fabric", -(cw / 2), 0.08, zb + pf / 2, w - cw, 0.26, pf, cd);
|
|
11321
|
+
K.box("fabric", w / 2 - cw / 2, 0.08, 0, cw, 0.26, d, cd);
|
|
11322
|
+
} else {
|
|
11323
|
+
const zf = zb + 0.22, xs = -w / 2 + 0.18;
|
|
11324
|
+
K.box("fabric", (xs + w / 2 - cw) / 2, 0.08, (zf + zb + pf) / 2, w / 2 - cw - xs, 0.26, zb + pf - zf, cd);
|
|
11325
|
+
K.box("fabric", w / 2 - cw / 2, 0.08, (zf + d / 2) / 2, cw, 0.26, d / 2 - zf, cd);
|
|
11326
|
+
}
|
|
11313
11327
|
K.box("fabric", 0, 0.08, zb + 0.11, w, 0.72, 0.22, cd);
|
|
11314
|
-
K.box("fabric", -w / 2 + 0.09, 0.08, zb + pf / 2, 0.18, 0.55, pf, cd);
|
|
11328
|
+
if (M.visorScene) K.box("fabric", -w / 2 + 0.09, 0.08, zb + pf / 2, 0.18, 0.55, pf, cd);
|
|
11329
|
+
else K.box("fabric", -w / 2 + 0.09, 0.08, (zb + 0.22 + zb + pf) / 2, 0.18, 0.55, pf - 0.22, cd);
|
|
11315
11330
|
const nm = 2, mw = (w - cw - 0.18) / nm;
|
|
11316
11331
|
for (let i = 0; i < nm; i++) K.box("fabric", -w / 2 + 0.18 + (i + 0.5) * mw, 0.34, zb + 0.12 + 0.39, mw - 0.02, 0.16, 0.78, c);
|
|
11317
11332
|
K.box("fabric", w / 2 - cw / 2, 0.34, 0.035, cw - 0.04, 0.16, d - 0.2, c);
|
|
@@ -11330,7 +11345,7 @@ var GameItemsThree = (() => {
|
|
|
11330
11345
|
K.box("fabric", 0, 0.55, -d / 2 + 0.5, 0.4, 0.16, 0.12, accent, 0, 0.5);
|
|
11331
11346
|
const hw = w + 0.5, n = Math.round(hw / 0.11);
|
|
11332
11347
|
K.box("wood", 0, 0.2, -d / 2 - 0.05, hw, 1, 0.04, shade2(wood, 0.7));
|
|
11333
|
-
for (let i = 0; i < n; i++) K.box("wood", -hw / 2 + (i + 0.5) * hw / n, 0.25, -d / 2 - 0.02, hw / n - 0.025, 0.95, 0.04, i % 2 ? wood : shade2(wood, 1.12));
|
|
11348
|
+
for (let i = 0; i < n; i++) K.box("wood", -hw / 2 + (i + 0.5) * hw / n, 0.25, -d / 2 - 0.02, hw / n - 0.025, M.visorScene ? 0.95 : 0.948, 0.04, i % 2 ? wood : shade2(wood, 1.12));
|
|
11334
11349
|
for (const s of [-1, 1]) {
|
|
11335
11350
|
K.box("wood", s * (w / 2 + 0.3), 0.35, -d / 2 + 0.22, 0.4, 0.16, 0.36, shade2(wood, 1.05));
|
|
11336
11351
|
K.cyl("plain", s * (w / 2 + 0.3), 0.51, -d / 2 + 0.2, 0.06, 0.03, 15262940);
|
|
@@ -11342,8 +11357,8 @@ var GameItemsThree = (() => {
|
|
|
11342
11357
|
const K = kit(M, a), { w, d } = K.dim("home_office"), wood = K.wood(13808780), zb = -d / 2;
|
|
11343
11358
|
K.box("wood", 0, 0.72, 0, w, 0.035, d, wood);
|
|
11344
11359
|
for (const s of [-1, 1]) K.box("metal", s * (w / 2 - 0.04), 0, 0, 0.035, 0.72, d - 0.1, 2236966);
|
|
11345
|
-
K.box("metal", 0, 0.3, zb + 0.05, w - 0.1, 0.03, 0.02, 2236966);
|
|
11346
|
-
K.box("plain", w / 2 - 0.25, 0.28, 0, 0.4, 0.44, d - 0.08, 15262940);
|
|
11360
|
+
K.box("metal", 0, 0.3, zb + (M.visorScene ? 0.05 : 0.055), w - (M.visorScene ? 0.1 : 0.11), 0.03, 0.02, 2236966);
|
|
11361
|
+
K.box("plain", w / 2 - 0.25, 0.28, 0, 0.4, M.visorScene ? 0.44 : 0.436, d - 0.08, 15262940);
|
|
11347
11362
|
for (let i = 0; i < 2; i++) {
|
|
11348
11363
|
K.box("plain", w / 2 - 0.25, 0.3 + i * 0.2, d / 2 - 0.04, 0.37, 0.18, 0.01, 15920870);
|
|
11349
11364
|
K.box("metal", w / 2 - 0.25, 0.39 + i * 0.2, d / 2 - 0.03, 0.12, 0.012, 0.012, 10132122);
|
|
@@ -11362,10 +11377,11 @@ var GameItemsThree = (() => {
|
|
|
11362
11377
|
const zc = d / 2 + 0.3, cc = K.fabric(2763310);
|
|
11363
11378
|
K.box("plain", 0, 0.44, zc, 0.48, 0.07, 0.46, cc);
|
|
11364
11379
|
K.box("plain", 0, 0.52, zc + 0.22, 0.44, 0.52, 0.07, cc, 0, 0.12);
|
|
11365
|
-
K.cyl("metal", 0, 0.06, zc, 0.025, 0.38, 2763306);
|
|
11380
|
+
K.cyl("metal", 0, M.visorScene ? 0.06 : 0.07, zc, 0.025, M.visorScene ? 0.38 : 0.37, 2763306);
|
|
11366
11381
|
for (let i = 0; i < 5; i++) {
|
|
11367
11382
|
const an = i * 1.2566, x = Math.cos(an) * 0.17, z = zc + Math.sin(an) * 0.17;
|
|
11368
|
-
|
|
11383
|
+
const lo = M.visorScene ? 0 : i * 15e-4;
|
|
11384
|
+
K.box("metal", Math.cos(an) * 0.085, 0.06 - lo, zc + Math.sin(an) * 0.085, 0.18, 0.025 + 2 * lo, 0.03, 2763306, -an);
|
|
11369
11385
|
K.cyl("plain", x, 0, z, 0.03, 0.05, 1710618);
|
|
11370
11386
|
}
|
|
11371
11387
|
};
|
|
@@ -11375,9 +11391,10 @@ var GameItemsThree = (() => {
|
|
|
11375
11391
|
K.box("plain", 0, 0, -d / 2 + 0.01, inner, M.visorScene ? h : h - 0.03, 0.02, shade2(wood, 0.95));
|
|
11376
11392
|
for (const s of [-1, 1]) K.box("plain", s * (w / 2 - 0.015), 0, 0, 0.03, h, d, wood);
|
|
11377
11393
|
K.box("plain", 0, h - 0.03, 0, inner, 0.03, d, wood);
|
|
11378
|
-
K.box("plain", 0, 0.06, 0, w - 0.06, 0.02, d - 0.02, wood);
|
|
11379
|
-
K.box("plain", 0, 0, 0, w - 0.04, 0.06, d - 0.06, 2763306);
|
|
11380
|
-
K.box("plain", dv, 0.06, 0, 0.025, h - 0.09, d - 0.02, wood);
|
|
11394
|
+
K.box("plain", 0, 0.06, M.visorScene ? 0 : 5e-3, w - 0.06, 0.02, M.visorScene ? d - 0.02 : d - 0.03, wood);
|
|
11395
|
+
K.box("plain", 0, 0, 0, M.visorScene ? w - 0.04 : w - 0.06, 0.06, d - 0.06, 2763306);
|
|
11396
|
+
if (M.visorScene) K.box("plain", dv, 0.06, 0, 0.025, h - 0.09, d - 0.02, wood);
|
|
11397
|
+
else K.box("plain", dv, 0.08, 0.01, 0.025, h - 0.11, d - 0.04, wood);
|
|
11381
11398
|
const rod = h * 0.76;
|
|
11382
11399
|
K.cyl("metal", (-w / 2 + dv) / 2, rod, 0, 0.012, dv + w / 2 - 0.06, 11580600, 0, Math.PI / 2);
|
|
11383
11400
|
K.box("plain", (-w / 2 + dv) / 2, rod + 0.05, 0, dv + w / 2 - 0.05, 0.02, d - 0.04, wood);
|
|
@@ -11404,7 +11421,7 @@ var GameItemsThree = (() => {
|
|
|
11404
11421
|
};
|
|
11405
11422
|
B.vanity = (M, a) => {
|
|
11406
11423
|
const K = kit(M, a), { w, d } = K.dim("vanity"), zb = -d / 2, br = 16053488;
|
|
11407
|
-
K.cyl("plain", 0, 0, zb + 0.12, 0.08, 0.7, br);
|
|
11424
|
+
K.cyl("plain", 0, M.visorScene ? 0 : 0.03, zb + 0.12, 0.08, M.visorScene ? 0.7 : 0.67, br);
|
|
11408
11425
|
K.cyl("plain", 0, 0, zb + 0.12, 0.1, 0.03, br);
|
|
11409
11426
|
K.box("plain", 0, 0.74, 0, w, 0.12, d, br);
|
|
11410
11427
|
K.box("plain", 0, 0.865, 0.02, w - 0.1, 0.012, d - 0.1, 13949146);
|
|
@@ -11415,8 +11432,8 @@ var GameItemsThree = (() => {
|
|
|
11415
11432
|
K.box("plain", 0, 1.1, zb + 0.012, 0.52, 0.72, 0.024, K.color("metal", 14999768));
|
|
11416
11433
|
K.plane("atlas_picture", 0, 1.46, zb + 0.026, 0.46, 0.66, 16777215, 0, 0, 0, atlas("picture").mirror());
|
|
11417
11434
|
K.box("metal", -w / 2 - 0.02, 0.95, zb + 0.06, 0.03, 0.03, 0.03, 11580600);
|
|
11418
|
-
K.box("metal", -w / 2 - 0.02, 0.95, zb + 0.06, 0.28, 0.014, 0.014, 11580600);
|
|
11419
|
-
K.box("fabric", -w / 2 - 0.02, 0.62, zb + 0.065, 0.26, 0.34, 0.02, K.accent(3042942));
|
|
11435
|
+
K.box("metal", -w / 2 - 0.02, M.visorScene ? 0.95 : 0.958, zb + 0.06, 0.28, 0.014, 0.014, 11580600);
|
|
11436
|
+
K.box("fabric", -w / 2 - 0.02, 0.62, zb + (M.visorScene ? 0.065 : 0.064), 0.26, 0.34, M.visorScene ? 0.02 : 0.018, K.accent(3042942));
|
|
11420
11437
|
};
|
|
11421
11438
|
B.tv_stand = (M, a) => {
|
|
11422
11439
|
const K = kit(M, a), { w, d } = K.dim("tv_stand"), wood = K.wood(13148272), br = K.color("fabric_main", 15789542);
|
|
@@ -11460,7 +11477,7 @@ var GameItemsThree = (() => {
|
|
|
11460
11477
|
K.box("plain", w * 0.38, 0, z0 + 0.35, 0.5, 0.4, 0.4, 12098154, 0.2);
|
|
11461
11478
|
K.box("plain", w * 0.4, 0.4, z0 + 0.33, 0.45, 0.35, 0.38, 11044954, -0.3);
|
|
11462
11479
|
for (let i = 0; i < 4; i++) {
|
|
11463
|
-
K.box("wood", 0, 0.45 + i * 0.3, z0 + 0.62, w + 0.3, 0.14, 0.04, [8017460, 9071172, 7031338, 8018488][i], 0, 0, (i % 2 ? 1 : -1) * (0.06 + K.rnd() * 0.08));
|
|
11480
|
+
K.box("wood", 0, 0.45 + i * 0.3, z0 + 0.62 + (M.visorScene ? 0 : i % 2 * 3e-3), w + 0.3, 0.14, 0.04, [8017460, 9071172, 7031338, 8018488][i], 0, 0, (i % 2 ? 1 : -1) * (0.06 + K.rnd() * 0.08));
|
|
11464
11481
|
for (const s of [-1, 1]) K.cyl("metal", s * w * 0.4, 0.45 + i * 0.3, z0 + 0.65, 0.012, 0.02, 5921374, Math.PI / 2, 0);
|
|
11465
11482
|
}
|
|
11466
11483
|
K.box("wood", -w * 0.4, 0, z0 + 0.9, 0.4, 0.04, 0.4, wood, 0.3, 0, 0.4);
|
|
@@ -11519,10 +11536,10 @@ var GameItemsThree = (() => {
|
|
|
11519
11536
|
const K = kit(M, a), y = M.y || 0, cs = [13148208, 11549226, 4880954, 14209200, 9058858], rw = [4, 3, 2];
|
|
11520
11537
|
rw.forEach((n, r) => {
|
|
11521
11538
|
for (let i = 0; i < n; i++) {
|
|
11522
|
-
const x = (i - (n - 1) / 2) * 0.072, c = cs[(i + r * 2) % cs.length];
|
|
11523
|
-
K.cyl("plain", x,
|
|
11524
|
-
K.cyl("plain", x,
|
|
11525
|
-
K.cyl("metal", x,
|
|
11539
|
+
const x = (i - (n - 1) / 2) * 0.072, c = cs[(i + r * 2) % cs.length], ry = y + r * (M.visorScene ? 0.1 : 0.104);
|
|
11540
|
+
K.cyl("plain", x, ry, 0, 0.033, 0.1, c);
|
|
11541
|
+
K.cyl("plain", x, ry + 0.02, 0, 0.0345, 0.055, 15262936);
|
|
11542
|
+
K.cyl("metal", x, ry + 0.1, 0, 0.031, 4e-3, 12106944);
|
|
11526
11543
|
}
|
|
11527
11544
|
});
|
|
11528
11545
|
K.cyl("plain", 0.3, y + 0.033, 0.1, 0.033, 0.1, 13148208, 0, Math.PI / 2);
|
|
@@ -11541,10 +11558,11 @@ var GameItemsThree = (() => {
|
|
|
11541
11558
|
const K = kit(M, a), { w, d } = K.dim("floor_mattress"), h = 0.17, c = K.fabric(13156528), ac = K.accent(6965818);
|
|
11542
11559
|
K.box("fabric", 0, 0, 0, w, h, d, c);
|
|
11543
11560
|
for (let i = 0; i < 4; i++) K.box("fabric", -w / 2 + (i + 0.5) * w / 4, h, 0, w / 8, 3e-3, d - 0.04, shade2(c, 0.86));
|
|
11544
|
-
|
|
11545
|
-
K.box("fabric", 0
|
|
11546
|
-
K.box("fabric", 0.
|
|
11547
|
-
K.box("fabric",
|
|
11561
|
+
const v = M.visorScene ? 0 : 1;
|
|
11562
|
+
K.box("fabric", 0, h - v * 2e-3, -d / 2 + 0.28, w * 0.7, 0.1 + v * 2e-3, 0.38, 15789280, 0.05);
|
|
11563
|
+
K.box("fabric", 0.03, h - v * 4e-3, 0.3, w * 0.95, 0.05 + v * 4e-3, d * 0.55, ac, 0.05);
|
|
11564
|
+
K.box("fabric", 0.15, h + 0.05 - v * 2e-3, 0, w * 0.5, 0.05, 0.4, shade2(ac, 1.2), 0.3);
|
|
11565
|
+
K.box("fabric", -0.2, h + 0.05 - v * 4e-3, 0.5, w * 0.3, 0.06 + v * 4e-3, 0.3, shade2(ac, 0.8), -0.4);
|
|
11548
11566
|
};
|
|
11549
11567
|
B.lantern = (M, a) => {
|
|
11550
11568
|
const K = kit(M, a), y = M.y || 0;
|
|
@@ -11563,7 +11581,7 @@ var GameItemsThree = (() => {
|
|
|
11563
11581
|
K.cyl("plain", x, y + 0.012, z, 0.017, h, 15787720);
|
|
11564
11582
|
K.cyl("emissive", x, y + 0.012 + h, z, 8e-3, 0.03, i % 2 ? 16760928 : 16767120, 0, 0, "sphere");
|
|
11565
11583
|
});
|
|
11566
|
-
K.cyl("plain", 0.02, y + 0.012, 0, 0.05, 8e-3, 15787720);
|
|
11584
|
+
K.cyl("plain", 0.02, y + (M.visorScene ? 0.012 : 0.01), 0, 0.05, M.visorScene ? 8e-3 : 0.01, 15787720);
|
|
11567
11585
|
if (M.lit !== false) K.light(0, y + 0.22, 0, 16756832, 5, "candles");
|
|
11568
11586
|
};
|
|
11569
11587
|
B.open_suitcases = (M, a) => {
|
|
@@ -11572,7 +11590,7 @@ var GameItemsThree = (() => {
|
|
|
11572
11590
|
const lx = x, hz = z - dd / 2;
|
|
11573
11591
|
K.box("plain", lx, 0, z, ww, 0.16, dd, c, ry);
|
|
11574
11592
|
K.box("fabric", lx, 0.12, z, ww - 0.06, 0.05, dd - 0.06, 14209216, ry);
|
|
11575
|
-
for (let i = 0; i < 5; i++) K.box("fabric", lx + (K.rnd() - 0.5) * (ww - 0.2), 0.16, z + (K.rnd() - 0.5) * (dd - 0.2), 0.14 + K.rnd() * 0.1, 0.04 + K.rnd() * 0.04, 0.12 + K.rnd() * 0.1, rs[i % 4], K.rnd() * 3);
|
|
11593
|
+
for (let i = 0; i < 5; i++) K.box("fabric", lx + (K.rnd() - 0.5) * (ww - 0.2), M.visorScene ? 0.16 : 0.16 - i * 15e-4, z + (K.rnd() - 0.5) * (dd - 0.2), 0.14 + K.rnd() * 0.1, 0.04 + K.rnd() * 0.04, 0.12 + K.rnd() * 0.1, rs[i % 4], K.rnd() * 3);
|
|
11576
11594
|
K.ramp("plain", lx, 0.16, hz, ww, 0.07, dd, c, al);
|
|
11577
11595
|
K.box("metal", lx + ww * 0.3, 0.1, z + dd / 2, 0.04, 0.03, 0.01, 12632256);
|
|
11578
11596
|
};
|
|
@@ -11581,18 +11599,31 @@ var GameItemsThree = (() => {
|
|
|
11581
11599
|
};
|
|
11582
11600
|
B.clothes_on_floor = (M, a) => {
|
|
11583
11601
|
const K = kit(M, a), { w, d } = K.dim("clothes_on_floor"), cs = [13156520, 4876938, 11028538, 14736592, 6982234, 2763312, K.accent(13146698)];
|
|
11602
|
+
let k = 0;
|
|
11603
|
+
const tops = [];
|
|
11604
|
+
const lay = (m, x, y, z, bw, h, bd, c, r) => {
|
|
11605
|
+
if (M.visorScene) {
|
|
11606
|
+
K.box(m, x, y, z, bw, h, bd, c, r);
|
|
11607
|
+
return;
|
|
11608
|
+
}
|
|
11609
|
+
const y0 = 4e-3 + k++ * 15e-4;
|
|
11610
|
+
let top = y0 + h;
|
|
11611
|
+
while (tops.some((t) => Math.abs(t - top) < 13e-4)) top += 13e-4;
|
|
11612
|
+
tops.push(top);
|
|
11613
|
+
K.box(m, x, y0, z, bw, top - y0, bd, c, r);
|
|
11614
|
+
};
|
|
11584
11615
|
for (let i = 0; i < 9; i++) {
|
|
11585
11616
|
const x = (K.rnd() - 0.5) * (w - 0.3), z = (K.rnd() - 0.5) * (d - 0.3), r = K.rnd() * 6, c = cs[i % cs.length], y = 0.012 + i * 3e-3;
|
|
11586
11617
|
if (i % 3 === 0) {
|
|
11587
|
-
|
|
11588
|
-
for (const s of [-1, 1])
|
|
11618
|
+
lay("fabric", x, y, z, 0.3, 0.012, 0.36, c, r);
|
|
11619
|
+
for (const s of [-1, 1]) lay("fabric", x + Math.cos(r) * s * 0.2, y, z - Math.sin(r) * s * 0.2, 0.2, 0.012, 0.09, shade2(c, 0.9), r + s * 0.5);
|
|
11589
11620
|
} else if (i % 3 === 1) {
|
|
11590
|
-
for (const s of [-1, 1])
|
|
11591
|
-
} else
|
|
11621
|
+
for (const s of [-1, 1]) lay("fabric", x + s * 0.06, y, z, 0.13, 0.014, 0.5, 3820138, r + s * 0.15);
|
|
11622
|
+
} else lay("fabric", x, y, z, 0.14, 0.01, 0.07, c, r);
|
|
11592
11623
|
}
|
|
11593
11624
|
const sx = (K.rnd() - 0.5) * (w - 0.4), sz = (K.rnd() - 0.5) * (d - 0.4);
|
|
11594
|
-
|
|
11595
|
-
|
|
11625
|
+
lay("plain", sx, 0.012, sz, 0.09, 0.07, 0.27, 2763306, 0.4);
|
|
11626
|
+
lay("plain", sx + 0.15, 0.012, sz + 0.05, 0.09, 0.07, 0.27, 2763306, 0.9);
|
|
11596
11627
|
};
|
|
11597
11628
|
B.fallen_chair = (M, a) => {
|
|
11598
11629
|
const g = Math.PI / 2, dy = 0.23, api = { box: (Mm, mat, x, y, z, w, h, d, color2, ry, rx, rz) => {
|
|
@@ -11606,17 +11637,30 @@ var GameItemsThree = (() => {
|
|
|
11606
11637
|
};
|
|
11607
11638
|
B.blood_stains = (M, a) => {
|
|
11608
11639
|
const K = kit(M, a), { w, d } = K.dim("blood_stains");
|
|
11609
|
-
|
|
11640
|
+
let n = 0;
|
|
11641
|
+
const film = () => {
|
|
11642
|
+
const y0 = 0.011 - n * 11e-4, y1 = 0.0125 + n * 11e-4;
|
|
11643
|
+
n++;
|
|
11644
|
+
return { y: y0, h: y1 - y0 };
|
|
11645
|
+
};
|
|
11646
|
+
for (let k = 0; k < 7; k++) {
|
|
11647
|
+
const f = film();
|
|
11648
|
+
K.cyl("plain", (K.rnd() - 0.5) * w * 0.3 + n * 4e-3, f.y, (K.rnd() - 0.5) * d * 0.3, 0.12 + K.rnd() * 0.18 + n * 13e-4, f.h, k < 2 ? 3803142 : 5902348);
|
|
11649
|
+
}
|
|
11610
11650
|
for (let k = 0; k < 8; k++) {
|
|
11611
|
-
const an = K.rnd() * 6.28, r = 0.3 + K.rnd() * Math.min(w, d) * 0.4;
|
|
11612
|
-
K.cyl("plain", Math.cos(an) * r,
|
|
11651
|
+
const an = K.rnd() * 6.28, r = 0.3 + K.rnd() * Math.min(w, d) * 0.4, f = film();
|
|
11652
|
+
K.cyl("plain", Math.cos(an) * r, f.y, Math.sin(an) * r, 0.02 + K.rnd() * 0.05 + n * 13e-4, f.h, 4852232);
|
|
11653
|
+
}
|
|
11654
|
+
if (M.drag !== false) for (let k = 1; k < 6; k++) {
|
|
11655
|
+
const f = film();
|
|
11656
|
+
K.box("plain", 0.3 + k * 0.1, f.y, 0.15 + k * 0.17, 0.16 - k * 0.015, f.h, 0.2, 4852746, 0.5);
|
|
11613
11657
|
}
|
|
11614
|
-
if (M.drag !== false) for (let k = 1; k < 6; k++) K.box("plain", 0.3 + k * 0.1, 0.012, 0.15 + k * 0.17, 0.16 - k * 0.015, 3e-3, 0.2, 4852746, 0.5);
|
|
11615
11658
|
};
|
|
11616
11659
|
B.open_door = (M, a) => {
|
|
11617
11660
|
const K = kit(M, a), { w, d, h } = K.dim("open_door"), wood = K.wood(6965804), angle = M.angle != null ? M.angle : 1.2, L = w - 0.06, hx = -w / 2 + 0.03;
|
|
11618
|
-
|
|
11619
|
-
K.box("wood", w / 2
|
|
11661
|
+
const jh = M.visorScene ? h + 0.06 : h;
|
|
11662
|
+
K.box("wood", -w / 2 - 0.03, 0, 0, 0.06, jh, d, shade2(wood, 0.8));
|
|
11663
|
+
K.box("wood", w / 2 + 0.03, 0, 0, 0.06, jh, d, shade2(wood, 0.8));
|
|
11620
11664
|
K.box("wood", 0, h, 0, w + 0.12, 0.06, d, shade2(wood, 0.8));
|
|
11621
11665
|
K.box("wood", hx + Math.cos(angle) * L / 2, 0, Math.sin(angle) * L / 2, L, h - 0.02, 0.04, wood, -angle);
|
|
11622
11666
|
K.cyl("metal", hx + Math.cos(angle) * (L - 0.08), 1, Math.sin(angle) * (L - 0.08) + 0.04, 0.025, 0.06, 13152368, Math.PI / 2, 0);
|
|
@@ -11736,9 +11780,9 @@ var GameItemsThree = (() => {
|
|
|
11736
11780
|
for (const s of [-1, 1]) K.box("plain", s * (w / 2 + t / 2), 0, 0, t, 0.1, d, bo);
|
|
11737
11781
|
cover(a, M, "pool_tile", { w, d, y: 0.035, size: 1 });
|
|
11738
11782
|
K.plane("water", 0, 0.075, 0, w, d, 9426158, 0, -Math.PI / 2, 0);
|
|
11739
|
-
for (let i = 0; i < 3; i++) K.box("plain", w / 2 - 0.35 + i * 0, 0.035 + i * 0.01, d / 2 - 0.2 - i * 0.28, 0.7 - i * 0.05, 0.03, 0.26, 14675698);
|
|
11783
|
+
for (let i = 0; i < 3; i++) K.box("plain", w / 2 - 0.35 + i * 0, 0.035 + i * 0.01 - (M.visorScene || i !== 1 ? 0 : 2e-3), d / 2 - 0.2 - i * 0.28, 0.7 - i * 0.05, 0.03, 0.26, 14675698);
|
|
11740
11784
|
for (const s of [-1, 1]) {
|
|
11741
|
-
K.box("metal", -w / 4 + s * 0.2, 0, d / 2 + t * 0.6, 0.03, 0.85, 0.03, 13159632);
|
|
11785
|
+
K.box("metal", -w / 4 + s * 0.2, M.visorScene ? 0 : 2e-3, d / 2 + t * 0.6, 0.03, M.visorScene ? 0.85 : 0.848, 0.03, 13159632);
|
|
11742
11786
|
K.box("metal", -w / 4 + s * 0.2, 0.85, d / 2 + t * 0.6 - 0.1, 0.03, 0.03, 0.22, 13159632);
|
|
11743
11787
|
K.box("metal", -w / 4 + s * 0.2, 0, d / 2 - 0.25, 0.03, 0.88, 0.03, 13159632, 0, 0);
|
|
11744
11788
|
}
|
|
@@ -11748,20 +11792,22 @@ var GameItemsThree = (() => {
|
|
|
11748
11792
|
const K = kit(M, a), { w, d } = K.dim("deck"), h = 0.2, wood = K.wood(6965808);
|
|
11749
11793
|
K.box("wood", 0, 0, 0, w - 0.05, h, d - 0.05, shade2(wood, 0.7));
|
|
11750
11794
|
cover(a, M, "deck_floor", { w, d, y: h + 0.012, size: 1.2, color: M.color });
|
|
11751
|
-
for (const [x, z, ww, dd] of [[0, -d / 2, w, 0.05], [0, d / 2, w, 0.05], [-w / 2, 0, 0.05, d], [w / 2, 0, 0.05, d]]) K.box("wood", x, 0, z, ww, h + 0.02, dd, wood);
|
|
11752
|
-
|
|
11753
|
-
K.box("wood", 0, 0
|
|
11795
|
+
for (const [x, z, ww, dd] of [[0, -d / 2, w, 0.05], [0, d / 2, w, 0.05], [-w / 2, 0, 0.05, d], [w / 2, 0, 0.05, d]]) K.box("wood", x, 0, z, ww, h + 0.02, M.visorScene || dd !== d ? dd : d - 0.05, wood);
|
|
11796
|
+
const sz = M.visorScene ? d / 2 + 0.17 : d / 2 + 0.025 + 0.1575, sd = M.visorScene ? 0.34 : 0.315;
|
|
11797
|
+
K.box("wood", 0, 0, sz, 1.4, 0.1, sd, wood);
|
|
11798
|
+
K.box("wood", 0, 0.1, sz, 1.4, 0.012, sd, shade2(wood, 1.2));
|
|
11754
11799
|
};
|
|
11755
11800
|
B.sun_lounger = (M, a) => {
|
|
11756
11801
|
const K = kit(M, a), { w } = K.dim("sun_lounger"), fr = K.metal(15263972), al = 0.95, cu = K.fabric(3828378), stripe = K.accent(15789280);
|
|
11757
11802
|
for (const s of [-1, 1]) {
|
|
11758
11803
|
K.box("metal", s * (w / 2 - 0.03), 0.17, -0.3, 0.035, 0.035, 1.35, fr);
|
|
11759
|
-
|
|
11760
|
-
K.box("metal", s * (w / 2 - 0.03), 0,
|
|
11804
|
+
const lw = M.visorScene ? 0.035 : 0.025;
|
|
11805
|
+
K.box("metal", s * (w / 2 - 0.03), 0, 0.95, lw, 0.2, 0.035, fr);
|
|
11806
|
+
K.box("metal", s * (w / 2 - 0.03), 0, -0.3, lw, 0.2, 0.035, fr);
|
|
11761
11807
|
K.cyl("plain", s * (w / 2 - 0.03), 0.07, -0.3, 0.07, 0.03, 2763306, 0, Math.PI / 2);
|
|
11762
11808
|
}
|
|
11763
11809
|
K.box("fabric", 0, 0.21, 0.35, w - 0.1, 0.06, 1.3, cu);
|
|
11764
|
-
K.ramp("fabric", 0, 0.2, -0.3, w - 0.1, 0.06, 0.8, cu, al);
|
|
11810
|
+
K.ramp("fabric", 0, 0.2, -0.3, M.visorScene ? w - 0.1 : w - 0.104, 0.06, 0.8, cu, al);
|
|
11765
11811
|
for (let i = 0; i < 4; i++) {
|
|
11766
11812
|
K.box("fabric", 0, M.visorScene ? 0.265 : 0.268, 0 + i * 0.3, M.visorScene ? w - 0.098 : w - 0.096, 4e-3, 0.08, stripe);
|
|
11767
11813
|
}
|
|
@@ -11837,7 +11883,7 @@ var GameItemsThree = (() => {
|
|
|
11837
11883
|
for (const s of [-1, 1]) {
|
|
11838
11884
|
K.box("plain", s * 0.35, py + 0.05, pz, 0.04, 0.42, 0.74, az);
|
|
11839
11885
|
}
|
|
11840
|
-
K.box("plain", 0, py + 0.05, pz - 0.35, 0.74, 0.42, 0.04, az);
|
|
11886
|
+
K.box("plain", 0, py + 0.05, pz - 0.35, M.visorScene ? 0.74 : 0.66, 0.42, 0.04, az);
|
|
11841
11887
|
const run = d / 2 - pz - 0.4, al = Math.atan2(py - 0.1, run);
|
|
11842
11888
|
K.ramp("plain", 0, py, pz + 0.37, 0.5, 0.04, Math.hypot(run, py - 0.1) + 0.1, 14209216, -al + 0 + 0);
|
|
11843
11889
|
for (const s of [-1, 1]) K.ramp("plain", s * 0.27, py + 0.03, pz + 0.37, 0.04, 0.12, Math.hypot(run, py - 0.1) + 0.1, az, -al);
|
|
@@ -11847,7 +11893,7 @@ var GameItemsThree = (() => {
|
|
|
11847
11893
|
};
|
|
11848
11894
|
B.swing = (M, a) => {
|
|
11849
11895
|
const K = kit(M, a), { w, d, h } = K.dim("swing"), mt = K.color("metal", 3828400), L = Math.hypot(h, d / 2), an = Math.atan2(d / 2, h);
|
|
11850
|
-
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("metal", sx * w / 2, h / 2 - L / 2 + 0, sz * d / 4, 0.07, L, 0.07, mt, 0, -sz * an, 0);
|
|
11896
|
+
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("metal", sx * w / 2, h / 2 - L / 2 + 0, sz * d / 4, M.visorScene || sz < 0 ? 0.07 : 0.066, L, 0.07, mt, 0, -sz * an, 0);
|
|
11851
11897
|
K.box("metal", 0, h - 0.04, 0, w + 0.1, 0.1, 0.1, shade2(mt, 0.85));
|
|
11852
11898
|
const cs = [K.accent(13123642), 2763306];
|
|
11853
11899
|
for (let i = 0; i < 2; i++) {
|
|
@@ -11859,11 +11905,11 @@ var GameItemsThree = (() => {
|
|
|
11859
11905
|
B.bbq_simple = (M, a) => {
|
|
11860
11906
|
const K = kit(M, a), { w, d } = K.dim("bbq_simple"), br = K.color("exterior_floor", 11688512), hb = 0.78;
|
|
11861
11907
|
K.box("plain", 0, 0, 0, w, 0.45, d, br);
|
|
11862
|
-
for (const [x, z, ww, dd] of [[0, -d / 2 + 0.06, w, 0.12], [0, d / 2 - 0.06, w, 0.12], [-w / 2 + 0.06, 0, 0.12, d - 0.2], [w / 2 - 0.06, 0, 0.12, d - 0.2]]) K.box("plain", x, 0.45, z, ww, hb - 0.45, dd, br);
|
|
11863
|
-
K.box("plain", 0, 0.45, 0, w - 0.22, 0.04, d - 0.22, 2762276);
|
|
11908
|
+
for (const [x, z, ww, dd] of [[0, -d / 2 + 0.06, w, 0.12], [0, d / 2 - 0.06, w, 0.12], [-w / 2 + 0.06, 0, 0.12, d - 0.2], [w / 2 - 0.06, 0, 0.12, d - 0.2]]) K.box("plain", x, 0.45, z, ww, hb - 0.45, M.visorScene || dd !== d - 0.2 ? dd : d - 0.24, br);
|
|
11909
|
+
K.box("plain", 0, 0.45, 0, w - (M.visorScene ? 0.22 : 0.24), 0.04, d - (M.visorScene ? 0.22 : 0.24), 2762276);
|
|
11864
11910
|
for (let i = 0; i < 10; i++) K.box("plain", (K.rnd() - 0.5) * (w - 0.3), M.visorScene ? 0.49 : 0.49 + i * 22e-4, (K.rnd() - 0.5) * (d - 0.3), 0.08, 0.02, 0.07, i % 3 ? 13126170 : 3811876, K.rnd() * 3);
|
|
11865
11911
|
for (let i = 0; i < 7; i++) K.box("metal", -w / 2 + 0.16 + i * (w - 0.32) / 6, hb + 0.01, 0, 0.012, 0.012, d - 0.1, 5921374);
|
|
11866
|
-
K.box("metal", 0, hb + 0.01, -d / 2 + 0.2, w - 0.1, 0.012, 0.02, 5921374);
|
|
11912
|
+
K.box("metal", 0, hb + (M.visorScene ? 0.01 : 8e-3), -d / 2 + 0.2, w - 0.1, M.visorScene ? 0.012 : 0.016, 0.02, 5921374);
|
|
11867
11913
|
for (let i = 0; i < 3; i++) {
|
|
11868
11914
|
const z = (i - 1) * 0.15;
|
|
11869
11915
|
K.cyl("metal", 0, hb + 0.05, z, 6e-3, w + 0.12, 11580600, 0, Math.PI / 2);
|
|
@@ -11879,7 +11925,7 @@ var GameItemsThree = (() => {
|
|
|
11879
11925
|
const cz = -0.35;
|
|
11880
11926
|
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("plain", sx * (w / 2 - 0.1), 0.76, cz + sz * 0.8, 0.07, 0.5, 0.07, shade2(c, 0.9));
|
|
11881
11927
|
K.box("plain", 0, 1.26, cz, w - 0.1, 0.05, 1.75, shade2(c, 1.04));
|
|
11882
|
-
K.box("glass", 0, 0.76, cz, w - 0.06, 0.5, 1.6, 16777215);
|
|
11928
|
+
K.box("glass", 0, M.visorScene ? 0.76 : 0.762, cz, w - 0.06, M.visorScene ? 0.5 : 0.496, 1.6, 16777215);
|
|
11883
11929
|
K.box("glass", 0, 0.76, cz + 0.8, w - 0.12, 0.5, 0.04, 16777215, 0, 0.5);
|
|
11884
11930
|
for (const s of [-1, 1]) {
|
|
11885
11931
|
K.box("plain", s * 0.4, 0.55, cz + 0.4, 0.4, 0.3, 0.4, 2763310);
|
|
@@ -11905,10 +11951,9 @@ var GameItemsThree = (() => {
|
|
|
11905
11951
|
K.box("plain", xa, 0, zc, 1.6, 0.85, 0.7, br);
|
|
11906
11952
|
for (let i = 1; i < 4; i++) K.box("plain", xa, i * 0.2, zc + 0.351, 1.6, 0.012, 4e-3, shade2(br, 0.7));
|
|
11907
11953
|
K.box("plain", xa, 0.12, zc + (M.visorScene ? 0.352 : 0.355), 0.7, 0.4, 4e-3, 1709586);
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
for (let i = 0; i < 6; i++) K.box("plain", xa + (K.rnd() - 0.5) * 1.2, M.visorScene ? 0.88 : 0.88 + i * 22e-4, zc + (K.rnd() - 0.5) * 0.3, 0.1, 0.02, 0.08, i % 2 ? 13126170 : 3811876, K.rnd() * 3);
|
|
11954
|
+
const sd = M.visorScene ? 0.7 : 0.4, sz = M.visorScene ? zc : zc + 0.05;
|
|
11955
|
+
for (const [x, z, ww, dd] of [[xa, zc - 0.25, 1.6, 0.2], [xa, zc + 0.3, 1.6, 0.1], [xa - 0.75, sz, 0.1, sd], [xa + 0.75, sz, 0.1, sd]]) K.box("plain", x, 0.85, z, ww, 0.12, dd, br);
|
|
11956
|
+
K.box("plain", xa, M.visorScene ? 0.85 : 0.852, zc + 0.02, 1.4, 0.025, 0.4, 2762276);
|
|
11912
11957
|
K.box("plain", xa, 1.5, zc - 0.07, 1.5, 0.4, 0.56, br);
|
|
11913
11958
|
K.box("plain", xa, 1.5, zc + 0.215, 1.5, 0.4, 0.01, 1709586);
|
|
11914
11959
|
K.box("plain", xa, 1.9, zc - 0.12, 0.62, 1, 0.46, br);
|
|
@@ -11916,9 +11961,10 @@ var GameItemsThree = (() => {
|
|
|
11916
11961
|
K.box("plain", xa, 2.98, zc - 0.12, 0.5, 0.06, 0.4, shade2(br, 0.75));
|
|
11917
11962
|
K.box("plain", xb, 0, zc, 1.44, 0.85, 0.7, cab);
|
|
11918
11963
|
for (let i = 0; i < 3; i++) K.box("wood", xb - 0.48 + i * 0.48, 0.08, zc + 0.355, 0.44, 0.7, 0.012, wood);
|
|
11919
|
-
|
|
11964
|
+
const ct0 = M.visorScene ? xb - 0.74 : xa + 0.802, ct1 = xc + 0.67;
|
|
11965
|
+
K.box("plain", M.visorScene ? (xb + xc) / 2 : (ct0 + ct1) / 2, 0.85, zc, M.visorScene ? 0.72 * 2 + 0.65 + 0.04 : ct1 - ct0, 0.04, 0.74, gr);
|
|
11920
11966
|
K.box("metal", xb, 0.89, zc, 0.5, 0.01, 0.38, 11580600);
|
|
11921
|
-
K.box("metal", xb, M.visorScene ? 0.895 : 0.
|
|
11967
|
+
K.box("metal", xb, M.visorScene ? 0.895 : 0.893, zc, 0.44, M.visorScene ? 6e-3 : 4e-3, 0.32, 7370362);
|
|
11922
11968
|
K.box("plain", xc, 0, zc, 1.3, 0.85, 0.7, cab);
|
|
11923
11969
|
for (let i = 0; i < 2; i++) K.box("wood", xc - 0.32 + i * 0.64, 0.08, zc + 0.355, 0.6, 0.7, 0.012, wood);
|
|
11924
11970
|
K.cyl("plain", xc, 0.89, zc, 0.1, 0.05, 15790314);
|
|
@@ -11941,7 +11987,7 @@ var GameItemsThree = (() => {
|
|
|
11941
11987
|
const K = kit(M, a), { w, d, h } = K.dim("sauna"), t = 0.08, wood = K.wood(12618324), shade1 = shade2(wood, 0.88), dw = 0.7, dx = w / 2 - 0.55;
|
|
11942
11988
|
K.box("wood", 0, 0, 0, w, 0.05, d, shade2(wood, 0.75));
|
|
11943
11989
|
K.box("wood", 0, 0.05, -d / 2 + t / 2, w, h - 0.11, t, wood);
|
|
11944
|
-
for (const s of [-1, 1]) K.box("wood", s * (w / 2 - t / 2), 0.05, 0, t, h - 0.11, d - 2 * t
|
|
11990
|
+
for (const s of [-1, 1]) K.box("wood", s * (w / 2 - t / 2), 0.05, 0, t, h - 0.11, M.visorScene ? d : d - 2 * t, wood);
|
|
11945
11991
|
K.box("wood", 0, h - 0.06, 0, w + 0.12, 0.06, d + 0.12, shade2(wood, 0.75));
|
|
11946
11992
|
const lx0 = -w / 2, lx1 = dx - dw / 2;
|
|
11947
11993
|
K.box("wood", (lx0 + lx1) / 2, 0.05, d / 2 - t / 2, lx1 - lx0, h - 0.11, t, wood);
|
|
@@ -11952,8 +11998,9 @@ var GameItemsThree = (() => {
|
|
|
11952
11998
|
K.box("wood", x, 0.05, d / 2 + 3e-3, 0.012, h - 0.11, 5e-3, shade2(wood, 0.6));
|
|
11953
11999
|
}
|
|
11954
12000
|
const jamb = M.visorScene ? 0.025 : 0;
|
|
11955
|
-
|
|
11956
|
-
K.box("wood", dx
|
|
12001
|
+
const jy = M.visorScene ? 0.05 : 0.048;
|
|
12002
|
+
K.box("wood", dx - dw / 2 - jamb, jy, d / 2 - 0.02, 0.05, 1.87 - jy, 0.06, shade1);
|
|
12003
|
+
K.box("wood", dx + dw / 2 + jamb, jy, d / 2 - 0.02, 0.05, 1.87 - jy, 0.06, shade1);
|
|
11957
12004
|
K.box("glass", dx, 0.06, d / 2 - 0.02, dw, 1.75, 0.02, 16777215);
|
|
11958
12005
|
K.box("metal", dx - dw / 2 + 0.08, 0.7, d / 2 + 0.03, 0.02, 0.5, 0.03, 13159632);
|
|
11959
12006
|
K.box("wood", 0, 0.85, -d / 2 + t + 0.25, w - 2 * t, 0.05, 0.5, shade2(wood, 1.1));
|
|
@@ -12378,7 +12425,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
12378
12425
|
box: (M, material, x, y, z, w, h, d, color2, ry, rx, rz) => void primitives.push({ kind: "box", M, material, x, y, z, w, h, d, color: color2, ry, rx, rz }),
|
|
12379
12426
|
cylinder: (M, material, x, y, z, r, h, color2, rx, rz, shape) => void primitives.push({ kind: "cylinder", M, material, x, y, z, r, h, color: color2, rx, rz, shape }),
|
|
12380
12427
|
leaf: (M, x, y, z, w, h, color2, ry, rx) => void primitives.push({ kind: "leaf", M, x, y, z, w, h, color: color2, ry, rx }),
|
|
12381
|
-
plane: (M, material, x, y, z, w, h, color2, ry, rx, rz, uv) => void primitives.push({ kind: "plane", M, material, x, y, z, w, h, color: color2, ry, rx, rz, uv })
|
|
12428
|
+
plane: (M, material, x, y, z, w, h, color2, ry, rx, rz, uv) => void primitives.push({ kind: "plane", M, material, x, y, z, w, h, color: color2, ry, rx, rz, uv }),
|
|
12429
|
+
lathe: (M, material, x, y, z, points, color2) => void primitives.push({ kind: "lathe", M, material, x, y, z, points, color: color2 })
|
|
12382
12430
|
};
|
|
12383
12431
|
if (options.light !== false) {
|
|
12384
12432
|
api.light = (M, x, y, z, color2, range2, lightKind) => void primitives.push({ kind: "light", M, x, y, z, color: color2, range: range2, lightKind });
|
|
@@ -12447,6 +12495,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
12447
12495
|
list2.push({ kind: "cylinder", radiusTop: 1, radiusBottom: 1, height: 1, radialSegments: cyl, ...place });
|
|
12448
12496
|
}
|
|
12449
12497
|
},
|
|
12498
|
+
lathe(M, material, x, y, z, points, color2) {
|
|
12499
|
+
into(M).push({ kind: "lathe", material, color: color2, position: [x, y, z], points: points.map(([r, py]) => [r, py]), segments: cyl });
|
|
12500
|
+
},
|
|
12450
12501
|
leaf(M, x, y, z, w, h, color2, ry, rx) {
|
|
12451
12502
|
into(M).push({ kind: "mesh", ...LEAF, material: "plant", color: color2, position: [x, y, z], rotation: [rx, ry, 0], rotationOrder: "YXZ", scale: [w, h, 1] });
|
|
12452
12503
|
},
|
|
@@ -13074,6 +13125,33 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
13074
13125
|
return out;
|
|
13075
13126
|
};
|
|
13076
13127
|
var granules = (inp, box4, count) => bsp(box4, count, [0, 1, 2], inp.rnd).map((b) => ({ center: b.c, size: b.s, q: quat.identity(), shape: "chunk", weight: b.s[0] * b.s[1] * b.s[2] }));
|
|
13128
|
+
var SLAB_MIN = 0.03;
|
|
13129
|
+
var splitAtHit = (root, hit, axes, count, rnd) => {
|
|
13130
|
+
let pieces = [root];
|
|
13131
|
+
for (const ax of axes) {
|
|
13132
|
+
const half = root.s[ax] / 2;
|
|
13133
|
+
if (hit[ax] - -half < SLAB_MIN || half - hit[ax] < SLAB_MIN) continue;
|
|
13134
|
+
const next = [];
|
|
13135
|
+
for (const b of pieces) {
|
|
13136
|
+
const lo = b.c[ax] - b.s[ax] / 2;
|
|
13137
|
+
const hi = b.c[ax] + b.s[ax] / 2;
|
|
13138
|
+
for (const [from, to] of [[lo, hit[ax]], [hit[ax], hi]]) {
|
|
13139
|
+
const c = [b.c[0], b.c[1], b.c[2]];
|
|
13140
|
+
const s = [b.s[0], b.s[1], b.s[2]];
|
|
13141
|
+
c[ax] = (from + to) / 2;
|
|
13142
|
+
s[ax] = to - from;
|
|
13143
|
+
next.push({ c, s });
|
|
13144
|
+
}
|
|
13145
|
+
}
|
|
13146
|
+
pieces = next;
|
|
13147
|
+
}
|
|
13148
|
+
while (pieces.length < count) {
|
|
13149
|
+
pieces.sort((a, b) => b.s[axes[0]] * b.s[axes[1]] - a.s[axes[0]] * a.s[axes[1]]);
|
|
13150
|
+
const [big, ...rest2] = pieces;
|
|
13151
|
+
pieces = [...bsp(big, 2, axes, rnd), ...rest2];
|
|
13152
|
+
}
|
|
13153
|
+
return pieces;
|
|
13154
|
+
};
|
|
13077
13155
|
var CRUMBS = 6;
|
|
13078
13156
|
var severAt = (inp, root, at2, gap) => {
|
|
13079
13157
|
const dims = root.s;
|
|
@@ -13136,7 +13214,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
13136
13214
|
if (inp.cut) return severAt(inp, root, inp.cut.at, inp.cut.gap);
|
|
13137
13215
|
if (inp.form === "plies") return plyBreak(inp, root, maxFragments);
|
|
13138
13216
|
const n2 = Math.min(maxFragments, 2 + Math.floor(rnd() * 3));
|
|
13139
|
-
|
|
13217
|
+
const slabs = inp.form === "granules" && dims[t] < Math.min(dims[u], dims[v]) / 4 ? splitAtHit(root, inp.hit, [u, v], n2, rnd) : bsp(root, n2, [0, 1, 2], rnd);
|
|
13218
|
+
for (const b of slabs) out.push({ center: b.c, size: b.s, q: idq, shape: "slab", weight: b.s[0] * b.s[1] * b.s[2] });
|
|
13140
13219
|
if (inp.form !== "granules") return out;
|
|
13141
13220
|
const crumbs = Math.min(CRUMBS, maxFragments - out.length);
|
|
13142
13221
|
if (crumbs <= 0) return out;
|
|
@@ -21469,6 +21548,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21469
21548
|
}).events;
|
|
21470
21549
|
},
|
|
21471
21550
|
state: (id) => objects.get(id)?.st ?? impls.get(id)?.impl.state() ?? null,
|
|
21551
|
+
anchoredParts: (id) => objects.get(id)?.parts.filter((p) => p.anchored && !isLost(p)).map((p) => p.spec.id) ?? [],
|
|
21552
|
+
fixedInPlace: (id) => {
|
|
21553
|
+
const o = objects.get(id);
|
|
21554
|
+
return !!o && o.spec.fixed === true && o.parts.some((p) => p.anchored && !isLost(p));
|
|
21555
|
+
},
|
|
21472
21556
|
snapshot: (id) => {
|
|
21473
21557
|
const st = objects.get(id)?.st ?? impls.get(id)?.impl.state();
|
|
21474
21558
|
return st ? clone(st) : null;
|
|
@@ -24174,6 +24258,30 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
24174
24258
|
if (ratio >= rules.freshness.stale) return "stale";
|
|
24175
24259
|
return "fresh";
|
|
24176
24260
|
};
|
|
24261
|
+
var FRESH_NUTRITION = { satietyFactor: 1, poisonChance: 0, morale: 0, isEdible: true };
|
|
24262
|
+
var nutritionOf = (item, context, rules) => {
|
|
24263
|
+
const state = context.freshness ?? "fresh";
|
|
24264
|
+
const effect = state === "fresh" ? FRESH_NUTRITION : rules.use.freshness[state];
|
|
24265
|
+
const poisonShare = context.isCooked ? rules.use.cookedPoisonFactor : 1;
|
|
24266
|
+
return {
|
|
24267
|
+
satiety: (item.nutrition?.satiety ?? 0) * effect.satietyFactor,
|
|
24268
|
+
hydration: item.nutrition?.hydration ?? 0,
|
|
24269
|
+
morale: effect.morale,
|
|
24270
|
+
poisonChance: effect.poisonChance * poisonShare,
|
|
24271
|
+
isEdible: effect.isEdible
|
|
24272
|
+
};
|
|
24273
|
+
};
|
|
24274
|
+
var findEffect = (item, effects) => effects.find((entry2) => entry2.items?.includes(item.id)) ?? effects.find((entry2) => entry2.category?.includes(item.category));
|
|
24275
|
+
var resolveUse = (item, effects, context = {}, rules = DEFAULT_RULES) => {
|
|
24276
|
+
const def = findEffect(item, effects);
|
|
24277
|
+
if (!def) return void 0;
|
|
24278
|
+
const base = { useId: def.id, effect: def.effect, params: def.params ?? {}, consumes: def.consumes };
|
|
24279
|
+
if (def.effect !== "consume_nutrition") return base;
|
|
24280
|
+
const nutrition = nutritionOf(item, context, rules);
|
|
24281
|
+
const blocked = item.seal && context.seal ? sealBlock(item.seal, context.seal) : void 0;
|
|
24282
|
+
if (blocked) return { ...base, consumes: false, nutrition: { ...nutrition, isEdible: false }, blocked };
|
|
24283
|
+
return { ...base, consumes: def.consumes && nutrition.isEdible, nutrition };
|
|
24284
|
+
};
|
|
24177
24285
|
var countOf = (context, id) => context.inventory.get(id) ?? 0;
|
|
24178
24286
|
var candidatesOf = (input, context) => {
|
|
24179
24287
|
if (input.item !== void 0) return [input.item];
|
|
@@ -37994,6 +38102,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
37994
38102
|
impact: {
|
|
37995
38103
|
response: "dent",
|
|
37996
38104
|
pushImpulse: true
|
|
38105
|
+
},
|
|
38106
|
+
use: {
|
|
38107
|
+
clip: "use_hygiene",
|
|
38108
|
+
sounds: [
|
|
38109
|
+
"scrub"
|
|
38110
|
+
]
|
|
37997
38111
|
}
|
|
37998
38112
|
}
|
|
37999
38113
|
}
|
|
@@ -41581,6 +41695,22 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
41581
41695
|
items: [
|
|
41582
41696
|
"alcohol_70",
|
|
41583
41697
|
"povidone_iodine"
|
|
41698
|
+
],
|
|
41699
|
+
params: {
|
|
41700
|
+
clip: "apply_dressing"
|
|
41701
|
+
}
|
|
41702
|
+
},
|
|
41703
|
+
{
|
|
41704
|
+
id: "wash",
|
|
41705
|
+
effect: "wash",
|
|
41706
|
+
consumes: false,
|
|
41707
|
+
items: [
|
|
41708
|
+
"soap",
|
|
41709
|
+
"shampoo",
|
|
41710
|
+
"toothpaste",
|
|
41711
|
+
"toothbrush",
|
|
41712
|
+
"deodorant",
|
|
41713
|
+
"towel"
|
|
41584
41714
|
]
|
|
41585
41715
|
},
|
|
41586
41716
|
{
|
|
@@ -41602,7 +41732,44 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
41602
41732
|
consumes: false,
|
|
41603
41733
|
items: [
|
|
41604
41734
|
"flashlight"
|
|
41605
|
-
]
|
|
41735
|
+
],
|
|
41736
|
+
params: {
|
|
41737
|
+
clip: "toggle_flashlight"
|
|
41738
|
+
}
|
|
41739
|
+
},
|
|
41740
|
+
{
|
|
41741
|
+
id: "ignite",
|
|
41742
|
+
effect: "ignite",
|
|
41743
|
+
consumes: false,
|
|
41744
|
+
items: [
|
|
41745
|
+
"lighter"
|
|
41746
|
+
],
|
|
41747
|
+
params: {
|
|
41748
|
+
clip: "light_lighter"
|
|
41749
|
+
}
|
|
41750
|
+
},
|
|
41751
|
+
{
|
|
41752
|
+
id: "radio_call",
|
|
41753
|
+
effect: "radio_call",
|
|
41754
|
+
consumes: false,
|
|
41755
|
+
items: [
|
|
41756
|
+
"portable_radio",
|
|
41757
|
+
"walkie_talkies"
|
|
41758
|
+
],
|
|
41759
|
+
params: {
|
|
41760
|
+
clip: "use_radio"
|
|
41761
|
+
}
|
|
41762
|
+
},
|
|
41763
|
+
{
|
|
41764
|
+
id: "turn_key",
|
|
41765
|
+
effect: "turn_key",
|
|
41766
|
+
consumes: false,
|
|
41767
|
+
category: [
|
|
41768
|
+
"keys"
|
|
41769
|
+
],
|
|
41770
|
+
params: {
|
|
41771
|
+
clip: "turn_key"
|
|
41772
|
+
}
|
|
41606
41773
|
},
|
|
41607
41774
|
{
|
|
41608
41775
|
id: "swap_bag",
|
|
@@ -42903,6 +43070,29 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
42903
43070
|
"kind.hygiene.description": "Sabonete, pasta de dente, papel higi\xEAnico e toalha."
|
|
42904
43071
|
};
|
|
42905
43072
|
var GOODS_STRINGS = { en: en_default2, "pt-BR": pt_BR_default2 };
|
|
43073
|
+
var drinkHydrationOf = (item, liquids = LIQUIDS) => {
|
|
43074
|
+
const fluid = item.fluid;
|
|
43075
|
+
const drink = fluid ? liquids.find((liquid) => liquid.id === fluid.liquid)?.drink : void 0;
|
|
43076
|
+
if (!fluid || !drink) return void 0;
|
|
43077
|
+
const doses = item.durability?.kind === "doses" ? Math.max(1, item.durability.amount ?? 1) : 1;
|
|
43078
|
+
return drink.thirst * fluid.liters / doses;
|
|
43079
|
+
};
|
|
43080
|
+
var createGoodsItemUse = (options = {}) => {
|
|
43081
|
+
const kinds = options.kinds ?? createGoodsKinds();
|
|
43082
|
+
const effects = options.effects ?? GOODS_USE_EFFECTS;
|
|
43083
|
+
const liquids = options.liquids ?? LIQUIDS;
|
|
43084
|
+
return (item) => {
|
|
43085
|
+
if (item.kind === void 0 || !kinds.has(item.kind)) return void 0;
|
|
43086
|
+
const result = resolveUse(item, effects);
|
|
43087
|
+
const { clip: effectClip, ...params } = result?.params ?? {};
|
|
43088
|
+
const clip = typeof effectClip === "string" ? effectClip : resolveEntry(kinds, item).use?.clip;
|
|
43089
|
+
if (clip === void 0) return void 0;
|
|
43090
|
+
if (!result) return { clip, consumes: false };
|
|
43091
|
+
const nutrition = result.nutrition ? { satiety: result.nutrition.satiety, hydration: drinkHydrationOf(item, liquids) ?? result.nutrition.hydration } : {};
|
|
43092
|
+
return { clip, consumes: result.consumes, effect: { id: result.effect, ...Object.keys(params).length > 0 ? { params } : {}, ...nutrition } };
|
|
43093
|
+
};
|
|
43094
|
+
};
|
|
43095
|
+
var goodsItemUse = createGoodsItemUse();
|
|
42906
43096
|
|
|
42907
43097
|
// ../game-interactables-household/dist/index.js
|
|
42908
43098
|
var door = (material, joint = "hinge", piece2 = "door") => ({ material, joint, piece: piece2 });
|
|
@@ -42914,6 +43104,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
42914
43104
|
var fridgeLike = { body: { material: "steel", joint: "weld" }, parts: [[/^door/, door("steel")]] };
|
|
42915
43105
|
var bin = { body: { material: "plastic", joint: "fused" }, parts: [["lid", door("plastic", "hinge", "lid")]] };
|
|
42916
43106
|
var upholstery = { material: "fabric", joint: "glue" };
|
|
43107
|
+
var POLE_CAGE = { material: "steel", spacing: 0.1, diameter: 0.01 };
|
|
42917
43108
|
var DESTRUCTION = {
|
|
42918
43109
|
fridge: fridgeLike,
|
|
42919
43110
|
fridge_compact: fridgeLike,
|
|
@@ -42939,7 +43130,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
42939
43130
|
},
|
|
42940
43131
|
wall_socket: { body: { material: "plastic", joint: "screw" }, parts: [] },
|
|
42941
43132
|
wall_switch: { body: { material: "plastic", joint: "screw" }, parts: [["rocker", { material: "plastic", joint: "clip", piece: "rocker" }]] },
|
|
42942
|
-
|
|
43133
|
+
// a cast concrete pole (NBR 8451: CA-50 bars in the concrete), its segments held by the bars; the meter box, the cross arm and the bracket are bolted to it
|
|
43134
|
+
service_entrance: { body: { material: "concrete", joint: "rebar", reinforcement: POLE_CAGE }, parts: [["meter_door", door("steel")]] },
|
|
42943
43135
|
conduit_run: { body: { material: "plastic", joint: "clip" }, parts: [] },
|
|
42944
43136
|
service_mast: { body: { material: "steel", joint: "clip" }, parts: [] },
|
|
42945
43137
|
electrical_panel: {
|
|
@@ -43603,7 +43795,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43603
43795
|
h: 0.7,
|
|
43604
43796
|
y: 1.4,
|
|
43605
43797
|
solid: true,
|
|
43606
|
-
massKg: 15
|
|
43798
|
+
massKg: 15,
|
|
43799
|
+
fixed: true
|
|
43607
43800
|
},
|
|
43608
43801
|
{
|
|
43609
43802
|
id: "pantry",
|
|
@@ -43688,7 +43881,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43688
43881
|
h: 1.2,
|
|
43689
43882
|
y: 0,
|
|
43690
43883
|
solid: true,
|
|
43691
|
-
massKg: 40
|
|
43884
|
+
massKg: 40,
|
|
43885
|
+
fixed: true
|
|
43692
43886
|
},
|
|
43693
43887
|
{
|
|
43694
43888
|
id: "sink_bathroom",
|
|
@@ -43698,7 +43892,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43698
43892
|
h: 1.05,
|
|
43699
43893
|
y: 0,
|
|
43700
43894
|
solid: true,
|
|
43701
|
-
massKg: 25
|
|
43895
|
+
massKg: 25,
|
|
43896
|
+
fixed: true
|
|
43702
43897
|
},
|
|
43703
43898
|
{
|
|
43704
43899
|
id: "shower",
|
|
@@ -43708,7 +43903,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43708
43903
|
h: 2.1,
|
|
43709
43904
|
y: 0,
|
|
43710
43905
|
solid: true,
|
|
43711
|
-
massKg: 90
|
|
43906
|
+
massKg: 90,
|
|
43907
|
+
fixed: true
|
|
43712
43908
|
},
|
|
43713
43909
|
{
|
|
43714
43910
|
id: "toilet",
|
|
@@ -43718,7 +43914,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43718
43914
|
h: 0.8,
|
|
43719
43915
|
y: 0,
|
|
43720
43916
|
solid: true,
|
|
43721
|
-
massKg: 30
|
|
43917
|
+
massKg: 30,
|
|
43918
|
+
fixed: true
|
|
43722
43919
|
},
|
|
43723
43920
|
{
|
|
43724
43921
|
id: "utility_sink",
|
|
@@ -43728,7 +43925,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43728
43925
|
h: 1.2,
|
|
43729
43926
|
y: 0,
|
|
43730
43927
|
solid: true,
|
|
43731
|
-
massKg: 25
|
|
43928
|
+
massKg: 25,
|
|
43929
|
+
fixed: true
|
|
43732
43930
|
},
|
|
43733
43931
|
{
|
|
43734
43932
|
id: "wall_socket",
|
|
@@ -43758,7 +43956,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43758
43956
|
h: 6.5,
|
|
43759
43957
|
y: 0,
|
|
43760
43958
|
solid: true,
|
|
43761
|
-
massKg:
|
|
43959
|
+
massKg: 320,
|
|
43960
|
+
fixed: true
|
|
43762
43961
|
},
|
|
43763
43962
|
{
|
|
43764
43963
|
id: "service_mast",
|
|
@@ -46710,7 +46909,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
46710
46909
|
}
|
|
46711
46910
|
var residentialTower = residentialTowerTemplate();
|
|
46712
46911
|
|
|
46713
|
-
// ../game-floorplan-three/dist/chunk-
|
|
46912
|
+
// ../game-floorplan-three/dist/chunk-Z3IBCX7E.js
|
|
46714
46913
|
var __defProp3 = Object.defineProperty;
|
|
46715
46914
|
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp3(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
46716
46915
|
var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
@@ -54380,7 +54579,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
54380
54579
|
w = Math.min(w, 0.5);
|
|
54381
54580
|
d = Math.min(d, 0.5);
|
|
54382
54581
|
}
|
|
54383
|
-
inter().objs.push({ f: M.floor, cx: m.x, cz: m.z, c: Math.cos(M.ry), s: Math.sin(M.ry), hw: w / 2, hd: d / 2, type: m.type });
|
|
54582
|
+
inter().objs.push({ f: M.floor, cx: m.x, cz: m.z, c: Math.cos(M.ry), s: Math.sin(M.ry), hw: w / 2, hd: d / 2, h, type: m.type });
|
|
54384
54583
|
}
|
|
54385
54584
|
function objectDistance(o, x, z) {
|
|
54386
54585
|
const dx = x - o.cx, dz = z - o.cz, lx = dx * o.c - dz * o.s, lz = dx * o.s + dz * o.c, ex = Math.abs(lx) - o.hw, ez = Math.abs(lz) - o.hd;
|
|
@@ -57172,11 +57371,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
57172
57371
|
drop(partId) {
|
|
57173
57372
|
const hosts = [...new Set([views.get(partId), ...[...views.values()].filter((view) => view.parts.includes(partId))].filter((v) => !!v))];
|
|
57174
57373
|
if (!hosts.length && lod === 0 && riders(partId).length > 0) {
|
|
57175
|
-
const
|
|
57176
|
-
if (
|
|
57177
|
-
cut(
|
|
57178
|
-
views.set(partId,
|
|
57179
|
-
hosts.push(
|
|
57374
|
+
const made2 = newView(partId);
|
|
57375
|
+
if (made2) {
|
|
57376
|
+
cut(made2);
|
|
57377
|
+
views.set(partId, made2);
|
|
57378
|
+
hosts.push(made2);
|
|
57180
57379
|
}
|
|
57181
57380
|
}
|
|
57182
57381
|
for (const host of hosts) {
|
|
@@ -58338,11 +58537,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
58338
58537
|
let batcher = null;
|
|
58339
58538
|
let changedAt = Number.NEGATIVE_INFINITY;
|
|
58340
58539
|
const make3 = () => {
|
|
58341
|
-
const
|
|
58342
|
-
|
|
58343
|
-
|
|
58344
|
-
markKitOrigin(
|
|
58345
|
-
return
|
|
58540
|
+
const made2 = createStaticBatcher(THREE, root, { shadowOnly: true, queue, budgetMs: HOUSE_SHADOW_BUDGET_MS, maxVertices: HOUSE_SHADOW_BATCH_VERTICES, include: (mesh2) => mesh2.userData.noShadowBatch !== true });
|
|
58541
|
+
made2.group.name = "house-shadow-batches";
|
|
58542
|
+
made2.group.userData.noSurfaceRay = true;
|
|
58543
|
+
markKitOrigin(made2.group, { owner: "game-floorplan-three", kind: "structure", id: root.name || "house" });
|
|
58544
|
+
return made2;
|
|
58346
58545
|
};
|
|
58347
58546
|
return {
|
|
58348
58547
|
update() {
|
|
@@ -58606,7 +58805,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
58606
58805
|
c.aabb = [c.x0, c.z0, c.x1, c.z1];
|
|
58607
58806
|
if (c.type === "wall") c.damageable = tagDamage("masonry");
|
|
58608
58807
|
}
|
|
58609
|
-
const colliders = shared2.ctx.colliders.concat(shared2.inter.objs.map((o) => ({ type: "furniture", f: o.f, obb: { cx: o.cx, cz: o.cz, hw: o.hw, hd: o.hd, c: o.c, s: o.s }, item: o.type, off: false })));
|
|
58808
|
+
const colliders = shared2.ctx.colliders.concat(shared2.inter.objs.map((o) => ({ type: "furniture", f: o.f, obb: { cx: o.cx, cz: o.cz, hw: o.hw, hd: o.hd, c: o.c, s: o.s }, item: o.type, off: false, ...o.h !== void 0 ? { h: o.h } : {} })));
|
|
58610
58809
|
const parts2 = {}, setOpen = (def, t) => {
|
|
58611
58810
|
def.target = t;
|
|
58612
58811
|
def.t = t;
|
|
@@ -59159,8 +59358,51 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59159
59358
|
installBuildBuild(K, shared2);
|
|
59160
59359
|
return buildApi(K, shared2);
|
|
59161
59360
|
}
|
|
59361
|
+
var STRUCTURE_SKIN = {
|
|
59362
|
+
wood_hard: 0.018,
|
|
59363
|
+
wood_soft: 0.018,
|
|
59364
|
+
plywood: 0.015,
|
|
59365
|
+
mdf: 0.018,
|
|
59366
|
+
plastic: 4e-3,
|
|
59367
|
+
rubber: 5e-3,
|
|
59368
|
+
steel: 12e-4,
|
|
59369
|
+
aluminium: 2e-3,
|
|
59370
|
+
cast_iron: 6e-3,
|
|
59371
|
+
copper: 1e-3,
|
|
59372
|
+
glass: 5e-3,
|
|
59373
|
+
tempered_glass: 6e-3,
|
|
59374
|
+
ceramic: 8e-3
|
|
59375
|
+
};
|
|
59376
|
+
var FOAM_DENSITY = 30;
|
|
59377
|
+
var FABRIC_DENSITY = 400;
|
|
59378
|
+
var UPHOLSTERY_COVER = 3e-3;
|
|
59379
|
+
var shellFraction = (shape, skin) => {
|
|
59380
|
+
if (shape.kind === "box") {
|
|
59381
|
+
const [a, b, c] = shape.size;
|
|
59382
|
+
const inner = Math.max(0, a - 2 * skin) * Math.max(0, b - 2 * skin) * Math.max(0, c - 2 * skin);
|
|
59383
|
+
return 1 - inner / (a * b * c);
|
|
59384
|
+
}
|
|
59385
|
+
if (shape.kind === "cylinder") {
|
|
59386
|
+
const { radius: r, height: h } = shape;
|
|
59387
|
+
const inner = Math.max(0, r - skin) ** 2 * Math.max(0, h - 2 * skin);
|
|
59388
|
+
return 1 - inner / (r * r * h);
|
|
59389
|
+
}
|
|
59390
|
+
return 1 - (Math.max(0, shape.radius - skin) / shape.radius) ** 3;
|
|
59391
|
+
};
|
|
59392
|
+
var thinnest = (shape) => shape.kind === "box" ? Math.min(...shape.size) : shape.kind === "cylinder" ? Math.min(shape.radius * 2, shape.height) : shape.radius * 2;
|
|
59393
|
+
function structureFill(material, shape) {
|
|
59394
|
+
if (material === "fabric") {
|
|
59395
|
+
if (thinnest(shape) <= 4 * UPHOLSTERY_COVER) return 1;
|
|
59396
|
+
const cover = shellFraction(shape, UPHOLSTERY_COVER);
|
|
59397
|
+
return cover + (1 - cover) * (FOAM_DENSITY / FABRIC_DENSITY);
|
|
59398
|
+
}
|
|
59399
|
+
const skin = STRUCTURE_SKIN[material];
|
|
59400
|
+
if (skin === void 0 || thinnest(shape) <= 3 * skin) return 1;
|
|
59401
|
+
return shellFraction(shape, skin);
|
|
59402
|
+
}
|
|
59162
59403
|
var HOLD_REACH2 = 0.05;
|
|
59163
59404
|
var BACK_TOUCH = 0.02;
|
|
59405
|
+
var AGAINST_WALL = 0.1;
|
|
59164
59406
|
var SOFT = /* @__PURE__ */ new Set(["fabric", "paper", "foliage"]);
|
|
59165
59407
|
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])));
|
|
59166
59408
|
function groupsOf(parts2, joints) {
|
|
@@ -59204,10 +59446,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59204
59446
|
const groups = groupsOf(parts2, joints).map((ids) => ids.map((id) => byId.get(id))).sort((a, b) => b.length - a.length);
|
|
59205
59447
|
const [main, ...rest2] = groups;
|
|
59206
59448
|
if (!main) return;
|
|
59449
|
+
const mainHeld = main.some((part) => part.anchored);
|
|
59207
59450
|
for (const group of rest2) {
|
|
59208
59451
|
if (standsAlone(group, boxOf3)) continue;
|
|
59209
59452
|
const joint = nearestJoint(group, main, boxOf3, Infinity);
|
|
59210
|
-
if (joint) joints.push(joint);
|
|
59453
|
+
if (joint) joints.push(mainHeld && group.some((part) => part.anchored) ? { ...joint, tears: true } : joint);
|
|
59211
59454
|
}
|
|
59212
59455
|
}
|
|
59213
59456
|
function holdLooseGroups(params) {
|
|
@@ -59230,7 +59473,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59230
59473
|
changed = true;
|
|
59231
59474
|
continue;
|
|
59232
59475
|
}
|
|
59233
|
-
const
|
|
59476
|
+
const againstWall = held.length === 0 || held.some((part) => boxOf3(part.id).min[2] <= back + AGAINST_WALL);
|
|
59477
|
+
const onWall = againstWall ? group.filter((part) => !SOFT.has(part.material) && boxOf3(part.id).min[2] <= back + BACK_TOUCH) : [];
|
|
59234
59478
|
if (onWall.length === 0) continue;
|
|
59235
59479
|
for (const part of onWall) part.anchored = true;
|
|
59236
59480
|
changed = true;
|
|
@@ -59270,7 +59514,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59270
59514
|
if (carcassed) return tops;
|
|
59271
59515
|
for (let i = drawn.length - 1; i >= 0; i--) {
|
|
59272
59516
|
const p = drawn[i];
|
|
59273
|
-
if (p.key !== "wood" || materialOf.wood !== "wood_hard" || p.shape.kind !== "box" || p.rotation) continue;
|
|
59517
|
+
if (p.material || p.key !== "wood" || materialOf.wood !== "wood_hard" || p.shape.kind !== "box" || p.rotation) continue;
|
|
59274
59518
|
const [sx, sy, sz] = p.shape.size;
|
|
59275
59519
|
const across2 = sx < sz ? 0 : 2;
|
|
59276
59520
|
const width = Math.min(sx, sz);
|
|
@@ -59293,14 +59537,106 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59293
59537
|
}
|
|
59294
59538
|
return tops;
|
|
59295
59539
|
}
|
|
59296
|
-
|
|
59297
|
-
|
|
59540
|
+
var CASES = /^(tv_unit|tv_unit_small|tv_unit_large|sideboard|china_cabinet|pantry|laundry_cabinet|wardrobe|wardrobe_small|wardrobe_large|closet_wardrobe|kitchen_cabinet|kitchen_cabinet_large|kitchen_cabinet_small|display_stand|dresser|nightstand|console_table|vanity_table)$/;
|
|
59541
|
+
var DRAWER_CASES = /^(dresser|nightstand|console_table|vanity_table)$/;
|
|
59542
|
+
var CASE_BODY_MIN = 0.2;
|
|
59543
|
+
var FRONT_THICK = 0.03;
|
|
59544
|
+
var FRONT_REACH = 0.03;
|
|
59545
|
+
var CASE_BOARD = 0.018;
|
|
59546
|
+
var CASE_BACK = 6e-3;
|
|
59547
|
+
var DRAWER_SIDE = 0.012;
|
|
59548
|
+
var DRAWER_BOTTOM = 6e-3;
|
|
59549
|
+
var SHELF_PITCH = 0.45;
|
|
59550
|
+
var WARDROBES = /wardrobe/;
|
|
59551
|
+
var HANGING_SHELF_DROP = 0.35;
|
|
59552
|
+
function board(body, suffix, material, min, max, color2 = body.color) {
|
|
59553
|
+
const size = [max[0] - min[0], max[1] - min[1], max[2] - min[2]];
|
|
59554
|
+
const position = [(min[0] + max[0]) / 2, (min[1] + max[1]) / 2, (min[2] + max[2]) / 2];
|
|
59555
|
+
return { id: `${body.id}_${suffix}`, key: body.key, material, shape: { kind: "box", size }, position, rotation: null, color: color2, min, max };
|
|
59556
|
+
}
|
|
59557
|
+
function hollowCases(drawn, type) {
|
|
59558
|
+
const made2 = /* @__PURE__ */ new Set();
|
|
59559
|
+
if (!CASES.test(type)) return made2;
|
|
59560
|
+
const drawers = DRAWER_CASES.test(type);
|
|
59561
|
+
for (let i = drawn.length - 1; i >= 0; i--) {
|
|
59562
|
+
const body = drawn[i];
|
|
59563
|
+
if (body.key !== "wood" && body.key !== "plain" || body.shape.kind !== "box" || body.rotation) continue;
|
|
59564
|
+
const [sx, sy, sz] = body.shape.size;
|
|
59565
|
+
if (Math.min(sx, sy, sz) < CASE_BODY_MIN) continue;
|
|
59566
|
+
const fronts = drawn.filter((p) => {
|
|
59567
|
+
if (p === body || p.shape.kind !== "box" || p.rotation || p.key !== "wood" && p.key !== "plain") return false;
|
|
59568
|
+
const thick = p.max[2] - p.min[2];
|
|
59569
|
+
if (thick > FRONT_THICK || thick >= p.max[0] - p.min[0] || thick >= p.max[1] - p.min[1]) return false;
|
|
59570
|
+
const cx = (p.min[0] + p.max[0]) / 2;
|
|
59571
|
+
const cy = (p.min[1] + p.max[1]) / 2;
|
|
59572
|
+
return Math.abs(p.min[2] - body.max[2]) <= FRONT_REACH && cx > body.min[0] && cx < body.max[0] && cy > body.min[1] && cy < body.max[1];
|
|
59573
|
+
});
|
|
59574
|
+
if (fronts.length === 0) continue;
|
|
59575
|
+
const [x0, y0, z0] = body.min;
|
|
59576
|
+
const [x1, y1, z1] = body.max;
|
|
59577
|
+
const T2 = CASE_BOARD;
|
|
59578
|
+
const zi = z0 + CASE_BACK;
|
|
59579
|
+
const inner = 0.92;
|
|
59580
|
+
const tone = (k) => {
|
|
59581
|
+
const c = (s) => Math.min(255, Math.round((body.color >> s & 255) * k)) << s;
|
|
59582
|
+
return c(16) | c(8) | c(0);
|
|
59583
|
+
};
|
|
59584
|
+
const boards = [
|
|
59585
|
+
board(body, "back", "plywood", [x0, y0, z0], [x1, y1, zi], tone(0.8)),
|
|
59586
|
+
board(body, "side_l", "mdf", [x0, y0, zi], [x0 + T2, y1, z1]),
|
|
59587
|
+
board(body, "side_r", "mdf", [x1 - T2, y0, zi], [x1, y1, z1]),
|
|
59588
|
+
board(body, "top", "mdf", [x0 + T2, y1 - T2, zi], [x1 - T2, y1, z1]),
|
|
59589
|
+
board(body, "bottom", "mdf", [x0 + T2, y0, zi], [x1 - T2, y0 + T2, z1], tone(inner))
|
|
59590
|
+
];
|
|
59591
|
+
const ix0 = x0 + T2;
|
|
59592
|
+
const ix1 = x1 - T2;
|
|
59593
|
+
const iy0 = y0 + T2;
|
|
59594
|
+
const iy1 = y1 - T2;
|
|
59595
|
+
if (drawers) {
|
|
59596
|
+
const stack = [...fronts].sort((a, b) => a.min[1] - b.min[1]);
|
|
59597
|
+
stack.forEach((front, k) => {
|
|
59598
|
+
const dy0 = Math.max(front.min[1] + 0.01, iy0 + 2e-3);
|
|
59599
|
+
const dy1 = Math.min(front.max[1] - 0.02, iy1 - 2e-3);
|
|
59600
|
+
const dz0 = zi + 0.01;
|
|
59601
|
+
const dz1 = front.min[2];
|
|
59602
|
+
if (dy1 - dy0 < 0.04 || dz1 - dz0 < 0.1) return;
|
|
59603
|
+
const a = ix0 + 2e-3;
|
|
59604
|
+
const b = ix1 - 2e-3;
|
|
59605
|
+
boards.push(
|
|
59606
|
+
board(body, `drawer${k}_side_l`, "mdf", [a, dy0, dz0], [a + DRAWER_SIDE, dy1, dz1], tone(inner)),
|
|
59607
|
+
board(body, `drawer${k}_side_r`, "mdf", [b - DRAWER_SIDE, dy0, dz0], [b, dy1, dz1], tone(inner)),
|
|
59608
|
+
board(body, `drawer${k}_back`, "mdf", [a + DRAWER_SIDE, dy0, dz0], [b - DRAWER_SIDE, dy1, dz0 + DRAWER_SIDE], tone(inner)),
|
|
59609
|
+
board(body, `drawer${k}_bottom`, "mdf", [a + DRAWER_SIDE, dy0, dz0 + DRAWER_SIDE], [b - DRAWER_SIDE, dy0 + DRAWER_BOTTOM, dz1], tone(inner))
|
|
59610
|
+
);
|
|
59611
|
+
const above = stack[k + 1];
|
|
59612
|
+
if (!above) return;
|
|
59613
|
+
const mid = (front.max[1] + above.min[1]) / 2;
|
|
59614
|
+
if (above.min[1] - front.max[1] < T2 || mid - T2 / 2 < dy1 || mid + T2 / 2 > iy1) return;
|
|
59615
|
+
boards.push(board(body, `rail${k}`, "mdf", [ix0, mid - T2 / 2, zi], [ix1, mid + T2 / 2, z1], tone(inner)));
|
|
59616
|
+
});
|
|
59617
|
+
} else {
|
|
59618
|
+
const height = iy1 - iy0;
|
|
59619
|
+
const count = Math.max(0, Math.round(height / SHELF_PITCH) - 1);
|
|
59620
|
+
const levels = WARDROBES.test(type) ? [iy1 - HANGING_SHELF_DROP] : Array.from({ length: count }, (_, k) => iy0 + (k + 1) * height / (count + 1));
|
|
59621
|
+
levels.forEach((y, k) => boards.push(board(body, `shelf${k}`, "mdf", [ix0, y - T2 / 2, zi], [ix1, y + T2 / 2, z1 - 0.02], tone(inner))));
|
|
59622
|
+
}
|
|
59623
|
+
for (const front of fronts) front.material = "mdf";
|
|
59624
|
+
drawn.splice(i, 1, ...boards);
|
|
59625
|
+
for (const b of boards) made2.add(b.id);
|
|
59626
|
+
}
|
|
59627
|
+
return made2;
|
|
59628
|
+
}
|
|
59629
|
+
function shadeBoard(color2, board2) {
|
|
59630
|
+
const k = [1, 0.94, 1.05, 0.97, 1.03][board2 % 5];
|
|
59298
59631
|
const channel = (shift) => Math.min(255, Math.round((color2 >> shift & 255) * k)) << shift;
|
|
59299
59632
|
return channel(16) | channel(8) | channel(0);
|
|
59300
59633
|
}
|
|
59301
59634
|
var FLOOR_TOUCH2 = 5e-3;
|
|
59302
59635
|
var LOOSE = /* @__PURE__ */ new Set(["paper"]);
|
|
59303
|
-
var PLANTED = /* @__PURE__ */ new Set(["mailbox", "correio", "clothesline", "tree_small", "bbq_simple"]);
|
|
59636
|
+
var PLANTED = /* @__PURE__ */ new Set(["mailbox", "correio", "clothesline", "tree_small", "fruit_tree", "bbq_simple"]);
|
|
59637
|
+
var INSTALLED = /* @__PURE__ */ new Set(["toilet", "washbasin", "pedestal_basin", "shower", "shower_large", "laundry_tub"]);
|
|
59638
|
+
var WEIGHTED_FOOT = /* @__PURE__ */ new Set(["floor_lamp"]);
|
|
59639
|
+
var FOOT_MATERIAL = "cast_iron";
|
|
59304
59640
|
var BASE_MATERIAL = {
|
|
59305
59641
|
wood: "wood_hard",
|
|
59306
59642
|
metal: "steel",
|
|
@@ -59376,13 +59712,18 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59376
59712
|
};
|
|
59377
59713
|
run(A);
|
|
59378
59714
|
if (!drawn.length) throw new Error(`game-floorplan-three: the builder of "${name}" drew no box or cylinder`);
|
|
59715
|
+
hollowCases(drawn, name);
|
|
59379
59716
|
const boardsOf = splitTopsIntoBoards(drawn, materialOf, Boolean(opts.carcass));
|
|
59380
59717
|
const parts2 = drawn.map((p) => {
|
|
59381
59718
|
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]);
|
|
59382
|
-
let material = materialOf[p.key] ?? "plastic";
|
|
59383
|
-
if (p.
|
|
59719
|
+
let material = p.material ?? materialOf[p.key] ?? "plastic";
|
|
59720
|
+
if (p.material) {
|
|
59721
|
+
} else if (p.key === "wood" && material === "wood_hard" && opts.carcass && !opts.materials?.wood) material = "mdf";
|
|
59384
59722
|
else if (p.key === "wood" && material === "wood_hard" && thin < WOOD_THIN) material = "wood_soft";
|
|
59723
|
+
if (WEIGHTED_FOOT.has(name) && p.key === "metal" && p.min[1] <= FLOOR_TOUCH2) material = FOOT_MATERIAL;
|
|
59385
59724
|
const part = { id: p.id, material, shape: p.shape, position: p.position };
|
|
59725
|
+
const fill2 = structureFill(material, p.shape);
|
|
59726
|
+
if (fill2 < 1) part.fill = Math.round(fill2 * 1e4) / 1e4;
|
|
59386
59727
|
if (p.rotation) part.rotation = p.rotation;
|
|
59387
59728
|
if (!LOOSE.has(material) && p.min[1] <= FLOOR_TOUCH2) part.anchored = true;
|
|
59388
59729
|
if (opts.carcass && LOOSE.has(material)) {
|
|
@@ -59412,7 +59753,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59412
59753
|
const wallMounted = parts2.some((part) => part.anchored && low(part) > FLOOR_TOUCH2);
|
|
59413
59754
|
const sunk = parts2.some((part) => low(part) < -FLOOR_TOUCH2);
|
|
59414
59755
|
const rooted = parts2.some((part) => part.material === "foliage") && parts2.some((part) => part.material.startsWith("wood") && low(part) <= FLOOR_TOUCH2);
|
|
59415
|
-
const fixed = wallMounted || sunk || rooted || PLANTED.has(name);
|
|
59756
|
+
const fixed = wallMounted || sunk || rooted || PLANTED.has(name) || INSTALLED.has(name);
|
|
59416
59757
|
const all = drawn.reduce(
|
|
59417
59758
|
(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]) }),
|
|
59418
59759
|
{ x0: Infinity, x1: -Infinity, z0: Infinity, z1: -Infinity }
|
|
@@ -59481,7 +59822,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59481
59822
|
const root = { x: seed, z: 0, ry: 0, w, d, h, y: 0, base: 0, palette: o.palette, seed: `furniture_${type}_${seed}` };
|
|
59482
59823
|
const { K, shared: shared2 } = renderer.internals;
|
|
59483
59824
|
const before = K.PARTS.length;
|
|
59484
|
-
const
|
|
59825
|
+
const made2 = recordSpec(
|
|
59485
59826
|
THREE,
|
|
59486
59827
|
type,
|
|
59487
59828
|
root,
|
|
@@ -59500,7 +59841,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59500
59841
|
);
|
|
59501
59842
|
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]);
|
|
59502
59843
|
K.PARTS.length = before;
|
|
59503
|
-
return { spec:
|
|
59844
|
+
return { spec: made2.spec, build: made2.build, top: made2.top, size: { w, d, h }, spouts, fixed: made2.fixed };
|
|
59504
59845
|
}
|
|
59505
59846
|
|
|
59506
59847
|
// src/area-layout.ts
|
|
@@ -59794,12 +60135,19 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59794
60135
|
const spec = model === void 0 || !itemMakeup(model) ? void 0 : makeupSpec(model);
|
|
59795
60136
|
return spec ? { spec: () => structuredClone(spec) } : {};
|
|
59796
60137
|
};
|
|
60138
|
+
const usesOf = (def) => {
|
|
60139
|
+
const use = options.itemUse?.(def);
|
|
60140
|
+
const liquid = sealOf(def, fluidOf({ ...def.model === void 0 ? {} : { model: def.model }, size: def.size, weight: def.weight }));
|
|
60141
|
+
if (!use) return liquid;
|
|
60142
|
+
const edible2 = def.category === "food" || def.category === "drink";
|
|
60143
|
+
return { ...liquid, ...liquid.fluid && !edible2 ? { fluid: { ...liquid.fluid, uses: ["pour", "pour_out"] } } : {}, use };
|
|
60144
|
+
};
|
|
59797
60145
|
const itemOf = (def) => ({
|
|
59798
60146
|
id: `${ITEM_PREFIX}${def.id}`,
|
|
59799
60147
|
name: nameOf(def),
|
|
59800
60148
|
movable: true,
|
|
59801
60149
|
thumbnail: itemThumbnailSvg(drawable(def)),
|
|
59802
|
-
...
|
|
60150
|
+
...usesOf(def),
|
|
59803
60151
|
// an item with a make-up (a shovel: ash handle riveted to a steel blade) is that spec, not the parts guessed from its meshes
|
|
59804
60152
|
...makeupSpecOf(def.model),
|
|
59805
60153
|
// an item that is also a tool of the arsenal (a shovel) is picked up as that tool
|