@adatechnology/game-weapons-three 0.27.6 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GXZM4CE6.js → chunk-IU5JELUL.js} +42 -3
- package/dist/chunk-IU5JELUL.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.global.js +1606 -963
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/testing.js +1 -1
- package/package.json +12 -12
- package/dist/chunk-GXZM4CE6.js.map +0 -1
package/dist/index.global.js
CHANGED
|
@@ -33,6 +33,7 @@ var GameWeaponsThree = (() => {
|
|
|
33
33
|
EXPLOSIVES_AREA_ID: () => EXPLOSIVES_AREA_ID,
|
|
34
34
|
EXPLOSIVES_TEXT: () => EXPLOSIVES_TEXT,
|
|
35
35
|
EXPLOSIVE_MODEL_IDS: () => EXPLOSIVE_MODEL_IDS,
|
|
36
|
+
FAMILY_MOTIONS: () => FAMILY_MOTIONS,
|
|
36
37
|
GAME_DISTANCE_CURVE: () => GAME_DISTANCE_CURVE,
|
|
37
38
|
GAME_SOUND_CLASSES: () => GAME_SOUND_CLASSES,
|
|
38
39
|
GROUND_SLOT: () => GROUND_SLOT,
|
|
@@ -357,6 +358,12 @@ var GameWeaponsThree = (() => {
|
|
|
357
358
|
const flame = flameBase * (1 - rules.flameFillInfluence * (1 - k));
|
|
358
359
|
return 1 - (1 - Math.min(1, Math.max(0, spark))) * (1 - Math.min(1, Math.max(0, flame)));
|
|
359
360
|
};
|
|
361
|
+
var sealBlock = (seal, state) => {
|
|
362
|
+
if (seal.spoilsWhenBreached && state.breached) return "breached";
|
|
363
|
+
if (seal.spoilsWhenBreached && state.leaked) return "leaked";
|
|
364
|
+
if (!state.opened) return "sealed";
|
|
365
|
+
return void 0;
|
|
366
|
+
};
|
|
360
367
|
var FIRST_PERSON_LAYER = 9;
|
|
361
368
|
var TOOL_CLIP = {
|
|
362
369
|
DRAW: "draw",
|
|
@@ -439,6 +446,52 @@ var GameWeaponsThree = (() => {
|
|
|
439
446
|
(from[1] ?? 0) + ((to[1] ?? 0) - (from[1] ?? 0)) * fraction,
|
|
440
447
|
(from[2] ?? 0) + ((to[2] ?? 0) - (from[2] ?? 0)) * fraction
|
|
441
448
|
];
|
|
449
|
+
var quatFromEuler = (e) => {
|
|
450
|
+
const c1 = Math.cos((e[0] ?? 0) / 2), c2 = Math.cos((e[1] ?? 0) / 2), c3 = Math.cos((e[2] ?? 0) / 2);
|
|
451
|
+
const s1 = Math.sin((e[0] ?? 0) / 2), s2 = Math.sin((e[1] ?? 0) / 2), s3 = Math.sin((e[2] ?? 0) / 2);
|
|
452
|
+
return [s1 * c2 * c3 + c1 * s2 * s3, c1 * s2 * c3 - s1 * c2 * s3, c1 * c2 * s3 + s1 * s2 * c3, c1 * c2 * c3 - s1 * s2 * s3];
|
|
453
|
+
};
|
|
454
|
+
var eulerFromQuat = (q) => {
|
|
455
|
+
const [x = 0, y = 0, z = 0, w = 1] = q;
|
|
456
|
+
const m13 = 2 * (x * z + w * y);
|
|
457
|
+
const ey = Math.asin(Math.max(-1, Math.min(1, m13)));
|
|
458
|
+
if (Math.abs(m13) < 0.9999999) return [Math.atan2(-2 * (y * z - w * x), 1 - 2 * (x * x + y * y)), ey, Math.atan2(-2 * (x * y - w * z), 1 - 2 * (y * y + z * z))];
|
|
459
|
+
return [Math.atan2(2 * (y * z + w * x), 1 - 2 * (x * x + z * z)), ey, 0];
|
|
460
|
+
};
|
|
461
|
+
var slerpQuat = (a, b, f) => {
|
|
462
|
+
const [ax = 0, ay = 0, az = 0, aw = 1] = a;
|
|
463
|
+
let [bx = 0, by = 0, bz = 0, bw = 1] = b;
|
|
464
|
+
let cos2 = ax * bx + ay * by + az * bz + aw * bw;
|
|
465
|
+
if (cos2 < 0) {
|
|
466
|
+
cos2 = -cos2;
|
|
467
|
+
bx = -bx;
|
|
468
|
+
by = -by;
|
|
469
|
+
bz = -bz;
|
|
470
|
+
bw = -bw;
|
|
471
|
+
}
|
|
472
|
+
let ka = 1 - f;
|
|
473
|
+
let kb = f;
|
|
474
|
+
if (cos2 < 0.9999) {
|
|
475
|
+
const angle = Math.acos(cos2);
|
|
476
|
+
const sin2 = Math.sin(angle);
|
|
477
|
+
ka = Math.sin((1 - f) * angle) / sin2;
|
|
478
|
+
kb = Math.sin(f * angle) / sin2;
|
|
479
|
+
}
|
|
480
|
+
const out = [ax * ka + bx * kb, ay * ka + by * kb, az * ka + bz * kb, aw * ka + bw * kb];
|
|
481
|
+
const size = Math.hypot(out[0], out[1], out[2], out[3]) || 1;
|
|
482
|
+
return [out[0] / size, out[1] / size, out[2] / size, out[3] / size];
|
|
483
|
+
};
|
|
484
|
+
var mixTurn = (from, to, fraction) => {
|
|
485
|
+
let changed = 0;
|
|
486
|
+
for (let i = 0; i < 3; i++) if (Math.abs((to[i] ?? 0) - (from[i] ?? 0)) > 1e-9) changed++;
|
|
487
|
+
if (changed <= 1) {
|
|
488
|
+
const euler = mix(from, to, fraction);
|
|
489
|
+
return { euler, quat: quatFromEuler(euler) };
|
|
490
|
+
}
|
|
491
|
+
const quat2 = slerpQuat(quatFromEuler(from), quatFromEuler(to), fraction);
|
|
492
|
+
return { euler: eulerFromQuat(quat2), quat: quat2 };
|
|
493
|
+
};
|
|
494
|
+
var IDENTITY = [0, 0, 0, 1];
|
|
442
495
|
var sampleClip = (clip, partId, time) => {
|
|
443
496
|
const points = clip.keys.map((key2) => {
|
|
444
497
|
const pose2 = partId === void 0 ? key2 : key2.parts?.[partId];
|
|
@@ -447,14 +500,15 @@ var GameWeaponsThree = (() => {
|
|
|
447
500
|
const first = points[0];
|
|
448
501
|
if (!first || first.t > 0) points.unshift({ t: 0, position: ZERO, rotation: ZERO });
|
|
449
502
|
const last = points[points.length - 1];
|
|
450
|
-
if (!last) return { position:
|
|
451
|
-
if (time >= last.t) return { position: mix(last.position, last.position, 0), rotation: mix(last.rotation, last.rotation, 0) };
|
|
503
|
+
if (!last) return { position: [0, 0, 0], rotation: [0, 0, 0], quaternion: [...IDENTITY] };
|
|
504
|
+
if (time >= last.t) return { position: mix(last.position, last.position, 0), rotation: mix(last.rotation, last.rotation, 0), quaternion: quatFromEuler(last.rotation) };
|
|
452
505
|
const index = Math.max(0, points.findIndex((point, i) => time >= point.t && time < (points[i + 1]?.t ?? Infinity)));
|
|
453
506
|
const from = points[index];
|
|
454
507
|
const to = points[index + 1];
|
|
455
|
-
if (!from || !to) return { position:
|
|
508
|
+
if (!from || !to) return { position: [0, 0, 0], rotation: [0, 0, 0], quaternion: [...IDENTITY] };
|
|
456
509
|
const fraction = to.t > from.t ? (time - from.t) / (to.t - from.t) : 0;
|
|
457
|
-
|
|
510
|
+
const turn2 = mixTurn(from.rotation, to.rotation, fraction);
|
|
511
|
+
return { position: mix(from.position, to.position, fraction), rotation: turn2.euler, quaternion: turn2.quat };
|
|
458
512
|
};
|
|
459
513
|
var leadClipEvents = (clip) => {
|
|
460
514
|
const events = clip.events ?? [];
|
|
@@ -689,6 +743,7 @@ var GameWeaponsThree = (() => {
|
|
|
689
743
|
};
|
|
690
744
|
return registry;
|
|
691
745
|
};
|
|
746
|
+
var resolveEntry = (registry, entry2, kindField = "kind") => deepMerge(registry.defaults(String(entry2[kindField])), entry2);
|
|
692
747
|
var KIT_ORIGIN_KEY = "kitOrigin";
|
|
693
748
|
function markKitOrigin(object2, origin) {
|
|
694
749
|
const node = object2;
|
|
@@ -17164,6 +17219,76 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
17164
17219
|
return sections.length ? [{ id: group.id, name: nameIn(group, locale), sections }] : [];
|
|
17165
17220
|
});
|
|
17166
17221
|
}
|
|
17222
|
+
var melee_families_default = {
|
|
17223
|
+
families: [
|
|
17224
|
+
{
|
|
17225
|
+
id: "short_blade",
|
|
17226
|
+
note: "a knife held in one hand, edge forward: a diagonal cut from the right shoulder and a straight thrust, one after the other (spec 015 R3, 'golpe curto (faca)')",
|
|
17227
|
+
weapons: [
|
|
17228
|
+
"knife",
|
|
17229
|
+
"tactical_knife",
|
|
17230
|
+
"kabar",
|
|
17231
|
+
"meat_cleaver"
|
|
17232
|
+
],
|
|
17233
|
+
blows: [
|
|
17234
|
+
{
|
|
17235
|
+
clip: "knife_slash",
|
|
17236
|
+
motion: "slash",
|
|
17237
|
+
seconds: 0.46
|
|
17238
|
+
},
|
|
17239
|
+
{
|
|
17240
|
+
clip: "knife_stab",
|
|
17241
|
+
motion: "stab",
|
|
17242
|
+
seconds: 0.42
|
|
17243
|
+
}
|
|
17244
|
+
],
|
|
17245
|
+
reset: 1.2
|
|
17246
|
+
},
|
|
17247
|
+
{
|
|
17248
|
+
id: "one_hand_swing",
|
|
17249
|
+
note: "a short heavy tool or blade in one hand (machete, hatchet, hammer, baton, skillet): chopped down from over the right shoulder, the body turning into it as in the knife's cut",
|
|
17250
|
+
weapons: [
|
|
17251
|
+
"machete",
|
|
17252
|
+
"hatchet",
|
|
17253
|
+
"sickle",
|
|
17254
|
+
"hammer",
|
|
17255
|
+
"police_baton",
|
|
17256
|
+
"cast_iron_skillet"
|
|
17257
|
+
],
|
|
17258
|
+
blows: [
|
|
17259
|
+
{
|
|
17260
|
+
clip: "knife_slash",
|
|
17261
|
+
motion: "chop",
|
|
17262
|
+
seconds: 0.46
|
|
17263
|
+
}
|
|
17264
|
+
],
|
|
17265
|
+
reset: 1.2
|
|
17266
|
+
},
|
|
17267
|
+
{
|
|
17268
|
+
id: "two_hand_swing",
|
|
17269
|
+
note: "a long weapon in both hands (bat, pipe, crowbar, axe, sledgehammer, katana): swung flat from the right shoulder across the body, the hips leading, as the shovel's swing",
|
|
17270
|
+
weapons: [
|
|
17271
|
+
"baseball_bat",
|
|
17272
|
+
"nail_bat",
|
|
17273
|
+
"iron_pipe",
|
|
17274
|
+
"crowbar",
|
|
17275
|
+
"axe",
|
|
17276
|
+
"sledgehammer",
|
|
17277
|
+
"pickaxe",
|
|
17278
|
+
"katana"
|
|
17279
|
+
],
|
|
17280
|
+
blows: [
|
|
17281
|
+
{
|
|
17282
|
+
clip: "shovel_swing",
|
|
17283
|
+
motion: "swing",
|
|
17284
|
+
seconds: 0.6
|
|
17285
|
+
}
|
|
17286
|
+
],
|
|
17287
|
+
reset: 1.2
|
|
17288
|
+
}
|
|
17289
|
+
]
|
|
17290
|
+
};
|
|
17291
|
+
var MELEE_FAMILIES = melee_families_default.families;
|
|
17167
17292
|
|
|
17168
17293
|
// ../game-render-three/dist/index.js
|
|
17169
17294
|
var DEFAULT_ANGLE = Math.PI / 3;
|
|
@@ -17555,7 +17680,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
17555
17680
|
shade: () => shade
|
|
17556
17681
|
});
|
|
17557
17682
|
|
|
17558
|
-
// ../game-shapes/dist/chunk-
|
|
17683
|
+
// ../game-shapes/dist/chunk-QETSTM6M.js
|
|
17559
17684
|
function canonicalJson(value) {
|
|
17560
17685
|
if (value === null) return "null";
|
|
17561
17686
|
if (typeof value === "number") return Object.is(value, -0) ? "-0" : Number.isFinite(value) ? String(value) : JSON.stringify(String(value));
|
|
@@ -19877,7 +20002,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
19877
20002
|
K.cyl("metal", 0, y - 0.06, 0, 0.14, 0.015, gold);
|
|
19878
20003
|
for (let i = 0; i < 6; i++) {
|
|
19879
20004
|
const an = i * Math.PI / 3, cx = Math.cos(an), cz = Math.sin(an);
|
|
19880
|
-
K.box("metal", cx * 0.14, y - 0.06, cz * 0.14, 0.28, 0.012, 0.012, gold, -an);
|
|
20005
|
+
K.box("metal", cx * 0.14, y - (M.visorScene ? 0.06 : 0.062), cz * 0.14, 0.28, 0.012, 0.012, gold, -an);
|
|
19881
20006
|
K.cyl("plain", cx * 0.28, y - 0.06, cz * 0.28, 0.02, 0.09, 15787720);
|
|
19882
20007
|
K.cyl(on ? "emissive" : "plain", cx * 0.28, y + 0.03, cz * 0.28, 0.012, 0.03, on ? 16767120 : 15128752, 0, 0, "sphere");
|
|
19883
20008
|
K.box("glass", cx * 0.3, y - 0.2, cz * 0.3, 0.025, 0.14, 0.025, 16777215, -an);
|
|
@@ -19940,10 +20065,17 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
19940
20065
|
B.sofa_l = (M, a) => {
|
|
19941
20066
|
const K = kit(M, a), { w, d } = K.dim("sofa_l"), c = K.fabric(pick(K, [7237752, 9075304, 4544618])), cd = shade(c, 0.82), zb = -d / 2, pf = 0.95, ac = K.accent(13146698), cw = 0.95;
|
|
19942
20067
|
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));
|
|
19943
|
-
|
|
19944
|
-
|
|
20068
|
+
if (M.visorScene) {
|
|
20069
|
+
K.box("fabric", -(cw / 2), 0.08, zb + pf / 2, w - cw, 0.26, pf, cd);
|
|
20070
|
+
K.box("fabric", w / 2 - cw / 2, 0.08, 0, cw, 0.26, d, cd);
|
|
20071
|
+
} else {
|
|
20072
|
+
const zf = zb + 0.22, xs = -w / 2 + 0.18;
|
|
20073
|
+
K.box("fabric", (xs + w / 2 - cw) / 2, 0.08, (zf + zb + pf) / 2, w / 2 - cw - xs, 0.26, zb + pf - zf, cd);
|
|
20074
|
+
K.box("fabric", w / 2 - cw / 2, 0.08, (zf + d / 2) / 2, cw, 0.26, d / 2 - zf, cd);
|
|
20075
|
+
}
|
|
19945
20076
|
K.box("fabric", 0, 0.08, zb + 0.11, w, 0.72, 0.22, cd);
|
|
19946
|
-
K.box("fabric", -w / 2 + 0.09, 0.08, zb + pf / 2, 0.18, 0.55, pf, cd);
|
|
20077
|
+
if (M.visorScene) K.box("fabric", -w / 2 + 0.09, 0.08, zb + pf / 2, 0.18, 0.55, pf, cd);
|
|
20078
|
+
else K.box("fabric", -w / 2 + 0.09, 0.08, (zb + 0.22 + zb + pf) / 2, 0.18, 0.55, pf - 0.22, cd);
|
|
19947
20079
|
const nm = 2, mw = (w - cw - 0.18) / nm;
|
|
19948
20080
|
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);
|
|
19949
20081
|
K.box("fabric", w / 2 - cw / 2, 0.34, 0.035, cw - 0.04, 0.16, d - 0.2, c);
|
|
@@ -19962,7 +20094,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
19962
20094
|
K.box("fabric", 0, 0.55, -d / 2 + 0.5, 0.4, 0.16, 0.12, accent, 0, 0.5);
|
|
19963
20095
|
const hw = w + 0.5, n = Math.round(hw / 0.11);
|
|
19964
20096
|
K.box("wood", 0, 0.2, -d / 2 - 0.05, hw, 1, 0.04, shade(wood, 0.7));
|
|
19965
|
-
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 : shade(wood, 1.12));
|
|
20097
|
+
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 : shade(wood, 1.12));
|
|
19966
20098
|
for (const s of [-1, 1]) {
|
|
19967
20099
|
K.box("wood", s * (w / 2 + 0.3), 0.35, -d / 2 + 0.22, 0.4, 0.16, 0.36, shade(wood, 1.05));
|
|
19968
20100
|
K.cyl("plain", s * (w / 2 + 0.3), 0.51, -d / 2 + 0.2, 0.06, 0.03, 15262940);
|
|
@@ -19974,8 +20106,8 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
19974
20106
|
const K = kit(M, a), { w, d } = K.dim("home_office"), wood = K.wood(13808780), zb = -d / 2;
|
|
19975
20107
|
K.box("wood", 0, 0.72, 0, w, 0.035, d, wood);
|
|
19976
20108
|
for (const s of [-1, 1]) K.box("metal", s * (w / 2 - 0.04), 0, 0, 0.035, 0.72, d - 0.1, 2236966);
|
|
19977
|
-
K.box("metal", 0, 0.3, zb + 0.05, w - 0.1, 0.03, 0.02, 2236966);
|
|
19978
|
-
K.box("plain", w / 2 - 0.25, 0.28, 0, 0.4, 0.44, d - 0.08, 15262940);
|
|
20109
|
+
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);
|
|
20110
|
+
K.box("plain", w / 2 - 0.25, 0.28, 0, 0.4, M.visorScene ? 0.44 : 0.436, d - 0.08, 15262940);
|
|
19979
20111
|
for (let i = 0; i < 2; i++) {
|
|
19980
20112
|
K.box("plain", w / 2 - 0.25, 0.3 + i * 0.2, d / 2 - 0.04, 0.37, 0.18, 0.01, 15920870);
|
|
19981
20113
|
K.box("metal", w / 2 - 0.25, 0.39 + i * 0.2, d / 2 - 0.03, 0.12, 0.012, 0.012, 10132122);
|
|
@@ -19994,10 +20126,11 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
19994
20126
|
const zc = d / 2 + 0.3, cc = K.fabric(2763310);
|
|
19995
20127
|
K.box("plain", 0, 0.44, zc, 0.48, 0.07, 0.46, cc);
|
|
19996
20128
|
K.box("plain", 0, 0.52, zc + 0.22, 0.44, 0.52, 0.07, cc, 0, 0.12);
|
|
19997
|
-
K.cyl("metal", 0, 0.06, zc, 0.025, 0.38, 2763306);
|
|
20129
|
+
K.cyl("metal", 0, M.visorScene ? 0.06 : 0.07, zc, 0.025, M.visorScene ? 0.38 : 0.37, 2763306);
|
|
19998
20130
|
for (let i = 0; i < 5; i++) {
|
|
19999
20131
|
const an = i * 1.2566, x = Math.cos(an) * 0.17, z = zc + Math.sin(an) * 0.17;
|
|
20000
|
-
|
|
20132
|
+
const lo = M.visorScene ? 0 : i * 15e-4;
|
|
20133
|
+
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);
|
|
20001
20134
|
K.cyl("plain", x, 0, z, 0.03, 0.05, 1710618);
|
|
20002
20135
|
}
|
|
20003
20136
|
};
|
|
@@ -20007,9 +20140,10 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20007
20140
|
K.box("plain", 0, 0, -d / 2 + 0.01, inner, M.visorScene ? h : h - 0.03, 0.02, shade(wood, 0.95));
|
|
20008
20141
|
for (const s of [-1, 1]) K.box("plain", s * (w / 2 - 0.015), 0, 0, 0.03, h, d, wood);
|
|
20009
20142
|
K.box("plain", 0, h - 0.03, 0, inner, 0.03, d, wood);
|
|
20010
|
-
K.box("plain", 0, 0.06, 0, w - 0.06, 0.02, d - 0.02, wood);
|
|
20011
|
-
K.box("plain", 0, 0, 0, w - 0.04, 0.06, d - 0.06, 2763306);
|
|
20012
|
-
K.box("plain", dv, 0.06, 0, 0.025, h - 0.09, d - 0.02, wood);
|
|
20143
|
+
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);
|
|
20144
|
+
K.box("plain", 0, 0, 0, M.visorScene ? w - 0.04 : w - 0.06, 0.06, d - 0.06, 2763306);
|
|
20145
|
+
if (M.visorScene) K.box("plain", dv, 0.06, 0, 0.025, h - 0.09, d - 0.02, wood);
|
|
20146
|
+
else K.box("plain", dv, 0.08, 0.01, 0.025, h - 0.11, d - 0.04, wood);
|
|
20013
20147
|
const rod = h * 0.76;
|
|
20014
20148
|
K.cyl("metal", (-w / 2 + dv) / 2, rod, 0, 0.012, dv + w / 2 - 0.06, 11580600, 0, Math.PI / 2);
|
|
20015
20149
|
K.box("plain", (-w / 2 + dv) / 2, rod + 0.05, 0, dv + w / 2 - 0.05, 0.02, d - 0.04, wood);
|
|
@@ -20036,7 +20170,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20036
20170
|
};
|
|
20037
20171
|
B.vanity = (M, a) => {
|
|
20038
20172
|
const K = kit(M, a), { w, d } = K.dim("vanity"), zb = -d / 2, br = 16053488;
|
|
20039
|
-
K.cyl("plain", 0, 0, zb + 0.12, 0.08, 0.7, br);
|
|
20173
|
+
K.cyl("plain", 0, M.visorScene ? 0 : 0.03, zb + 0.12, 0.08, M.visorScene ? 0.7 : 0.67, br);
|
|
20040
20174
|
K.cyl("plain", 0, 0, zb + 0.12, 0.1, 0.03, br);
|
|
20041
20175
|
K.box("plain", 0, 0.74, 0, w, 0.12, d, br);
|
|
20042
20176
|
K.box("plain", 0, 0.865, 0.02, w - 0.1, 0.012, d - 0.1, 13949146);
|
|
@@ -20047,8 +20181,8 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20047
20181
|
K.box("plain", 0, 1.1, zb + 0.012, 0.52, 0.72, 0.024, K.color("metal", 14999768));
|
|
20048
20182
|
K.plane("atlas_picture", 0, 1.46, zb + 0.026, 0.46, 0.66, 16777215, 0, 0, 0, atlas("picture").mirror());
|
|
20049
20183
|
K.box("metal", -w / 2 - 0.02, 0.95, zb + 0.06, 0.03, 0.03, 0.03, 11580600);
|
|
20050
|
-
K.box("metal", -w / 2 - 0.02, 0.95, zb + 0.06, 0.28, 0.014, 0.014, 11580600);
|
|
20051
|
-
K.box("fabric", -w / 2 - 0.02, 0.62, zb + 0.065, 0.26, 0.34, 0.02, K.accent(3042942));
|
|
20184
|
+
K.box("metal", -w / 2 - 0.02, M.visorScene ? 0.95 : 0.958, zb + 0.06, 0.28, 0.014, 0.014, 11580600);
|
|
20185
|
+
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));
|
|
20052
20186
|
};
|
|
20053
20187
|
B.tv_stand = (M, a) => {
|
|
20054
20188
|
const K = kit(M, a), { w, d } = K.dim("tv_stand"), wood = K.wood(13148272), br = K.color("fabric_main", 15789542);
|
|
@@ -20092,7 +20226,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20092
20226
|
K.box("plain", w * 0.38, 0, z0 + 0.35, 0.5, 0.4, 0.4, 12098154, 0.2);
|
|
20093
20227
|
K.box("plain", w * 0.4, 0.4, z0 + 0.33, 0.45, 0.35, 0.38, 11044954, -0.3);
|
|
20094
20228
|
for (let i = 0; i < 4; i++) {
|
|
20095
|
-
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));
|
|
20229
|
+
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));
|
|
20096
20230
|
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);
|
|
20097
20231
|
}
|
|
20098
20232
|
K.box("wood", -w * 0.4, 0, z0 + 0.9, 0.4, 0.04, 0.4, wood, 0.3, 0, 0.4);
|
|
@@ -20151,10 +20285,10 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20151
20285
|
const K = kit(M, a), y = M.y || 0, cs = [13148208, 11549226, 4880954, 14209200, 9058858], rw = [4, 3, 2];
|
|
20152
20286
|
rw.forEach((n, r) => {
|
|
20153
20287
|
for (let i = 0; i < n; i++) {
|
|
20154
|
-
const x = (i - (n - 1) / 2) * 0.072, c = cs[(i + r * 2) % cs.length];
|
|
20155
|
-
K.cyl("plain", x,
|
|
20156
|
-
K.cyl("plain", x,
|
|
20157
|
-
K.cyl("metal", x,
|
|
20288
|
+
const x = (i - (n - 1) / 2) * 0.072, c = cs[(i + r * 2) % cs.length], ry = y + r * (M.visorScene ? 0.1 : 0.104);
|
|
20289
|
+
K.cyl("plain", x, ry, 0, 0.033, 0.1, c);
|
|
20290
|
+
K.cyl("plain", x, ry + 0.02, 0, 0.0345, 0.055, 15262936);
|
|
20291
|
+
K.cyl("metal", x, ry + 0.1, 0, 0.031, 4e-3, 12106944);
|
|
20158
20292
|
}
|
|
20159
20293
|
});
|
|
20160
20294
|
K.cyl("plain", 0.3, y + 0.033, 0.1, 0.033, 0.1, 13148208, 0, Math.PI / 2);
|
|
@@ -20173,10 +20307,11 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20173
20307
|
const K = kit(M, a), { w, d } = K.dim("floor_mattress"), h = 0.17, c = K.fabric(13156528), ac = K.accent(6965818);
|
|
20174
20308
|
K.box("fabric", 0, 0, 0, w, h, d, c);
|
|
20175
20309
|
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, shade(c, 0.86));
|
|
20176
|
-
|
|
20177
|
-
K.box("fabric", 0
|
|
20178
|
-
K.box("fabric", 0.
|
|
20179
|
-
K.box("fabric",
|
|
20310
|
+
const v = M.visorScene ? 0 : 1;
|
|
20311
|
+
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);
|
|
20312
|
+
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);
|
|
20313
|
+
K.box("fabric", 0.15, h + 0.05 - v * 2e-3, 0, w * 0.5, 0.05, 0.4, shade(ac, 1.2), 0.3);
|
|
20314
|
+
K.box("fabric", -0.2, h + 0.05 - v * 4e-3, 0.5, w * 0.3, 0.06 + v * 4e-3, 0.3, shade(ac, 0.8), -0.4);
|
|
20180
20315
|
};
|
|
20181
20316
|
B.lantern = (M, a) => {
|
|
20182
20317
|
const K = kit(M, a), y = M.y || 0;
|
|
@@ -20195,7 +20330,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20195
20330
|
K.cyl("plain", x, y + 0.012, z, 0.017, h, 15787720);
|
|
20196
20331
|
K.cyl("emissive", x, y + 0.012 + h, z, 8e-3, 0.03, i % 2 ? 16760928 : 16767120, 0, 0, "sphere");
|
|
20197
20332
|
});
|
|
20198
|
-
K.cyl("plain", 0.02, y + 0.012, 0, 0.05, 8e-3, 15787720);
|
|
20333
|
+
K.cyl("plain", 0.02, y + (M.visorScene ? 0.012 : 0.01), 0, 0.05, M.visorScene ? 8e-3 : 0.01, 15787720);
|
|
20199
20334
|
if (M.lit !== false) K.light(0, y + 0.22, 0, 16756832, 5, "candles");
|
|
20200
20335
|
};
|
|
20201
20336
|
B.open_suitcases = (M, a) => {
|
|
@@ -20204,7 +20339,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20204
20339
|
const lx = x, hz2 = z - dd / 2;
|
|
20205
20340
|
K.box("plain", lx, 0, z, ww, 0.16, dd, c, ry);
|
|
20206
20341
|
K.box("fabric", lx, 0.12, z, ww - 0.06, 0.05, dd - 0.06, 14209216, ry);
|
|
20207
|
-
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);
|
|
20342
|
+
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);
|
|
20208
20343
|
K.ramp("plain", lx, 0.16, hz2, ww, 0.07, dd, c, al);
|
|
20209
20344
|
K.box("metal", lx + ww * 0.3, 0.1, z + dd / 2, 0.04, 0.03, 0.01, 12632256);
|
|
20210
20345
|
};
|
|
@@ -20213,18 +20348,31 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20213
20348
|
};
|
|
20214
20349
|
B.clothes_on_floor = (M, a) => {
|
|
20215
20350
|
const K = kit(M, a), { w, d } = K.dim("clothes_on_floor"), cs = [13156520, 4876938, 11028538, 14736592, 6982234, 2763312, K.accent(13146698)];
|
|
20351
|
+
let k = 0;
|
|
20352
|
+
const tops = [];
|
|
20353
|
+
const lay = (m, x, y, z, bw, h, bd, c, r) => {
|
|
20354
|
+
if (M.visorScene) {
|
|
20355
|
+
K.box(m, x, y, z, bw, h, bd, c, r);
|
|
20356
|
+
return;
|
|
20357
|
+
}
|
|
20358
|
+
const y0 = 4e-3 + k++ * 15e-4;
|
|
20359
|
+
let top = y0 + h;
|
|
20360
|
+
while (tops.some((t) => Math.abs(t - top) < 13e-4)) top += 13e-4;
|
|
20361
|
+
tops.push(top);
|
|
20362
|
+
K.box(m, x, y0, z, bw, top - y0, bd, c, r);
|
|
20363
|
+
};
|
|
20216
20364
|
for (let i = 0; i < 9; i++) {
|
|
20217
20365
|
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;
|
|
20218
20366
|
if (i % 3 === 0) {
|
|
20219
|
-
|
|
20220
|
-
for (const s of [-1, 1])
|
|
20367
|
+
lay("fabric", x, y, z, 0.3, 0.012, 0.36, c, r);
|
|
20368
|
+
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, shade(c, 0.9), r + s * 0.5);
|
|
20221
20369
|
} else if (i % 3 === 1) {
|
|
20222
|
-
for (const s of [-1, 1])
|
|
20223
|
-
} else
|
|
20370
|
+
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);
|
|
20371
|
+
} else lay("fabric", x, y, z, 0.14, 0.01, 0.07, c, r);
|
|
20224
20372
|
}
|
|
20225
20373
|
const sx = (K.rnd() - 0.5) * (w - 0.4), sz = (K.rnd() - 0.5) * (d - 0.4);
|
|
20226
|
-
|
|
20227
|
-
|
|
20374
|
+
lay("plain", sx, 0.012, sz, 0.09, 0.07, 0.27, 2763306, 0.4);
|
|
20375
|
+
lay("plain", sx + 0.15, 0.012, sz + 0.05, 0.09, 0.07, 0.27, 2763306, 0.9);
|
|
20228
20376
|
};
|
|
20229
20377
|
B.fallen_chair = (M, a) => {
|
|
20230
20378
|
const g = Math.PI / 2, dy = 0.23, api = { box: (Mm, mat, x, y, z, w, h, d, color2, ry, rx, rz) => {
|
|
@@ -20238,17 +20386,30 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20238
20386
|
};
|
|
20239
20387
|
B.blood_stains = (M, a) => {
|
|
20240
20388
|
const K = kit(M, a), { w, d } = K.dim("blood_stains");
|
|
20241
|
-
|
|
20389
|
+
let n = 0;
|
|
20390
|
+
const film = () => {
|
|
20391
|
+
const y0 = 0.011 - n * 11e-4, y1 = 0.0125 + n * 11e-4;
|
|
20392
|
+
n++;
|
|
20393
|
+
return { y: y0, h: y1 - y0 };
|
|
20394
|
+
};
|
|
20395
|
+
for (let k = 0; k < 7; k++) {
|
|
20396
|
+
const f = film();
|
|
20397
|
+
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);
|
|
20398
|
+
}
|
|
20242
20399
|
for (let k = 0; k < 8; k++) {
|
|
20243
|
-
const an = K.rnd() * 6.28, r = 0.3 + K.rnd() * Math.min(w, d) * 0.4;
|
|
20244
|
-
K.cyl("plain", Math.cos(an) * r,
|
|
20400
|
+
const an = K.rnd() * 6.28, r = 0.3 + K.rnd() * Math.min(w, d) * 0.4, f = film();
|
|
20401
|
+
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);
|
|
20402
|
+
}
|
|
20403
|
+
if (M.drag !== false) for (let k = 1; k < 6; k++) {
|
|
20404
|
+
const f = film();
|
|
20405
|
+
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);
|
|
20245
20406
|
}
|
|
20246
|
-
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);
|
|
20247
20407
|
};
|
|
20248
20408
|
B.open_door = (M, a) => {
|
|
20249
20409
|
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;
|
|
20250
|
-
|
|
20251
|
-
K.box("wood", w / 2
|
|
20410
|
+
const jh = M.visorScene ? h + 0.06 : h;
|
|
20411
|
+
K.box("wood", -w / 2 - 0.03, 0, 0, 0.06, jh, d, shade(wood, 0.8));
|
|
20412
|
+
K.box("wood", w / 2 + 0.03, 0, 0, 0.06, jh, d, shade(wood, 0.8));
|
|
20252
20413
|
K.box("wood", 0, h, 0, w + 0.12, 0.06, d, shade(wood, 0.8));
|
|
20253
20414
|
K.box("wood", hx + Math.cos(angle) * L / 2, 0, Math.sin(angle) * L / 2, L, h - 0.02, 0.04, wood, -angle);
|
|
20254
20415
|
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);
|
|
@@ -20368,9 +20529,9 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20368
20529
|
for (const s of [-1, 1]) K.box("plain", s * (w / 2 + t / 2), 0, 0, t, 0.1, d, bo);
|
|
20369
20530
|
cover(a, M, "pool_tile", { w, d, y: 0.035, size: 1 });
|
|
20370
20531
|
K.plane("water", 0, 0.075, 0, w, d, 9426158, 0, -Math.PI / 2, 0);
|
|
20371
|
-
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);
|
|
20532
|
+
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);
|
|
20372
20533
|
for (const s of [-1, 1]) {
|
|
20373
|
-
K.box("metal", -w / 4 + s * 0.2, 0, d / 2 + t * 0.6, 0.03, 0.85, 0.03, 13159632);
|
|
20534
|
+
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);
|
|
20374
20535
|
K.box("metal", -w / 4 + s * 0.2, 0.85, d / 2 + t * 0.6 - 0.1, 0.03, 0.03, 0.22, 13159632);
|
|
20375
20536
|
K.box("metal", -w / 4 + s * 0.2, 0, d / 2 - 0.25, 0.03, 0.88, 0.03, 13159632, 0, 0);
|
|
20376
20537
|
}
|
|
@@ -20380,20 +20541,22 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20380
20541
|
const K = kit(M, a), { w, d } = K.dim("deck"), h = 0.2, wood = K.wood(6965808);
|
|
20381
20542
|
K.box("wood", 0, 0, 0, w - 0.05, h, d - 0.05, shade(wood, 0.7));
|
|
20382
20543
|
cover(a, M, "deck_floor", { w, d, y: h + 0.012, size: 1.2, color: M.color });
|
|
20383
|
-
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);
|
|
20384
|
-
|
|
20385
|
-
K.box("wood", 0, 0
|
|
20544
|
+
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);
|
|
20545
|
+
const sz = M.visorScene ? d / 2 + 0.17 : d / 2 + 0.025 + 0.1575, sd = M.visorScene ? 0.34 : 0.315;
|
|
20546
|
+
K.box("wood", 0, 0, sz, 1.4, 0.1, sd, wood);
|
|
20547
|
+
K.box("wood", 0, 0.1, sz, 1.4, 0.012, sd, shade(wood, 1.2));
|
|
20386
20548
|
};
|
|
20387
20549
|
B.sun_lounger = (M, a) => {
|
|
20388
20550
|
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);
|
|
20389
20551
|
for (const s of [-1, 1]) {
|
|
20390
20552
|
K.box("metal", s * (w / 2 - 0.03), 0.17, -0.3, 0.035, 0.035, 1.35, fr);
|
|
20391
|
-
|
|
20392
|
-
K.box("metal", s * (w / 2 - 0.03), 0,
|
|
20553
|
+
const lw = M.visorScene ? 0.035 : 0.025;
|
|
20554
|
+
K.box("metal", s * (w / 2 - 0.03), 0, 0.95, lw, 0.2, 0.035, fr);
|
|
20555
|
+
K.box("metal", s * (w / 2 - 0.03), 0, -0.3, lw, 0.2, 0.035, fr);
|
|
20393
20556
|
K.cyl("plain", s * (w / 2 - 0.03), 0.07, -0.3, 0.07, 0.03, 2763306, 0, Math.PI / 2);
|
|
20394
20557
|
}
|
|
20395
20558
|
K.box("fabric", 0, 0.21, 0.35, w - 0.1, 0.06, 1.3, cu);
|
|
20396
|
-
K.ramp("fabric", 0, 0.2, -0.3, w - 0.1, 0.06, 0.8, cu, al);
|
|
20559
|
+
K.ramp("fabric", 0, 0.2, -0.3, M.visorScene ? w - 0.1 : w - 0.104, 0.06, 0.8, cu, al);
|
|
20397
20560
|
for (let i = 0; i < 4; i++) {
|
|
20398
20561
|
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);
|
|
20399
20562
|
}
|
|
@@ -20469,7 +20632,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20469
20632
|
for (const s of [-1, 1]) {
|
|
20470
20633
|
K.box("plain", s * 0.35, py + 0.05, pz, 0.04, 0.42, 0.74, az);
|
|
20471
20634
|
}
|
|
20472
|
-
K.box("plain", 0, py + 0.05, pz - 0.35, 0.74, 0.42, 0.04, az);
|
|
20635
|
+
K.box("plain", 0, py + 0.05, pz - 0.35, M.visorScene ? 0.74 : 0.66, 0.42, 0.04, az);
|
|
20473
20636
|
const run = d / 2 - pz - 0.4, al = Math.atan2(py - 0.1, run);
|
|
20474
20637
|
K.ramp("plain", 0, py, pz + 0.37, 0.5, 0.04, Math.hypot(run, py - 0.1) + 0.1, 14209216, -al + 0 + 0);
|
|
20475
20638
|
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);
|
|
@@ -20479,7 +20642,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20479
20642
|
};
|
|
20480
20643
|
B.swing = (M, a) => {
|
|
20481
20644
|
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);
|
|
20482
|
-
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);
|
|
20645
|
+
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);
|
|
20483
20646
|
K.box("metal", 0, h - 0.04, 0, w + 0.1, 0.1, 0.1, shade(mt, 0.85));
|
|
20484
20647
|
const cs = [K.accent(13123642), 2763306];
|
|
20485
20648
|
for (let i = 0; i < 2; i++) {
|
|
@@ -20491,11 +20654,11 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20491
20654
|
B.bbq_simple = (M, a) => {
|
|
20492
20655
|
const K = kit(M, a), { w, d } = K.dim("bbq_simple"), br = K.color("exterior_floor", 11688512), hb = 0.78;
|
|
20493
20656
|
K.box("plain", 0, 0, 0, w, 0.45, d, br);
|
|
20494
|
-
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);
|
|
20495
|
-
K.box("plain", 0, 0.45, 0, w - 0.22, 0.04, d - 0.22, 2762276);
|
|
20657
|
+
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);
|
|
20658
|
+
K.box("plain", 0, 0.45, 0, w - (M.visorScene ? 0.22 : 0.24), 0.04, d - (M.visorScene ? 0.22 : 0.24), 2762276);
|
|
20496
20659
|
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);
|
|
20497
20660
|
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);
|
|
20498
|
-
K.box("metal", 0, hb + 0.01, -d / 2 + 0.2, w - 0.1, 0.012, 0.02, 5921374);
|
|
20661
|
+
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);
|
|
20499
20662
|
for (let i = 0; i < 3; i++) {
|
|
20500
20663
|
const z = (i - 1) * 0.15;
|
|
20501
20664
|
K.cyl("metal", 0, hb + 0.05, z, 6e-3, w + 0.12, 11580600, 0, Math.PI / 2);
|
|
@@ -20511,7 +20674,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20511
20674
|
const cz = -0.35;
|
|
20512
20675
|
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, shade(c, 0.9));
|
|
20513
20676
|
K.box("plain", 0, 1.26, cz, w - 0.1, 0.05, 1.75, shade(c, 1.04));
|
|
20514
|
-
K.box("glass", 0, 0.76, cz, w - 0.06, 0.5, 1.6, 16777215);
|
|
20677
|
+
K.box("glass", 0, M.visorScene ? 0.76 : 0.762, cz, w - 0.06, M.visorScene ? 0.5 : 0.496, 1.6, 16777215);
|
|
20515
20678
|
K.box("glass", 0, 0.76, cz + 0.8, w - 0.12, 0.5, 0.04, 16777215, 0, 0.5);
|
|
20516
20679
|
for (const s of [-1, 1]) {
|
|
20517
20680
|
K.box("plain", s * 0.4, 0.55, cz + 0.4, 0.4, 0.3, 0.4, 2763310);
|
|
@@ -20537,10 +20700,9 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20537
20700
|
K.box("plain", xa, 0, zc, 1.6, 0.85, 0.7, br);
|
|
20538
20701
|
for (let i = 1; i < 4; i++) K.box("plain", xa, i * 0.2, zc + 0.351, 1.6, 0.012, 4e-3, shade(br, 0.7));
|
|
20539
20702
|
K.box("plain", xa, 0.12, zc + (M.visorScene ? 0.352 : 0.355), 0.7, 0.4, 4e-3, 1709586);
|
|
20540
|
-
|
|
20541
|
-
|
|
20542
|
-
|
|
20543
|
-
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);
|
|
20703
|
+
const sd = M.visorScene ? 0.7 : 0.4, sz = M.visorScene ? zc : zc + 0.05;
|
|
20704
|
+
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);
|
|
20705
|
+
K.box("plain", xa, M.visorScene ? 0.85 : 0.852, zc + 0.02, 1.4, 0.025, 0.4, 2762276);
|
|
20544
20706
|
K.box("plain", xa, 1.5, zc - 0.07, 1.5, 0.4, 0.56, br);
|
|
20545
20707
|
K.box("plain", xa, 1.5, zc + 0.215, 1.5, 0.4, 0.01, 1709586);
|
|
20546
20708
|
K.box("plain", xa, 1.9, zc - 0.12, 0.62, 1, 0.46, br);
|
|
@@ -20548,9 +20710,10 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20548
20710
|
K.box("plain", xa, 2.98, zc - 0.12, 0.5, 0.06, 0.4, shade(br, 0.75));
|
|
20549
20711
|
K.box("plain", xb, 0, zc, 1.44, 0.85, 0.7, cab);
|
|
20550
20712
|
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);
|
|
20551
|
-
|
|
20713
|
+
const ct0 = M.visorScene ? xb - 0.74 : xa + 0.802, ct1 = xc + 0.67;
|
|
20714
|
+
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);
|
|
20552
20715
|
K.box("metal", xb, 0.89, zc, 0.5, 0.01, 0.38, 11580600);
|
|
20553
|
-
K.box("metal", xb, M.visorScene ? 0.895 : 0.
|
|
20716
|
+
K.box("metal", xb, M.visorScene ? 0.895 : 0.893, zc, 0.44, M.visorScene ? 6e-3 : 4e-3, 0.32, 7370362);
|
|
20554
20717
|
K.box("plain", xc, 0, zc, 1.3, 0.85, 0.7, cab);
|
|
20555
20718
|
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);
|
|
20556
20719
|
K.cyl("plain", xc, 0.89, zc, 0.1, 0.05, 15790314);
|
|
@@ -20573,7 +20736,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20573
20736
|
const K = kit(M, a), { w, d, h } = K.dim("sauna"), t = 0.08, wood = K.wood(12618324), shade1 = shade(wood, 0.88), dw = 0.7, dx = w / 2 - 0.55;
|
|
20574
20737
|
K.box("wood", 0, 0, 0, w, 0.05, d, shade(wood, 0.75));
|
|
20575
20738
|
K.box("wood", 0, 0.05, -d / 2 + t / 2, w, h - 0.11, t, wood);
|
|
20576
|
-
for (const s of [-1, 1]) K.box("wood", s * (w / 2 - t / 2), 0.05, 0, t, h - 0.11, d - 2 * t
|
|
20739
|
+
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);
|
|
20577
20740
|
K.box("wood", 0, h - 0.06, 0, w + 0.12, 0.06, d + 0.12, shade(wood, 0.75));
|
|
20578
20741
|
const lx0 = -w / 2, lx1 = dx - dw / 2;
|
|
20579
20742
|
K.box("wood", (lx0 + lx1) / 2, 0.05, d / 2 - t / 2, lx1 - lx0, h - 0.11, t, wood);
|
|
@@ -20584,8 +20747,9 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20584
20747
|
K.box("wood", x, 0.05, d / 2 + 3e-3, 0.012, h - 0.11, 5e-3, shade(wood, 0.6));
|
|
20585
20748
|
}
|
|
20586
20749
|
const jamb = M.visorScene ? 0.025 : 0;
|
|
20587
|
-
|
|
20588
|
-
K.box("wood", dx
|
|
20750
|
+
const jy = M.visorScene ? 0.05 : 0.048;
|
|
20751
|
+
K.box("wood", dx - dw / 2 - jamb, jy, d / 2 - 0.02, 0.05, 1.87 - jy, 0.06, shade1);
|
|
20752
|
+
K.box("wood", dx + dw / 2 + jamb, jy, d / 2 - 0.02, 0.05, 1.87 - jy, 0.06, shade1);
|
|
20589
20753
|
K.box("glass", dx, 0.06, d / 2 - 0.02, dw, 1.75, 0.02, 16777215);
|
|
20590
20754
|
K.box("metal", dx - dw / 2 + 0.08, 0.7, d / 2 + 0.03, 0.02, 0.5, 0.03, 13159632);
|
|
20591
20755
|
K.box("wood", 0, 0.85, -d / 2 + t + 0.25, w - 2 * t, 0.05, 0.5, shade(wood, 1.1));
|
|
@@ -21010,7 +21174,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21010
21174
|
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 }),
|
|
21011
21175
|
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 }),
|
|
21012
21176
|
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 }),
|
|
21013
|
-
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 })
|
|
21177
|
+
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 }),
|
|
21178
|
+
lathe: (M, material, x, y, z, points, color2) => void primitives.push({ kind: "lathe", M, material, x, y, z, points, color: color2 })
|
|
21014
21179
|
};
|
|
21015
21180
|
if (options.light !== false) {
|
|
21016
21181
|
api.light = (M, x, y, z, color2, range3, lightKind) => void primitives.push({ kind: "light", M, x, y, z, color: color2, range: range3, lightKind });
|
|
@@ -21079,6 +21244,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21079
21244
|
list2.push({ kind: "cylinder", radiusTop: 1, radiusBottom: 1, height: 1, radialSegments: cyl, ...place });
|
|
21080
21245
|
}
|
|
21081
21246
|
},
|
|
21247
|
+
lathe(M, material, x, y, z, points, color2) {
|
|
21248
|
+
into(M).push({ kind: "lathe", material, color: color2, position: [x, y, z], points: points.map(([r, py]) => [r, py]), segments: cyl });
|
|
21249
|
+
},
|
|
21082
21250
|
leaf(M, x, y, z, w, h, color2, ry, rx) {
|
|
21083
21251
|
into(M).push({ kind: "mesh", ...LEAF, material: "plant", color: color2, position: [x, y, z], rotation: [rx, ry, 0], rotationOrder: "YXZ", scale: [w, h, 1] });
|
|
21084
21252
|
},
|
|
@@ -21331,9 +21499,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21331
21499
|
/** `a + b * s` */
|
|
21332
21500
|
madd: (a, b, s) => [a[0] + b[0] * s, a[1] + b[1] * s, a[2] + b[2] * s]
|
|
21333
21501
|
};
|
|
21334
|
-
var
|
|
21502
|
+
var IDENTITY2 = [0, 0, 0, 1];
|
|
21335
21503
|
var quat = {
|
|
21336
|
-
identity: () => [
|
|
21504
|
+
identity: () => [IDENTITY2[0], IDENTITY2[1], IDENTITY2[2], IDENTITY2[3]],
|
|
21337
21505
|
/** Hamilton product `a * b` (apply `b` first, then `a`). */
|
|
21338
21506
|
mul: (a, b) => [
|
|
21339
21507
|
a[3] * b[0] + a[0] * b[3] + a[1] * b[2] - a[2] * b[1],
|
|
@@ -21380,7 +21548,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21380
21548
|
return quat.normalize(q);
|
|
21381
21549
|
}
|
|
21382
21550
|
};
|
|
21383
|
-
var
|
|
21551
|
+
var quatFromEuler2 = (x, y, z) => {
|
|
21384
21552
|
const c1 = Math.cos(x / 2), c2 = Math.cos(y / 2), c3 = Math.cos(z / 2);
|
|
21385
21553
|
const s1 = Math.sin(x / 2), s2 = Math.sin(y / 2), s3 = Math.sin(z / 2);
|
|
21386
21554
|
return [s1 * c2 * c3 + c1 * s2 * s3, c1 * s2 * c3 - s1 * c2 * s3, c1 * c2 * s3 + s1 * s2 * c3, c1 * c2 * c3 - s1 * s2 * s3];
|
|
@@ -21706,6 +21874,33 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21706
21874
|
return out;
|
|
21707
21875
|
};
|
|
21708
21876
|
var granules = (inp, box5, count) => bsp(box5, 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] }));
|
|
21877
|
+
var SLAB_MIN = 0.03;
|
|
21878
|
+
var splitAtHit = (root, hit, axes, count, rnd2) => {
|
|
21879
|
+
let pieces = [root];
|
|
21880
|
+
for (const ax of axes) {
|
|
21881
|
+
const half = root.s[ax] / 2;
|
|
21882
|
+
if (hit[ax] - -half < SLAB_MIN || half - hit[ax] < SLAB_MIN) continue;
|
|
21883
|
+
const next = [];
|
|
21884
|
+
for (const b of pieces) {
|
|
21885
|
+
const lo = b.c[ax] - b.s[ax] / 2;
|
|
21886
|
+
const hi = b.c[ax] + b.s[ax] / 2;
|
|
21887
|
+
for (const [from, to] of [[lo, hit[ax]], [hit[ax], hi]]) {
|
|
21888
|
+
const c = [b.c[0], b.c[1], b.c[2]];
|
|
21889
|
+
const s = [b.s[0], b.s[1], b.s[2]];
|
|
21890
|
+
c[ax] = (from + to) / 2;
|
|
21891
|
+
s[ax] = to - from;
|
|
21892
|
+
next.push({ c, s });
|
|
21893
|
+
}
|
|
21894
|
+
}
|
|
21895
|
+
pieces = next;
|
|
21896
|
+
}
|
|
21897
|
+
while (pieces.length < count) {
|
|
21898
|
+
pieces.sort((a, b) => b.s[axes[0]] * b.s[axes[1]] - a.s[axes[0]] * a.s[axes[1]]);
|
|
21899
|
+
const [big, ...rest2] = pieces;
|
|
21900
|
+
pieces = [...bsp(big, 2, axes, rnd2), ...rest2];
|
|
21901
|
+
}
|
|
21902
|
+
return pieces;
|
|
21903
|
+
};
|
|
21709
21904
|
var CRUMBS = 6;
|
|
21710
21905
|
var severAt = (inp, root, at4, gap) => {
|
|
21711
21906
|
const dims = root.s;
|
|
@@ -21768,7 +21963,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21768
21963
|
if (inp.cut) return severAt(inp, root, inp.cut.at, inp.cut.gap);
|
|
21769
21964
|
if (inp.form === "plies") return plyBreak(inp, root, maxFragments);
|
|
21770
21965
|
const n2 = Math.min(maxFragments, 2 + Math.floor(rnd2() * 3));
|
|
21771
|
-
|
|
21966
|
+
const slabs = inp.form === "granules" && dims[t] < Math.min(dims[u], dims[v]) / 4 ? splitAtHit(root, inp.hit, [u, v], n2, rnd2) : bsp(root, n2, [0, 1, 2], rnd2);
|
|
21967
|
+
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] });
|
|
21772
21968
|
if (inp.form !== "granules") return out;
|
|
21773
21969
|
const crumbs = Math.min(CRUMBS, maxFragments - out.length);
|
|
21774
21970
|
if (crumbs <= 0) return out;
|
|
@@ -22354,7 +22550,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
22354
22550
|
var bendGeometry = (part) => {
|
|
22355
22551
|
const dims = shapeDims(part.shape);
|
|
22356
22552
|
const member = isMember(dims, part.structure?.role);
|
|
22357
|
-
const q =
|
|
22553
|
+
const q = quatFromEuler2(...part.rotation ?? [0, 0, 0]);
|
|
22358
22554
|
const up = rotateVec(quat.conjugate(q), [0, 1, 0]);
|
|
22359
22555
|
let spanAxes;
|
|
22360
22556
|
let depthAxes;
|
|
@@ -24632,7 +24828,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
24632
24828
|
return Math.max(1e-4, Math.min(part.thickness ?? min2 * (part.fill ?? 1), min2));
|
|
24633
24829
|
};
|
|
24634
24830
|
var inferJoints = (parts2, tolerance = 0.01, materials = MATERIAL_MAP) => {
|
|
24635
|
-
const boxes = parts2.map((p) => aabbOf(p.shape, p.position,
|
|
24831
|
+
const boxes = parts2.map((p) => aabbOf(p.shape, p.position, quatFromEuler2(...p.rotation ?? [0, 0, 0])));
|
|
24636
24832
|
const out = [];
|
|
24637
24833
|
for (let i = 0; i < parts2.length; i++) {
|
|
24638
24834
|
for (let j = i + 1; j < parts2.length; j++) {
|
|
@@ -24742,7 +24938,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
24742
24938
|
if (st && (GONE.has(st.status) || st.group !== 0)) continue;
|
|
24743
24939
|
const ov = pose2.poses.get(ps.id);
|
|
24744
24940
|
const center = toWorld(pose2.position, pose2.rotation, ov?.pos ?? ps.position);
|
|
24745
|
-
const rotation2 = quat.mul(pose2.rotation, ov?.q ??
|
|
24941
|
+
const rotation2 = quat.mul(pose2.rotation, ov?.q ?? quatFromEuler2(...ps.rotation ?? [0, 0, 0]));
|
|
24746
24942
|
out.push({ center, half: halfOf(ps.shape), rotation: rotation2 });
|
|
24747
24943
|
}
|
|
24748
24944
|
return out;
|
|
@@ -25141,7 +25337,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
25141
25337
|
const d = {
|
|
25142
25338
|
mat,
|
|
25143
25339
|
mass0: partMass(ps, mat),
|
|
25144
|
-
q:
|
|
25340
|
+
q: quatFromEuler2(...ps.rotation ?? [0, 0, 0]),
|
|
25145
25341
|
area: shapeArea(ps.shape),
|
|
25146
25342
|
thickness: partThickness(ps),
|
|
25147
25343
|
cutFactor: cutFactorOf(ps.shape),
|
|
@@ -26791,7 +26987,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26791
26987
|
};
|
|
26792
26988
|
const implPartBox = (im, ps) => {
|
|
26793
26989
|
const ov = im.poses.get(ps.id);
|
|
26794
|
-
return aabbOf(ps.shape, toWorld(im.position, im.rotation, ov?.pos ?? ps.position), quat.mul(im.rotation, ov?.q ??
|
|
26990
|
+
return aabbOf(ps.shape, toWorld(im.position, im.rotation, ov?.pos ?? ps.position), quat.mul(im.rotation, ov?.q ?? quatFromEuler2(...ps.rotation ?? [0, 0, 0])));
|
|
26795
26991
|
};
|
|
26796
26992
|
const implBounds = /* @__PURE__ */ new WeakMap();
|
|
26797
26993
|
const implBoundsOf = (im) => {
|
|
@@ -26994,7 +27190,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26994
27190
|
counts.shapeTested.add(im.impl.id);
|
|
26995
27191
|
}
|
|
26996
27192
|
const ov = im.poses.get(ps.id);
|
|
26997
|
-
const r = rayPartRaw(im.position, im.rotation, ps, ov?.q ??
|
|
27193
|
+
const r = rayPartRaw(im.position, im.rotation, ps, ov?.q ?? quatFromEuler2(...ps.rotation ?? [0, 0, 0]), origin, d, ov?.pos);
|
|
26998
27194
|
if (!r || r.t1 < 0 || r.t0 > maxDist) continue;
|
|
26999
27195
|
if (r.t0 < 0) {
|
|
27000
27196
|
if (precise && im.impl.surfaceRay) boxHit = boxHit ?? { object: im.impl.id, part: ps.id, point: origin, normal: r.n, distance: 0, pathLen: r.t1 };
|
|
@@ -27033,8 +27229,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
27033
27229
|
const parts2 = im.impl.describe().parts;
|
|
27034
27230
|
const pa = parts2.find((p) => p.id === a), pb = parts2.find((p) => p.id === b);
|
|
27035
27231
|
if (!pa || !pb) return null;
|
|
27036
|
-
const A = aabbOf(pa.shape, pa.position,
|
|
27037
|
-
const B = aabbOf(pb.shape, pb.position,
|
|
27232
|
+
const A = aabbOf(pa.shape, pa.position, quatFromEuler2(...pa.rotation ?? [0, 0, 0]));
|
|
27233
|
+
const B = aabbOf(pb.shape, pb.position, quatFromEuler2(...pb.rotation ?? [0, 0, 0]));
|
|
27038
27234
|
const pos = [0, 0, 0];
|
|
27039
27235
|
for (let k = 0; k < 3; k++) pos[k] = (Math.max(A.min[k], B.min[k]) + Math.min(A.max[k], B.max[k])) / 2;
|
|
27040
27236
|
return toWorld(im.position, im.rotation, pos);
|
|
@@ -28685,13 +28881,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
28685
28881
|
}
|
|
28686
28882
|
const implParts = (im) => im.impl.describe().parts.map((ps) => {
|
|
28687
28883
|
const ov = im.poses.get(ps.id);
|
|
28688
|
-
return { ps, c: toWorld(im.position, im.rotation, ov?.pos ?? ps.position), q: quat.mul(im.rotation, ov?.q ??
|
|
28884
|
+
return { ps, c: toWorld(im.position, im.rotation, ov?.pos ?? ps.position), q: quat.mul(im.rotation, ov?.q ?? quatFromEuler2(...ps.rotation ?? [0, 0, 0])) };
|
|
28689
28885
|
});
|
|
28690
28886
|
const implInRange = (im, point, radius) => {
|
|
28691
28887
|
for (const ps of im.impl.describe().parts) {
|
|
28692
28888
|
const ov = im.poses.get(ps.id);
|
|
28693
28889
|
const c = toWorld(im.position, im.rotation, ov?.pos ?? ps.position);
|
|
28694
|
-
const q = quat.mul(im.rotation, ov?.q ??
|
|
28890
|
+
const q = quat.mul(im.rotation, ov?.q ?? quatFromEuler2(...ps.rotation ?? [0, 0, 0]));
|
|
28695
28891
|
if (distanceToShape(ps.shape, toLocal(c, q, point)) < radius) return true;
|
|
28696
28892
|
}
|
|
28697
28893
|
return false;
|
|
@@ -29716,7 +29912,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
29716
29912
|
},
|
|
29717
29913
|
setPartPose(objectId, partId, position, rotation2) {
|
|
29718
29914
|
finishExplosions();
|
|
29719
|
-
const q =
|
|
29915
|
+
const q = quatFromEuler2(...rotation2 ?? [0, 0, 0]);
|
|
29720
29916
|
const im = impls.get(objectId);
|
|
29721
29917
|
if (im) {
|
|
29722
29918
|
im.impl.setPartPose?.(partId, position, rotation2);
|
|
@@ -29835,7 +30031,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
29835
30031
|
const mat = materials.get(ps.material);
|
|
29836
30032
|
if (!mat) continue;
|
|
29837
30033
|
const ov = im.poses.get(ps.id);
|
|
29838
|
-
const r = rayPartRaw(im.position, im.rotation, ps, ov?.q ??
|
|
30034
|
+
const r = rayPartRaw(im.position, im.rotation, ps, ov?.q ?? quatFromEuler2(...ps.rotation ?? [0, 0, 0]), point, d, ov?.pos);
|
|
29839
30035
|
if (!r || r.t1 < 0 || r.t0 > L) continue;
|
|
29840
30036
|
let path = Math.min(r.t1, L) - Math.max(r.t0, 0);
|
|
29841
30037
|
if (ps.thickness !== void 0 && ps.thickness > 0) path = Math.min(path, 2 * ps.thickness);
|
|
@@ -30101,6 +30297,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
30101
30297
|
}).events;
|
|
30102
30298
|
},
|
|
30103
30299
|
state: (id) => objects.get(id)?.st ?? impls.get(id)?.impl.state() ?? null,
|
|
30300
|
+
anchoredParts: (id) => objects.get(id)?.parts.filter((p) => p.anchored && !isLost(p)).map((p) => p.spec.id) ?? [],
|
|
30301
|
+
fixedInPlace: (id) => {
|
|
30302
|
+
const o = objects.get(id);
|
|
30303
|
+
return !!o && o.spec.fixed === true && o.parts.some((p) => p.anchored && !isLost(p));
|
|
30304
|
+
},
|
|
30104
30305
|
snapshot: (id) => {
|
|
30105
30306
|
const st = objects.get(id)?.st ?? impls.get(id)?.impl.state();
|
|
30106
30307
|
return st ? clone(st) : null;
|
|
@@ -32622,182 +32823,1007 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
32622
32823
|
return [[mast.u, mast.v, mast.y0], [mast.u, mast.v, mast.y1], ...arc];
|
|
32623
32824
|
}
|
|
32624
32825
|
|
|
32625
|
-
// ../game-items
|
|
32626
|
-
var
|
|
32627
|
-
|
|
32628
|
-
|
|
32629
|
-
|
|
32630
|
-
|
|
32631
|
-
|
|
32632
|
-
|
|
32633
|
-
|
|
32634
|
-
|
|
32635
|
-
|
|
32636
|
-
|
|
32637
|
-
|
|
32638
|
-
|
|
32639
|
-
|
|
32640
|
-
|
|
32641
|
-
|
|
32642
|
-
|
|
32643
|
-
|
|
32644
|
-
|
|
32645
|
-
|
|
32646
|
-
|
|
32647
|
-
|
|
32648
|
-
|
|
32649
|
-
|
|
32650
|
-
|
|
32651
|
-
|
|
32826
|
+
// ../game-items/dist/index.js
|
|
32827
|
+
var DEFAULT_RULES2 = {
|
|
32828
|
+
rarity: {
|
|
32829
|
+
weights: { common: 60, uncommon: 28, rare: 9, very_rare: 2.5, legendary: 0.5, unique: 0 },
|
|
32830
|
+
fixedOnly: ["legendary", "unique"]
|
|
32831
|
+
},
|
|
32832
|
+
freshness: { stale: 0.5, spoiled: 1, rotten: 1.5 },
|
|
32833
|
+
storage: {
|
|
32834
|
+
fridge: { multiplier: 0.33, needsPower: true },
|
|
32835
|
+
freezer: { multiplier: 0.1, needsPower: true },
|
|
32836
|
+
cooler: { multiplier: 0.5, limitDays: 2, afterLimit: 1 },
|
|
32837
|
+
delivery_bag: { multiplier: 0.8 },
|
|
32838
|
+
cellar: { multiplier: 0.66 },
|
|
32839
|
+
ambient: { multiplier: 1 },
|
|
32840
|
+
hot: { multiplier: 2 }
|
|
32841
|
+
},
|
|
32842
|
+
carry: { baseKg: 8, perStrengthKg: 2.5, factor: 1.2, encumbered: 1, overloaded: 1.5 },
|
|
32843
|
+
protection: { cap: 0.9, wear: { bite: 8, scratch: 3 }, tornShare: 0.25, repairMargin: 10 },
|
|
32844
|
+
aging: { thawShelfDays: { freezer: 2 } },
|
|
32845
|
+
inventory: {
|
|
32846
|
+
defaultSlots: 10,
|
|
32847
|
+
encumberedRunFactor: 0.75,
|
|
32848
|
+
defaultLitres: 12,
|
|
32849
|
+
defaultInside: [0.3, 0.25, 0.16],
|
|
32850
|
+
bagInside: {
|
|
32851
|
+
shopping_bag: [0.4, 0.35, 0.15],
|
|
32852
|
+
trash_bag: [0.6, 0.45, 0.12],
|
|
32853
|
+
fanny_pack: [0.22, 0.12, 0.1],
|
|
32854
|
+
crossbody_bag: [0.25, 0.2, 0.12],
|
|
32855
|
+
backpack: [0.5, 0.3, 0.2],
|
|
32856
|
+
delivery_bag: [0.45, 0.45, 0.25],
|
|
32857
|
+
hiking_backpack_40l: [0.6, 0.35, 0.19],
|
|
32858
|
+
military_backpack: [0.6, 0.35, 0.21],
|
|
32859
|
+
trekking_backpack_70l: [0.75, 0.38, 0.25],
|
|
32860
|
+
rolling_suitcase: [0.6, 0.4, 0.21],
|
|
32861
|
+
tactical_vest: [0.3, 0.2, 0.1],
|
|
32862
|
+
tool_belt: [0.4, 0.2, 0.1],
|
|
32863
|
+
cooler_box: [0.32, 0.25, 0.23],
|
|
32864
|
+
shopping_cart: [0.9, 0.55, 0.16],
|
|
32865
|
+
wheelbarrow: [1.2, 0.6, 0.15]
|
|
32866
|
+
},
|
|
32867
|
+
bagLitres: {
|
|
32868
|
+
shopping_bag: 20,
|
|
32869
|
+
trash_bag: 30,
|
|
32870
|
+
fanny_pack: 3,
|
|
32871
|
+
crossbody_bag: 6,
|
|
32872
|
+
backpack: 30,
|
|
32873
|
+
delivery_bag: 50,
|
|
32874
|
+
hiking_backpack_40l: 40,
|
|
32875
|
+
military_backpack: 45,
|
|
32876
|
+
trekking_backpack_70l: 70,
|
|
32877
|
+
rolling_suitcase: 50,
|
|
32878
|
+
tactical_vest: 6,
|
|
32879
|
+
tool_belt: 8,
|
|
32880
|
+
cooler_box: 18,
|
|
32881
|
+
shopping_cart: 80,
|
|
32882
|
+
wheelbarrow: 100
|
|
32883
|
+
}
|
|
32884
|
+
},
|
|
32885
|
+
use: {
|
|
32886
|
+
freshness: {
|
|
32887
|
+
stale: { satietyFactor: 0.7, poisonChance: 0.1, morale: 0, isEdible: true },
|
|
32888
|
+
spoiled: { satietyFactor: 0.7, poisonChance: 0.5, morale: -20, isEdible: true },
|
|
32889
|
+
rotten: { satietyFactor: 0, poisonChance: 0, morale: 0, isEdible: false }
|
|
32890
|
+
},
|
|
32891
|
+
cookedPoisonFactor: 0.25
|
|
32892
|
+
},
|
|
32893
|
+
spawn: {
|
|
32894
|
+
retailNew: true,
|
|
32895
|
+
retailPlaces: ["supermarket", "pharmacy", "mall", "gas_station", "gun_shop"],
|
|
32896
|
+
retailContainers: ["store_shelf", "stockroom"],
|
|
32897
|
+
condition: { common: [30, 90], uncommon: [40, 90], rare: [50, 100], very_rare: [50, 100], legendary: [50, 100], unique: [50, 100] },
|
|
32898
|
+
ageShare: [0, 0.6],
|
|
32899
|
+
charge: [0.2, 1],
|
|
32900
|
+
fillable: ["fuel_jerrycan"],
|
|
32901
|
+
fill: [0, 0.6]
|
|
32902
|
+
},
|
|
32903
|
+
finds: {
|
|
32904
|
+
fallbackContainer: "zombie_corpse",
|
|
32905
|
+
rollExcluded: ["ammo_7_62x39"],
|
|
32906
|
+
depletion: [
|
|
32907
|
+
{ places: ["pharmacy", "gun_shop", "police_station"], perDay: 0.05, floor: 0.3 },
|
|
32908
|
+
{ places: ["supermarket", "gas_station"], perDay: 0.04, floor: 0.35 },
|
|
32909
|
+
{ places: ["mall", "hospital"], perDay: 0.025, floor: 0.5 },
|
|
32910
|
+
{ places: ["house", "apartment"], perDay: 0.01, floor: 0.7 },
|
|
32911
|
+
{ places: ["farm", "warehouse", "mine", "dam", "lodge", "church"], perDay: 5e-3, floor: 0.85 },
|
|
32912
|
+
{ places: ["military_base"], perDay: 0, floor: 1 }
|
|
32913
|
+
],
|
|
32914
|
+
regionMultiplier: {},
|
|
32915
|
+
states: { normal: "normal", fortified: "fortified", abandoned: "abandoned" },
|
|
32916
|
+
pool: {
|
|
32917
|
+
defaultFootprint: 0.5,
|
|
32918
|
+
offset: 1.5,
|
|
32919
|
+
perSquareMetre: 3,
|
|
32920
|
+
jitter: 1.5,
|
|
32921
|
+
min: 2,
|
|
32922
|
+
max: 5,
|
|
32923
|
+
fortifiedExtra: 2,
|
|
32924
|
+
supplyWeight: 2.5,
|
|
32925
|
+
supplyExtraQty: 1,
|
|
32926
|
+
abandonedEmptyChance: 0.4,
|
|
32927
|
+
abandonedKept: 1,
|
|
32928
|
+
junkChance: 0.5,
|
|
32929
|
+
junkItem: "food_packaging",
|
|
32930
|
+
spoiledFoodItem: "leftover_meal",
|
|
32931
|
+
coldContainers: ["geladeira", "refrig_exp", "freezer"]
|
|
32932
|
+
}
|
|
32933
|
+
}
|
|
32934
|
+
};
|
|
32935
|
+
var FRESH_NUTRITION = { satietyFactor: 1, poisonChance: 0, morale: 0, isEdible: true };
|
|
32936
|
+
var nutritionOf = (item, context, rules) => {
|
|
32937
|
+
const state = context.freshness ?? "fresh";
|
|
32938
|
+
const effect = state === "fresh" ? FRESH_NUTRITION : rules.use.freshness[state];
|
|
32939
|
+
const poisonShare = context.isCooked ? rules.use.cookedPoisonFactor : 1;
|
|
32940
|
+
return {
|
|
32941
|
+
satiety: (item.nutrition?.satiety ?? 0) * effect.satietyFactor,
|
|
32942
|
+
hydration: item.nutrition?.hydration ?? 0,
|
|
32943
|
+
morale: effect.morale,
|
|
32944
|
+
poisonChance: effect.poisonChance * poisonShare,
|
|
32945
|
+
isEdible: effect.isEdible
|
|
32946
|
+
};
|
|
32947
|
+
};
|
|
32948
|
+
var findEffect = (item, effects) => effects.find((entry2) => entry2.items?.includes(item.id)) ?? effects.find((entry2) => entry2.category?.includes(item.category));
|
|
32949
|
+
var resolveUse = (item, effects, context = {}, rules = DEFAULT_RULES2) => {
|
|
32950
|
+
const def = findEffect(item, effects);
|
|
32951
|
+
if (!def) return void 0;
|
|
32952
|
+
const base = { useId: def.id, effect: def.effect, params: def.params ?? {}, consumes: def.consumes };
|
|
32953
|
+
if (def.effect !== "consume_nutrition") return base;
|
|
32954
|
+
const nutrition = nutritionOf(item, context, rules);
|
|
32955
|
+
const blocked = item.seal && context.seal ? sealBlock(item.seal, context.seal) : void 0;
|
|
32956
|
+
if (blocked) return { ...base, consumes: false, nutrition: { ...nutrition, isEdible: false }, blocked };
|
|
32957
|
+
return { ...base, consumes: def.consumes && nutrition.isEdible, nutrition };
|
|
32958
|
+
};
|
|
32959
|
+
var MM = 1e-3;
|
|
32960
|
+
var BOX_WALL = 6 * MM;
|
|
32961
|
+
|
|
32962
|
+
// ../game-fluids/dist/index.js
|
|
32963
|
+
var liquids_default = [
|
|
32652
32964
|
{
|
|
32653
|
-
id: "
|
|
32654
|
-
|
|
32965
|
+
id: "water",
|
|
32966
|
+
color: 11064558,
|
|
32967
|
+
opacity: 0.35,
|
|
32968
|
+
stainColor: 7309206,
|
|
32969
|
+
viscosity: 1,
|
|
32970
|
+
density: 1e3,
|
|
32971
|
+
dryTime: 180,
|
|
32972
|
+
gloss: 0.9,
|
|
32973
|
+
drink: {
|
|
32974
|
+
thirst: 100,
|
|
32975
|
+
effects: []
|
|
32976
|
+
},
|
|
32977
|
+
tags: [
|
|
32978
|
+
"drink",
|
|
32979
|
+
"clear"
|
|
32980
|
+
]
|
|
32655
32981
|
},
|
|
32656
32982
|
{
|
|
32657
|
-
id: "
|
|
32658
|
-
|
|
32983
|
+
id: "coffee",
|
|
32984
|
+
color: 3875604,
|
|
32985
|
+
opacity: 0.95,
|
|
32986
|
+
stainColor: 2824202,
|
|
32987
|
+
viscosity: 1.5,
|
|
32988
|
+
density: 1005,
|
|
32989
|
+
dryTime: 900,
|
|
32990
|
+
gloss: 0.8,
|
|
32991
|
+
leavesMark: true,
|
|
32992
|
+
steamC: 60,
|
|
32993
|
+
drink: {
|
|
32994
|
+
thirst: 80,
|
|
32995
|
+
effects: [
|
|
32996
|
+
"caffeine"
|
|
32997
|
+
]
|
|
32998
|
+
},
|
|
32999
|
+
tags: [
|
|
33000
|
+
"drink",
|
|
33001
|
+
"hot"
|
|
33002
|
+
]
|
|
32659
33003
|
},
|
|
32660
33004
|
{
|
|
32661
|
-
id: "
|
|
32662
|
-
|
|
33005
|
+
id: "tea",
|
|
33006
|
+
color: 9063188,
|
|
33007
|
+
opacity: 0.8,
|
|
33008
|
+
stainColor: 6961682,
|
|
33009
|
+
viscosity: 1.4,
|
|
33010
|
+
density: 1005,
|
|
33011
|
+
dryTime: 800,
|
|
33012
|
+
gloss: 0.8,
|
|
33013
|
+
leavesMark: true,
|
|
33014
|
+
steamC: 60,
|
|
33015
|
+
drink: {
|
|
33016
|
+
thirst: 90,
|
|
33017
|
+
effects: []
|
|
33018
|
+
},
|
|
33019
|
+
tags: [
|
|
33020
|
+
"drink",
|
|
33021
|
+
"hot"
|
|
33022
|
+
]
|
|
32663
33023
|
},
|
|
32664
33024
|
{
|
|
32665
|
-
id: "
|
|
32666
|
-
|
|
33025
|
+
id: "milk",
|
|
33026
|
+
color: 16052712,
|
|
33027
|
+
opacity: 0.98,
|
|
33028
|
+
stainColor: 14473160,
|
|
33029
|
+
viscosity: 2,
|
|
33030
|
+
density: 1030,
|
|
33031
|
+
dryTime: 900,
|
|
33032
|
+
gloss: 0.5,
|
|
33033
|
+
leavesMark: true,
|
|
33034
|
+
drink: {
|
|
33035
|
+
thirst: 70,
|
|
33036
|
+
effects: []
|
|
33037
|
+
},
|
|
33038
|
+
tags: [
|
|
33039
|
+
"drink"
|
|
33040
|
+
]
|
|
32667
33041
|
},
|
|
32668
33042
|
{
|
|
32669
|
-
id: "
|
|
32670
|
-
|
|
33043
|
+
id: "soda",
|
|
33044
|
+
color: 3808530,
|
|
33045
|
+
opacity: 0.85,
|
|
33046
|
+
stainColor: 2757901,
|
|
33047
|
+
viscosity: 1.3,
|
|
33048
|
+
density: 1040,
|
|
33049
|
+
dryTime: 1200,
|
|
33050
|
+
gloss: 0.85,
|
|
33051
|
+
leavesMark: true,
|
|
33052
|
+
drink: {
|
|
33053
|
+
thirst: 60,
|
|
33054
|
+
effects: []
|
|
33055
|
+
},
|
|
33056
|
+
tags: [
|
|
33057
|
+
"drink",
|
|
33058
|
+
"sticky"
|
|
33059
|
+
]
|
|
32671
33060
|
},
|
|
32672
33061
|
{
|
|
32673
|
-
id: "
|
|
32674
|
-
|
|
33062
|
+
id: "juice",
|
|
33063
|
+
color: 15239467,
|
|
33064
|
+
opacity: 0.9,
|
|
33065
|
+
stainColor: 12741916,
|
|
33066
|
+
viscosity: 2,
|
|
33067
|
+
density: 1045,
|
|
33068
|
+
dryTime: 1100,
|
|
33069
|
+
gloss: 0.8,
|
|
33070
|
+
leavesMark: true,
|
|
33071
|
+
drink: {
|
|
33072
|
+
thirst: 75,
|
|
33073
|
+
effects: []
|
|
33074
|
+
},
|
|
33075
|
+
tags: [
|
|
33076
|
+
"drink",
|
|
33077
|
+
"sticky"
|
|
33078
|
+
]
|
|
32675
33079
|
},
|
|
32676
33080
|
{
|
|
32677
|
-
id: "
|
|
32678
|
-
|
|
33081
|
+
id: "beer",
|
|
33082
|
+
color: 14259740,
|
|
33083
|
+
opacity: 0.8,
|
|
33084
|
+
stainColor: 11039764,
|
|
33085
|
+
viscosity: 1.4,
|
|
33086
|
+
density: 1010,
|
|
33087
|
+
dryTime: 900,
|
|
33088
|
+
gloss: 0.8,
|
|
33089
|
+
drink: {
|
|
33090
|
+
thirst: 50,
|
|
33091
|
+
effects: [
|
|
33092
|
+
"alcohol"
|
|
33093
|
+
]
|
|
33094
|
+
},
|
|
33095
|
+
tags: [
|
|
33096
|
+
"drink",
|
|
33097
|
+
"alcohol"
|
|
33098
|
+
]
|
|
32679
33099
|
},
|
|
32680
33100
|
{
|
|
32681
|
-
id: "
|
|
32682
|
-
|
|
33101
|
+
id: "wine",
|
|
33102
|
+
color: 7016223,
|
|
33103
|
+
opacity: 0.9,
|
|
33104
|
+
stainColor: 5048854,
|
|
33105
|
+
viscosity: 1.6,
|
|
33106
|
+
density: 990,
|
|
33107
|
+
dryTime: 800,
|
|
33108
|
+
gloss: 0.85,
|
|
33109
|
+
leavesMark: true,
|
|
33110
|
+
drink: {
|
|
33111
|
+
thirst: 40,
|
|
33112
|
+
effects: [
|
|
33113
|
+
"alcohol"
|
|
33114
|
+
]
|
|
33115
|
+
},
|
|
33116
|
+
tags: [
|
|
33117
|
+
"drink",
|
|
33118
|
+
"alcohol"
|
|
33119
|
+
]
|
|
32683
33120
|
},
|
|
32684
33121
|
{
|
|
32685
|
-
id: "
|
|
32686
|
-
|
|
33122
|
+
id: "spirits",
|
|
33123
|
+
color: 13214042,
|
|
33124
|
+
opacity: 0.6,
|
|
33125
|
+
stainColor: 10320959,
|
|
33126
|
+
viscosity: 1.8,
|
|
33127
|
+
density: 940,
|
|
33128
|
+
dryTime: 200,
|
|
33129
|
+
gloss: 0.85,
|
|
33130
|
+
flammable: true,
|
|
33131
|
+
drink: {
|
|
33132
|
+
thirst: 5,
|
|
33133
|
+
effects: [
|
|
33134
|
+
"alcohol"
|
|
33135
|
+
]
|
|
33136
|
+
},
|
|
33137
|
+
tags: [
|
|
33138
|
+
"drink",
|
|
33139
|
+
"alcohol"
|
|
33140
|
+
]
|
|
32687
33141
|
},
|
|
32688
33142
|
{
|
|
32689
33143
|
id: "fuel",
|
|
32690
|
-
|
|
32691
|
-
|
|
32692
|
-
|
|
32693
|
-
|
|
32694
|
-
|
|
33144
|
+
color: 14926682,
|
|
33145
|
+
opacity: 0.6,
|
|
33146
|
+
stainColor: 7232298,
|
|
33147
|
+
viscosity: 0.6,
|
|
33148
|
+
density: 740,
|
|
33149
|
+
dryTime: 60,
|
|
33150
|
+
gloss: 0.95,
|
|
33151
|
+
leavesMark: false,
|
|
33152
|
+
flammable: true,
|
|
33153
|
+
drink: {
|
|
33154
|
+
thirst: 0,
|
|
33155
|
+
effects: [
|
|
33156
|
+
"poison"
|
|
33157
|
+
]
|
|
33158
|
+
},
|
|
33159
|
+
tags: [
|
|
33160
|
+
"fuel",
|
|
33161
|
+
"gasoline"
|
|
33162
|
+
]
|
|
32695
33163
|
},
|
|
32696
33164
|
{
|
|
32697
|
-
id: "
|
|
32698
|
-
|
|
33165
|
+
id: "diesel",
|
|
33166
|
+
color: 12098094,
|
|
33167
|
+
opacity: 0.8,
|
|
33168
|
+
stainColor: 5917208,
|
|
33169
|
+
viscosity: 3,
|
|
33170
|
+
density: 830,
|
|
33171
|
+
dryTime: 3600,
|
|
33172
|
+
gloss: 0.95,
|
|
33173
|
+
leavesMark: true,
|
|
33174
|
+
flammable: true,
|
|
33175
|
+
drink: {
|
|
33176
|
+
thirst: 0,
|
|
33177
|
+
effects: [
|
|
33178
|
+
"poison"
|
|
33179
|
+
]
|
|
33180
|
+
},
|
|
33181
|
+
tags: [
|
|
33182
|
+
"fuel"
|
|
33183
|
+
]
|
|
32699
33184
|
},
|
|
32700
33185
|
{
|
|
32701
|
-
id: "
|
|
32702
|
-
|
|
33186
|
+
id: "motor_oil",
|
|
33187
|
+
color: 3877388,
|
|
33188
|
+
opacity: 0.95,
|
|
33189
|
+
stainColor: 1840134,
|
|
33190
|
+
viscosity: 100,
|
|
33191
|
+
density: 880,
|
|
33192
|
+
dryTime: 0,
|
|
33193
|
+
gloss: 1,
|
|
33194
|
+
leavesMark: true,
|
|
33195
|
+
flammable: true,
|
|
33196
|
+
drink: {
|
|
33197
|
+
thirst: 0,
|
|
33198
|
+
effects: [
|
|
33199
|
+
"poison"
|
|
33200
|
+
]
|
|
33201
|
+
},
|
|
33202
|
+
tags: [
|
|
33203
|
+
"oil"
|
|
33204
|
+
]
|
|
32703
33205
|
},
|
|
32704
33206
|
{
|
|
32705
|
-
id: "
|
|
32706
|
-
|
|
33207
|
+
id: "cooking_oil",
|
|
33208
|
+
color: 14267708,
|
|
33209
|
+
opacity: 0.85,
|
|
33210
|
+
stainColor: 11110698,
|
|
33211
|
+
viscosity: 60,
|
|
33212
|
+
density: 920,
|
|
33213
|
+
dryTime: 0,
|
|
33214
|
+
gloss: 1,
|
|
33215
|
+
leavesMark: true,
|
|
33216
|
+
flammable: true,
|
|
33217
|
+
drink: {
|
|
33218
|
+
thirst: 0,
|
|
33219
|
+
effects: [
|
|
33220
|
+
"poison"
|
|
33221
|
+
]
|
|
33222
|
+
},
|
|
33223
|
+
tags: [
|
|
33224
|
+
"oil",
|
|
33225
|
+
"food"
|
|
33226
|
+
]
|
|
32707
33227
|
},
|
|
32708
33228
|
{
|
|
32709
|
-
id: "
|
|
32710
|
-
|
|
33229
|
+
id: "blood",
|
|
33230
|
+
color: 7997964,
|
|
33231
|
+
opacity: 0.92,
|
|
33232
|
+
stainColor: 3874068,
|
|
33233
|
+
viscosity: 4,
|
|
33234
|
+
density: 1060,
|
|
33235
|
+
dryTime: 600,
|
|
33236
|
+
gloss: 0.75,
|
|
33237
|
+
leavesMark: true,
|
|
33238
|
+
drink: {
|
|
33239
|
+
thirst: 10,
|
|
33240
|
+
effects: [
|
|
33241
|
+
"disgust"
|
|
33242
|
+
]
|
|
33243
|
+
},
|
|
33244
|
+
tags: [
|
|
33245
|
+
"organic"
|
|
33246
|
+
]
|
|
32711
33247
|
},
|
|
32712
33248
|
{
|
|
32713
|
-
id: "
|
|
32714
|
-
|
|
33249
|
+
id: "old_blood",
|
|
33250
|
+
color: 7085078,
|
|
33251
|
+
opacity: 0.92,
|
|
33252
|
+
stainColor: 2758158,
|
|
33253
|
+
viscosity: 4,
|
|
33254
|
+
density: 1060,
|
|
33255
|
+
dryTime: 360,
|
|
33256
|
+
gloss: 0.7,
|
|
33257
|
+
leavesMark: true,
|
|
33258
|
+
drink: {
|
|
33259
|
+
thirst: 10,
|
|
33260
|
+
effects: [
|
|
33261
|
+
"disgust"
|
|
33262
|
+
]
|
|
33263
|
+
},
|
|
33264
|
+
tags: [
|
|
33265
|
+
"organic"
|
|
33266
|
+
]
|
|
32715
33267
|
},
|
|
32716
33268
|
{
|
|
32717
|
-
id: "
|
|
32718
|
-
|
|
32719
|
-
|
|
32720
|
-
|
|
32721
|
-
|
|
32722
|
-
|
|
32723
|
-
|
|
32724
|
-
|
|
32725
|
-
|
|
32726
|
-
|
|
32727
|
-
|
|
32728
|
-
|
|
32729
|
-
|
|
32730
|
-
|
|
32731
|
-
],
|
|
32732
|
-
count: [
|
|
32733
|
-
0,
|
|
32734
|
-
4
|
|
32735
|
-
],
|
|
32736
|
-
teamCount: [
|
|
32737
|
-
0,
|
|
32738
|
-
4
|
|
32739
|
-
],
|
|
32740
|
-
categories: {
|
|
32741
|
-
food: 0.55,
|
|
32742
|
-
drink: 0.45
|
|
33269
|
+
id: "bile",
|
|
33270
|
+
color: 9083434,
|
|
33271
|
+
opacity: 0.9,
|
|
33272
|
+
stainColor: 4080160,
|
|
33273
|
+
viscosity: 6,
|
|
33274
|
+
density: 1020,
|
|
33275
|
+
dryTime: 900,
|
|
33276
|
+
gloss: 0.75,
|
|
33277
|
+
leavesMark: true,
|
|
33278
|
+
drink: {
|
|
33279
|
+
thirst: 0,
|
|
33280
|
+
effects: [
|
|
33281
|
+
"disgust"
|
|
33282
|
+
]
|
|
32743
33283
|
},
|
|
32744
|
-
|
|
32745
|
-
|
|
33284
|
+
tags: [
|
|
33285
|
+
"organic"
|
|
33286
|
+
]
|
|
32746
33287
|
},
|
|
32747
33288
|
{
|
|
32748
|
-
id: "
|
|
32749
|
-
|
|
32750
|
-
|
|
32751
|
-
|
|
32752
|
-
|
|
32753
|
-
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
|
|
32757
|
-
|
|
32758
|
-
|
|
32759
|
-
|
|
32760
|
-
],
|
|
32761
|
-
teamCount: [
|
|
32762
|
-
1,
|
|
32763
|
-
4
|
|
32764
|
-
],
|
|
32765
|
-
categories: {
|
|
32766
|
-
food: 0.7,
|
|
32767
|
-
melee: 0.12,
|
|
32768
|
-
electronics: 0.1,
|
|
32769
|
-
tools: 0.08
|
|
33289
|
+
id: "sap",
|
|
33290
|
+
color: 13146940,
|
|
33291
|
+
opacity: 0.8,
|
|
33292
|
+
stainColor: 10122282,
|
|
33293
|
+
viscosity: 200,
|
|
33294
|
+
density: 1100,
|
|
33295
|
+
dryTime: 3600,
|
|
33296
|
+
gloss: 0.8,
|
|
33297
|
+
leavesMark: true,
|
|
33298
|
+
drink: {
|
|
33299
|
+
thirst: 20,
|
|
33300
|
+
effects: []
|
|
32770
33301
|
},
|
|
32771
|
-
|
|
33302
|
+
tags: [
|
|
33303
|
+
"organic",
|
|
33304
|
+
"sticky"
|
|
33305
|
+
]
|
|
32772
33306
|
},
|
|
32773
33307
|
{
|
|
32774
|
-
id: "
|
|
32775
|
-
|
|
32776
|
-
|
|
32777
|
-
|
|
32778
|
-
|
|
32779
|
-
|
|
32780
|
-
|
|
32781
|
-
|
|
32782
|
-
|
|
32783
|
-
|
|
32784
|
-
|
|
32785
|
-
|
|
32786
|
-
|
|
32787
|
-
|
|
32788
|
-
3
|
|
32789
|
-
],
|
|
32790
|
-
categories: {
|
|
32791
|
-
medical: 1
|
|
33308
|
+
id: "acid",
|
|
33309
|
+
color: 10146378,
|
|
33310
|
+
opacity: 0.6,
|
|
33311
|
+
stainColor: 7313970,
|
|
33312
|
+
viscosity: 1.5,
|
|
33313
|
+
density: 1200,
|
|
33314
|
+
dryTime: 900,
|
|
33315
|
+
gloss: 0.9,
|
|
33316
|
+
leavesMark: true,
|
|
33317
|
+
drink: {
|
|
33318
|
+
thirst: 0,
|
|
33319
|
+
effects: [
|
|
33320
|
+
"poison"
|
|
33321
|
+
]
|
|
32792
33322
|
},
|
|
32793
|
-
|
|
33323
|
+
tags: [
|
|
33324
|
+
"corrosive"
|
|
33325
|
+
]
|
|
32794
33326
|
},
|
|
32795
33327
|
{
|
|
32796
|
-
id: "
|
|
32797
|
-
|
|
32798
|
-
|
|
32799
|
-
|
|
32800
|
-
|
|
33328
|
+
id: "paint",
|
|
33329
|
+
color: 11740715,
|
|
33330
|
+
opacity: 0.98,
|
|
33331
|
+
stainColor: 9050655,
|
|
33332
|
+
viscosity: 300,
|
|
33333
|
+
density: 1300,
|
|
33334
|
+
dryTime: 1800,
|
|
33335
|
+
gloss: 0.6,
|
|
33336
|
+
leavesMark: true,
|
|
33337
|
+
drink: {
|
|
33338
|
+
thirst: 0,
|
|
33339
|
+
effects: [
|
|
33340
|
+
"poison"
|
|
33341
|
+
]
|
|
33342
|
+
},
|
|
33343
|
+
tags: [
|
|
33344
|
+
"paint"
|
|
33345
|
+
]
|
|
33346
|
+
},
|
|
33347
|
+
{
|
|
33348
|
+
id: "bleach",
|
|
33349
|
+
color: 15134688,
|
|
33350
|
+
opacity: 0.7,
|
|
33351
|
+
stainColor: 13621446,
|
|
33352
|
+
viscosity: 1.2,
|
|
33353
|
+
density: 1100,
|
|
33354
|
+
dryTime: 900,
|
|
33355
|
+
gloss: 0.85,
|
|
33356
|
+
leavesMark: true,
|
|
33357
|
+
drink: {
|
|
33358
|
+
thirst: 0,
|
|
33359
|
+
effects: [
|
|
33360
|
+
"poison"
|
|
33361
|
+
]
|
|
33362
|
+
},
|
|
33363
|
+
tags: [
|
|
33364
|
+
"corrosive"
|
|
33365
|
+
]
|
|
33366
|
+
},
|
|
33367
|
+
{
|
|
33368
|
+
id: "sewage",
|
|
33369
|
+
color: 5921582,
|
|
33370
|
+
opacity: 0.92,
|
|
33371
|
+
stainColor: 3093273,
|
|
33372
|
+
viscosity: 4,
|
|
33373
|
+
density: 1010,
|
|
33374
|
+
dryTime: 1800,
|
|
33375
|
+
gloss: 0.8,
|
|
33376
|
+
leavesMark: true,
|
|
33377
|
+
drink: {
|
|
33378
|
+
thirst: 0,
|
|
33379
|
+
effects: [
|
|
33380
|
+
"disgust",
|
|
33381
|
+
"poison"
|
|
33382
|
+
]
|
|
33383
|
+
},
|
|
33384
|
+
tags: [
|
|
33385
|
+
"organic",
|
|
33386
|
+
"waste"
|
|
33387
|
+
]
|
|
33388
|
+
},
|
|
33389
|
+
{
|
|
33390
|
+
id: "honey",
|
|
33391
|
+
color: 14193162,
|
|
33392
|
+
opacity: 0.9,
|
|
33393
|
+
stainColor: 12089350,
|
|
33394
|
+
viscosity: 3e3,
|
|
33395
|
+
density: 1420,
|
|
33396
|
+
dryTime: 14400,
|
|
33397
|
+
gloss: 0.95,
|
|
33398
|
+
leavesMark: true,
|
|
33399
|
+
drink: {
|
|
33400
|
+
thirst: 10,
|
|
33401
|
+
effects: []
|
|
33402
|
+
},
|
|
33403
|
+
tags: [
|
|
33404
|
+
"drink",
|
|
33405
|
+
"sticky"
|
|
33406
|
+
]
|
|
33407
|
+
},
|
|
33408
|
+
{
|
|
33409
|
+
id: "mud",
|
|
33410
|
+
color: 4008988,
|
|
33411
|
+
opacity: 0.95,
|
|
33412
|
+
stainColor: 3811866,
|
|
33413
|
+
viscosity: 40,
|
|
33414
|
+
density: 1600,
|
|
33415
|
+
dryTime: 900,
|
|
33416
|
+
gloss: 0.4,
|
|
33417
|
+
tags: [
|
|
33418
|
+
"dirty"
|
|
33419
|
+
]
|
|
33420
|
+
},
|
|
33421
|
+
{
|
|
33422
|
+
id: "coolant",
|
|
33423
|
+
color: 3455050,
|
|
33424
|
+
opacity: 0.7,
|
|
33425
|
+
stainColor: 2783796,
|
|
33426
|
+
viscosity: 4,
|
|
33427
|
+
density: 1070,
|
|
33428
|
+
dryTime: 1200,
|
|
33429
|
+
gloss: 0.85,
|
|
33430
|
+
leavesMark: true,
|
|
33431
|
+
drink: {
|
|
33432
|
+
thirst: 0,
|
|
33433
|
+
effects: [
|
|
33434
|
+
"poison"
|
|
33435
|
+
]
|
|
33436
|
+
},
|
|
33437
|
+
tags: [
|
|
33438
|
+
"coolant"
|
|
33439
|
+
]
|
|
33440
|
+
},
|
|
33441
|
+
{
|
|
33442
|
+
id: "brake_fluid",
|
|
33443
|
+
color: 13145646,
|
|
33444
|
+
opacity: 0.8,
|
|
33445
|
+
stainColor: 9069600,
|
|
33446
|
+
viscosity: 8,
|
|
33447
|
+
density: 1050,
|
|
33448
|
+
dryTime: 3600,
|
|
33449
|
+
gloss: 0.9,
|
|
33450
|
+
leavesMark: true,
|
|
33451
|
+
drink: {
|
|
33452
|
+
thirst: 0,
|
|
33453
|
+
effects: [
|
|
33454
|
+
"poison"
|
|
33455
|
+
]
|
|
33456
|
+
},
|
|
33457
|
+
tags: [
|
|
33458
|
+
"brake_fluid"
|
|
33459
|
+
]
|
|
33460
|
+
}
|
|
33461
|
+
];
|
|
33462
|
+
var LIQUIDS = liquids_default;
|
|
33463
|
+
var SAMPLES = 16;
|
|
33464
|
+
var COS = [];
|
|
33465
|
+
var SIN = [];
|
|
33466
|
+
for (let i = 0; i < SAMPLES; i++) {
|
|
33467
|
+
COS.push(Math.cos(i / SAMPLES * Math.PI * 2));
|
|
33468
|
+
SIN.push(Math.sin(i / SAMPLES * Math.PI * 2));
|
|
33469
|
+
}
|
|
33470
|
+
var RUNOFF_TILT = 6 * Math.PI / 180;
|
|
33471
|
+
var RUNOFF_TILT_MAX = 60 * Math.PI / 180;
|
|
33472
|
+
function hashCell(x, y) {
|
|
33473
|
+
let value = x * 374761393 + y * 668265263 | 0;
|
|
33474
|
+
value = (value ^ value >>> 13) * 1274126177 | 0;
|
|
33475
|
+
return ((value ^ value >>> 16) >>> 0) / 4294967296;
|
|
33476
|
+
}
|
|
33477
|
+
function valueNoise(x, y) {
|
|
33478
|
+
const xi = Math.floor(x);
|
|
33479
|
+
const yi = Math.floor(y);
|
|
33480
|
+
const xf = x - xi;
|
|
33481
|
+
const yf = y - yi;
|
|
33482
|
+
const u = xf * xf * (3 - 2 * xf);
|
|
33483
|
+
const v = yf * yf * (3 - 2 * yf);
|
|
33484
|
+
const a = hashCell(xi, yi);
|
|
33485
|
+
const b = hashCell(xi + 1, yi);
|
|
33486
|
+
const c = hashCell(xi, yi + 1);
|
|
33487
|
+
const d = hashCell(xi + 1, yi + 1);
|
|
33488
|
+
return a + (b - a) * u + (c - a) * v + (a - b - c + d) * u * v;
|
|
33489
|
+
}
|
|
33490
|
+
var REGION_NAMES = ["wall", "sidewalk", "curb", "road"];
|
|
33491
|
+
var dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
33492
|
+
function impactOf(region, position, velocity2, cellSize) {
|
|
33493
|
+
const local2 = [position[0] - region.origin[0], position[1] - region.origin[1], position[2] - region.origin[2]];
|
|
33494
|
+
return {
|
|
33495
|
+
row: region.firstRow + dot3(local2, region.rowAxis) / cellSize,
|
|
33496
|
+
column: dot3(local2, region.columnAxis) / cellSize,
|
|
33497
|
+
along: [dot3(velocity2, region.columnAxis), dot3(velocity2, region.rowAxis)],
|
|
33498
|
+
normalSpeed: -dot3(velocity2, region.normal)
|
|
33499
|
+
};
|
|
33500
|
+
}
|
|
33501
|
+
function cellToWorldOf(regions, cellSize, row, column) {
|
|
33502
|
+
let region = regions[regions.length - 1];
|
|
33503
|
+
for (const candidate of regions) {
|
|
33504
|
+
if (row < candidate.firstRow + candidate.rowCount) {
|
|
33505
|
+
region = candidate;
|
|
33506
|
+
break;
|
|
33507
|
+
}
|
|
33508
|
+
}
|
|
33509
|
+
const across2 = column * cellSize;
|
|
33510
|
+
const down2 = (row - region.firstRow) * cellSize;
|
|
33511
|
+
return [
|
|
33512
|
+
region.origin[0] + region.columnAxis[0] * across2 + region.rowAxis[0] * down2,
|
|
33513
|
+
region.origin[1] + region.columnAxis[1] * across2 + region.rowAxis[1] * down2,
|
|
33514
|
+
region.origin[2] + region.columnAxis[2] * across2 + region.rowAxis[2] * down2
|
|
33515
|
+
];
|
|
33516
|
+
}
|
|
33517
|
+
function createFoldedLayout(params) {
|
|
33518
|
+
const { columns, cellSize, originX, wallRows, sidewalkRows, curbRows, roadRows, wallTopY, sidewalkY, roadY, wallZ, rules } = params;
|
|
33519
|
+
const curbStep = params.curbStep ?? (sidewalkY - roadY) / curbRows;
|
|
33520
|
+
const height = wallRows + sidewalkRows + curbRows + roadRows;
|
|
33521
|
+
const cellCount = columns * height;
|
|
33522
|
+
const bed = new Float32Array(cellCount);
|
|
33523
|
+
const pin = new Float32Array(cellCount);
|
|
33524
|
+
const vertical = new Float32Array(cellCount);
|
|
33525
|
+
const sidewalkEnd = wallRows + sidewalkRows;
|
|
33526
|
+
const curbEnd = sidewalkEnd + curbRows;
|
|
33527
|
+
const regionOfRow = (row) => row < wallRows ? 0 : row < sidewalkEnd ? 1 : row < curbEnd ? 2 : 3;
|
|
33528
|
+
for (let row = 0; row < height; row++) {
|
|
33529
|
+
for (let column = 0; column < columns; column++) {
|
|
33530
|
+
const index = row * columns + column;
|
|
33531
|
+
const region = regionOfRow(row);
|
|
33532
|
+
const x = originX + (column + 0.5) * cellSize;
|
|
33533
|
+
let bedHeight;
|
|
33534
|
+
let roughness = 0.2;
|
|
33535
|
+
if (region === 0) {
|
|
33536
|
+
bedHeight = (wallTopY - (row + 0.5) * cellSize) * 1e3;
|
|
33537
|
+
roughness = 0.3;
|
|
33538
|
+
} else if (region === 1) {
|
|
33539
|
+
const z = (row - wallRows + 0.5) * cellSize;
|
|
33540
|
+
bedHeight = sidewalkY * 1e3 - z * 6;
|
|
33541
|
+
const jointX = Math.abs(((x - originX) % 0.5 + 0.5) % 0.5 - 0.25);
|
|
33542
|
+
const jointZ = Math.abs((z % 0.5 + 0.5) % 0.5 - 0.25);
|
|
33543
|
+
if (jointX > 0.25 - cellSize * 0.6 || jointZ > 0.25 - cellSize * 0.6) bedHeight -= 0.9;
|
|
33544
|
+
roughness = 0.18;
|
|
33545
|
+
} else if (region === 2) {
|
|
33546
|
+
bedHeight = sidewalkY * 1e3 - (row - sidewalkEnd + 0.5) * curbStep * 1e3;
|
|
33547
|
+
} else {
|
|
33548
|
+
const z = (row - curbEnd + 0.5) * cellSize;
|
|
33549
|
+
bedHeight = roadY * 1e3 + z * 14 - (x - params.roadSlopeAnchorX) * 5;
|
|
33550
|
+
roughness = 0.55;
|
|
33551
|
+
}
|
|
33552
|
+
const noise3 = valueNoise(column * 0.35, row * 0.35) * 0.6 + valueNoise(column * 1.3, row * 1.3) * 0.4;
|
|
33553
|
+
bed[index] = bedHeight + (noise3 - 0.5) * roughness * 2;
|
|
33554
|
+
vertical[index] = region === 0 || region === 2 ? 0.95 : 1;
|
|
33555
|
+
pin[index] = 0.62 + 0.76 * (valueNoise(column * 0.21 + 40, row * 0.21) * 0.5 + hashCell(column, row) * 0.5) * (region === 3 ? 1.25 : 1);
|
|
33556
|
+
}
|
|
33557
|
+
}
|
|
33558
|
+
const curbZ = wallZ + sidewalkRows * cellSize;
|
|
33559
|
+
const roadEndZ = curbZ + roadRows * cellSize;
|
|
33560
|
+
const right = [1, 0, 0];
|
|
33561
|
+
const regions = [
|
|
33562
|
+
{ id: REGION_NAMES[0], firstRow: 0, rowCount: wallRows, origin: [originX, wallTopY, wallZ], columnAxis: right, rowAxis: [0, -1, 0], normal: [0, 0, 1], isVertical: true },
|
|
33563
|
+
{ id: REGION_NAMES[1], firstRow: wallRows, rowCount: sidewalkRows, origin: [originX, sidewalkY, wallZ], columnAxis: right, rowAxis: [0, 0, 1], normal: [0, 1, 0], isVertical: false },
|
|
33564
|
+
{ id: REGION_NAMES[2], firstRow: sidewalkEnd, rowCount: curbRows, origin: [originX, sidewalkY, curbZ], columnAxis: right, rowAxis: [0, -1, 0], normal: [0, 0, 1], isVertical: true },
|
|
33565
|
+
{ id: REGION_NAMES[3], firstRow: curbEnd, rowCount: roadRows, origin: [originX, roadY, curbZ], columnAxis: right, rowAxis: [0, 0, 1], normal: [0, 1, 0], isVertical: false }
|
|
33566
|
+
];
|
|
33567
|
+
const maxX = originX + columns * cellSize;
|
|
33568
|
+
return {
|
|
33569
|
+
id: params.id,
|
|
33570
|
+
width: columns,
|
|
33571
|
+
height,
|
|
33572
|
+
cellSize,
|
|
33573
|
+
bed,
|
|
33574
|
+
pin,
|
|
33575
|
+
vertical,
|
|
33576
|
+
regions,
|
|
33577
|
+
rules,
|
|
33578
|
+
cellToWorld: (row, column) => cellToWorldOf(regions, cellSize, row, column),
|
|
33579
|
+
collide(previous, position) {
|
|
33580
|
+
if (position[2] <= wallZ && position[1] > sidewalkY) {
|
|
33581
|
+
position[2] = wallZ;
|
|
33582
|
+
return 0;
|
|
33583
|
+
}
|
|
33584
|
+
if (position[2] < curbZ && (!rules.guardBehindWall || position[2] >= wallZ) && position[1] <= sidewalkY) {
|
|
33585
|
+
position[1] = sidewalkY;
|
|
33586
|
+
return 1;
|
|
33587
|
+
}
|
|
33588
|
+
if (rules.curbCatch && position[2] >= curbZ && previous[2] < curbZ && position[1] < sidewalkY) {
|
|
33589
|
+
position[2] = curbZ;
|
|
33590
|
+
return 2;
|
|
33591
|
+
}
|
|
33592
|
+
if (position[2] >= curbZ && position[1] <= roadY) {
|
|
33593
|
+
position[1] = roadY;
|
|
33594
|
+
return 3;
|
|
33595
|
+
}
|
|
33596
|
+
return -1;
|
|
33597
|
+
},
|
|
33598
|
+
impact: (region, position, velocity2) => impactOf(regions[region], position, velocity2, cellSize),
|
|
33599
|
+
contains: (position) => position[0] > originX && position[0] < maxX && (!rules.clipRoadEnd || position[2] < roadEndZ),
|
|
33600
|
+
escaped(position) {
|
|
33601
|
+
if (position[1] < -1) return true;
|
|
33602
|
+
const box5 = rules.escapeBox;
|
|
33603
|
+
return box5 !== void 0 && (position[0] < box5.minX || position[0] > box5.maxX || position[2] > box5.maxZ);
|
|
33604
|
+
}
|
|
33605
|
+
};
|
|
33606
|
+
}
|
|
33607
|
+
var PADRAO_CELL = 0.0125;
|
|
33608
|
+
var PADRAO_WALL_Z = 0;
|
|
33609
|
+
var PADRAO_LAYOUT = createFoldedLayout({
|
|
33610
|
+
id: "padrao",
|
|
33611
|
+
columns: 256,
|
|
33612
|
+
cellSize: PADRAO_CELL,
|
|
33613
|
+
originX: -1.6,
|
|
33614
|
+
wallRows: 144,
|
|
33615
|
+
sidewalkRows: 128,
|
|
33616
|
+
curbRows: 12,
|
|
33617
|
+
roadRows: 112,
|
|
33618
|
+
wallTopY: 1.95,
|
|
33619
|
+
sidewalkY: 0.15,
|
|
33620
|
+
roadY: 0,
|
|
33621
|
+
wallZ: PADRAO_WALL_Z,
|
|
33622
|
+
curbStep: PADRAO_CELL,
|
|
33623
|
+
roadSlopeAnchorX: 0,
|
|
33624
|
+
rules: {
|
|
33625
|
+
dropCapacity: 600,
|
|
33626
|
+
curbCatch: true,
|
|
33627
|
+
guardBehindWall: true,
|
|
33628
|
+
clipRoadEnd: true,
|
|
33629
|
+
escapeBox: { minX: -3, maxX: 3, maxZ: PADRAO_WALL_Z + 128 * PADRAO_CELL + 112 * PADRAO_CELL + 1 },
|
|
33630
|
+
dripStyle: "padrao"
|
|
33631
|
+
}
|
|
33632
|
+
});
|
|
33633
|
+
var WORKSHOP_CELL = 0.0125;
|
|
33634
|
+
var WORKSHOP_LAYOUT = createFoldedLayout({
|
|
33635
|
+
id: "workshop",
|
|
33636
|
+
columns: 160,
|
|
33637
|
+
cellSize: WORKSHOP_CELL,
|
|
33638
|
+
originX: -2.2,
|
|
33639
|
+
wallRows: 160,
|
|
33640
|
+
sidewalkRows: 128,
|
|
33641
|
+
curbRows: 9,
|
|
33642
|
+
roadRows: 151,
|
|
33643
|
+
wallTopY: 2.12,
|
|
33644
|
+
sidewalkY: 0.1235,
|
|
33645
|
+
roadY: 9e-3,
|
|
33646
|
+
wallZ: -4.497,
|
|
33647
|
+
roadSlopeAnchorX: -1.2,
|
|
33648
|
+
rules: { dropCapacity: 400, curbCatch: false, guardBehindWall: false, clipRoadEnd: false, dripStyle: "workshop" }
|
|
33649
|
+
});
|
|
33650
|
+
|
|
33651
|
+
// ../game-items-goods/dist/index.js
|
|
33652
|
+
var FLOORPLAN_POOL_KEYS = {
|
|
33653
|
+
fridge: "geladeira",
|
|
33654
|
+
display_fridge: "refrig_exp",
|
|
33655
|
+
freezer: "freezer",
|
|
33656
|
+
kitchen_cabinet: "pia",
|
|
33657
|
+
overhead_cabinet: "aereo",
|
|
33658
|
+
washbasin: "pia_b",
|
|
33659
|
+
wardrobe: "guarda",
|
|
33660
|
+
wardrobe_large: "guarda",
|
|
33661
|
+
dresser: "comoda",
|
|
33662
|
+
console_table: "comoda",
|
|
33663
|
+
nightstand: "criado",
|
|
33664
|
+
filing_cabinet: "gaveteiro",
|
|
33665
|
+
pantry: "despensa",
|
|
33666
|
+
tv_unit: "rack",
|
|
33667
|
+
laundry_cabinet: "armario_lav",
|
|
33668
|
+
laundry_shelf: "estante_lav",
|
|
33669
|
+
workbench: "bancada",
|
|
33670
|
+
tool_shelf: "estante_ferr",
|
|
33671
|
+
mailbox: "correio",
|
|
33672
|
+
trash_bin: "lixeira",
|
|
33673
|
+
outdoor_bin: "lixeira",
|
|
33674
|
+
china_cabinet: "cristaleira"
|
|
33675
|
+
};
|
|
33676
|
+
var FLOORPLAN_POOL_ALIASES = FLOORPLAN_POOL_KEYS;
|
|
33677
|
+
var categories_default = [
|
|
33678
|
+
{
|
|
33679
|
+
id: "food",
|
|
33680
|
+
name: "Food"
|
|
33681
|
+
},
|
|
33682
|
+
{
|
|
33683
|
+
id: "drink",
|
|
33684
|
+
name: "Drink"
|
|
33685
|
+
},
|
|
33686
|
+
{
|
|
33687
|
+
id: "medical",
|
|
33688
|
+
name: "Medical"
|
|
33689
|
+
},
|
|
33690
|
+
{
|
|
33691
|
+
id: "tools",
|
|
33692
|
+
name: "Tools"
|
|
33693
|
+
},
|
|
33694
|
+
{
|
|
33695
|
+
id: "melee",
|
|
33696
|
+
name: "Melee"
|
|
33697
|
+
},
|
|
33698
|
+
{
|
|
33699
|
+
id: "materials",
|
|
33700
|
+
name: "Materials"
|
|
33701
|
+
},
|
|
33702
|
+
{
|
|
33703
|
+
id: "clothing",
|
|
33704
|
+
name: "Clothing"
|
|
33705
|
+
},
|
|
33706
|
+
{
|
|
33707
|
+
id: "bags",
|
|
33708
|
+
name: "Bags"
|
|
33709
|
+
},
|
|
33710
|
+
{
|
|
33711
|
+
id: "electronics",
|
|
33712
|
+
name: "Electronics"
|
|
33713
|
+
},
|
|
33714
|
+
{
|
|
33715
|
+
id: "fuel",
|
|
33716
|
+
name: "Fuel"
|
|
33717
|
+
},
|
|
33718
|
+
{
|
|
33719
|
+
id: "outdoors",
|
|
33720
|
+
name: "Outdoors"
|
|
33721
|
+
},
|
|
33722
|
+
{
|
|
33723
|
+
id: "books",
|
|
33724
|
+
name: "Books"
|
|
33725
|
+
},
|
|
33726
|
+
{
|
|
33727
|
+
id: "collectibles",
|
|
33728
|
+
name: "Collectibles"
|
|
33729
|
+
},
|
|
33730
|
+
{
|
|
33731
|
+
id: "keys",
|
|
33732
|
+
name: "Keys"
|
|
33733
|
+
},
|
|
33734
|
+
{
|
|
33735
|
+
id: "ammo",
|
|
33736
|
+
name: "Ammo"
|
|
33737
|
+
},
|
|
33738
|
+
{
|
|
33739
|
+
id: "firearms",
|
|
33740
|
+
name: "Firearms"
|
|
33741
|
+
},
|
|
33742
|
+
{
|
|
33743
|
+
id: "throwables",
|
|
33744
|
+
name: "Throwables"
|
|
33745
|
+
}
|
|
33746
|
+
];
|
|
33747
|
+
var containers_default = [
|
|
33748
|
+
{
|
|
33749
|
+
id: "fridge",
|
|
33750
|
+
teamName: "Geladeira",
|
|
33751
|
+
gameKey: "geladeira",
|
|
33752
|
+
places: [
|
|
33753
|
+
"house",
|
|
33754
|
+
"apartment",
|
|
33755
|
+
"supermarket",
|
|
33756
|
+
"gas_station"
|
|
33757
|
+
],
|
|
33758
|
+
count: [
|
|
33759
|
+
0,
|
|
33760
|
+
4
|
|
33761
|
+
],
|
|
33762
|
+
teamCount: [
|
|
33763
|
+
0,
|
|
33764
|
+
4
|
|
33765
|
+
],
|
|
33766
|
+
categories: {
|
|
33767
|
+
food: 0.55,
|
|
33768
|
+
drink: 0.45
|
|
33769
|
+
},
|
|
33770
|
+
teamCategories: "comida perec\xEDvel e bebida",
|
|
33771
|
+
rule: "Sem energia, o perec\xEDvel de dentro come\xE7a a contar como fora da geladeira."
|
|
33772
|
+
},
|
|
33773
|
+
{
|
|
33774
|
+
id: "kitchen_cabinet",
|
|
33775
|
+
teamName: "Arm\xE1rio de cozinha",
|
|
33776
|
+
gameKey: "cozinha",
|
|
33777
|
+
places: [
|
|
33778
|
+
"house",
|
|
33779
|
+
"apartment",
|
|
33780
|
+
"church",
|
|
33781
|
+
"school"
|
|
33782
|
+
],
|
|
33783
|
+
count: [
|
|
33784
|
+
1,
|
|
33785
|
+
4
|
|
33786
|
+
],
|
|
33787
|
+
teamCount: [
|
|
33788
|
+
1,
|
|
33789
|
+
4
|
|
33790
|
+
],
|
|
33791
|
+
categories: {
|
|
33792
|
+
food: 0.7,
|
|
33793
|
+
melee: 0.12,
|
|
33794
|
+
electronics: 0.1,
|
|
33795
|
+
tools: 0.08
|
|
33796
|
+
},
|
|
33797
|
+
teamCategories: "comida seca e enlatada, panela, abridor, isqueiro"
|
|
33798
|
+
},
|
|
33799
|
+
{
|
|
33800
|
+
id: "bathroom_cabinet",
|
|
33801
|
+
teamName: "Arm\xE1rio do banheiro",
|
|
33802
|
+
gameKey: "banheiro",
|
|
33803
|
+
places: [
|
|
33804
|
+
"house",
|
|
33805
|
+
"apartment",
|
|
33806
|
+
"school"
|
|
33807
|
+
],
|
|
33808
|
+
count: [
|
|
33809
|
+
0,
|
|
33810
|
+
3
|
|
33811
|
+
],
|
|
33812
|
+
teamCount: [
|
|
33813
|
+
0,
|
|
33814
|
+
3
|
|
33815
|
+
],
|
|
33816
|
+
categories: {
|
|
33817
|
+
medical: 1
|
|
33818
|
+
},
|
|
33819
|
+
teamCategories: "analg\xE9sico, curativo, \xE1lcool, rem\xE9dio de uso cont\xEDnuo"
|
|
33820
|
+
},
|
|
33821
|
+
{
|
|
33822
|
+
id: "wardrobe",
|
|
33823
|
+
teamName: "Guarda-roupa",
|
|
33824
|
+
gameKey: "guarda",
|
|
33825
|
+
places: [
|
|
33826
|
+
"house",
|
|
32801
33827
|
"apartment"
|
|
32802
33828
|
],
|
|
32803
33829
|
count: [
|
|
@@ -46238,6 +47264,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
46238
47264
|
impact: {
|
|
46239
47265
|
response: "dent",
|
|
46240
47266
|
pushImpulse: true
|
|
47267
|
+
},
|
|
47268
|
+
use: {
|
|
47269
|
+
clip: "use_hygiene",
|
|
47270
|
+
sounds: [
|
|
47271
|
+
"scrub"
|
|
47272
|
+
]
|
|
46241
47273
|
}
|
|
46242
47274
|
}
|
|
46243
47275
|
}
|
|
@@ -49825,6 +50857,22 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
49825
50857
|
items: [
|
|
49826
50858
|
"alcohol_70",
|
|
49827
50859
|
"povidone_iodine"
|
|
50860
|
+
],
|
|
50861
|
+
params: {
|
|
50862
|
+
clip: "apply_dressing"
|
|
50863
|
+
}
|
|
50864
|
+
},
|
|
50865
|
+
{
|
|
50866
|
+
id: "wash",
|
|
50867
|
+
effect: "wash",
|
|
50868
|
+
consumes: false,
|
|
50869
|
+
items: [
|
|
50870
|
+
"soap",
|
|
50871
|
+
"shampoo",
|
|
50872
|
+
"toothpaste",
|
|
50873
|
+
"toothbrush",
|
|
50874
|
+
"deodorant",
|
|
50875
|
+
"towel"
|
|
49828
50876
|
]
|
|
49829
50877
|
},
|
|
49830
50878
|
{
|
|
@@ -51147,6 +52195,29 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51147
52195
|
"kind.hygiene.description": "Sabonete, pasta de dente, papel higi\xEAnico e toalha."
|
|
51148
52196
|
};
|
|
51149
52197
|
var GOODS_STRINGS = { en: en_default2, "pt-BR": pt_BR_default2 };
|
|
52198
|
+
var drinkHydrationOf = (item, liquids = LIQUIDS) => {
|
|
52199
|
+
const fluid = item.fluid;
|
|
52200
|
+
const drink = fluid ? liquids.find((liquid) => liquid.id === fluid.liquid)?.drink : void 0;
|
|
52201
|
+
if (!fluid || !drink) return void 0;
|
|
52202
|
+
const doses = item.durability?.kind === "doses" ? Math.max(1, item.durability.amount ?? 1) : 1;
|
|
52203
|
+
return drink.thirst * fluid.liters / doses;
|
|
52204
|
+
};
|
|
52205
|
+
var createGoodsItemUse = (options = {}) => {
|
|
52206
|
+
const kinds = options.kinds ?? createGoodsKinds();
|
|
52207
|
+
const effects = options.effects ?? GOODS_USE_EFFECTS;
|
|
52208
|
+
const liquids = options.liquids ?? LIQUIDS;
|
|
52209
|
+
return (item) => {
|
|
52210
|
+
if (item.kind === void 0 || !kinds.has(item.kind)) return void 0;
|
|
52211
|
+
const result2 = resolveUse(item, effects);
|
|
52212
|
+
const { clip: effectClip, ...params } = result2?.params ?? {};
|
|
52213
|
+
const clip = typeof effectClip === "string" ? effectClip : resolveEntry(kinds, item).use?.clip;
|
|
52214
|
+
if (clip === void 0) return void 0;
|
|
52215
|
+
if (!result2) return { clip, consumes: false };
|
|
52216
|
+
const nutrition = result2.nutrition ? { satiety: result2.nutrition.satiety, hydration: drinkHydrationOf(item, liquids) ?? result2.nutrition.hydration } : {};
|
|
52217
|
+
return { clip, consumes: result2.consumes, effect: { id: result2.effect, ...Object.keys(params).length > 0 ? { params } : {}, ...nutrition } };
|
|
52218
|
+
};
|
|
52219
|
+
};
|
|
52220
|
+
var goodsItemUse = createGoodsItemUse();
|
|
51150
52221
|
|
|
51151
52222
|
// ../game-interactables-household/dist/index.js
|
|
51152
52223
|
var door = (material, joint2 = "hinge", piece2 = "door") => ({ material, joint: joint2, piece: piece2 });
|
|
@@ -51158,6 +52229,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51158
52229
|
var fridgeLike = { body: { material: "steel", joint: "weld" }, parts: [[/^door/, door("steel")]] };
|
|
51159
52230
|
var bin = { body: { material: "plastic", joint: "fused" }, parts: [["lid", door("plastic", "hinge", "lid")]] };
|
|
51160
52231
|
var upholstery = { material: "fabric", joint: "glue" };
|
|
52232
|
+
var POLE_CAGE = { material: "steel", spacing: 0.1, diameter: 0.01 };
|
|
51161
52233
|
var DESTRUCTION = {
|
|
51162
52234
|
fridge: fridgeLike,
|
|
51163
52235
|
fridge_compact: fridgeLike,
|
|
@@ -51183,7 +52255,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51183
52255
|
},
|
|
51184
52256
|
wall_socket: { body: { material: "plastic", joint: "screw" }, parts: [] },
|
|
51185
52257
|
wall_switch: { body: { material: "plastic", joint: "screw" }, parts: [["rocker", { material: "plastic", joint: "clip", piece: "rocker" }]] },
|
|
51186
|
-
|
|
52258
|
+
// 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
|
|
52259
|
+
service_entrance: { body: { material: "concrete", joint: "rebar", reinforcement: POLE_CAGE }, parts: [["meter_door", door("steel")]] },
|
|
51187
52260
|
conduit_run: { body: { material: "plastic", joint: "clip" }, parts: [] },
|
|
51188
52261
|
service_mast: { body: { material: "steel", joint: "clip" }, parts: [] },
|
|
51189
52262
|
electrical_panel: {
|
|
@@ -51847,7 +52920,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51847
52920
|
h: 0.7,
|
|
51848
52921
|
y: 1.4,
|
|
51849
52922
|
solid: true,
|
|
51850
|
-
massKg: 15
|
|
52923
|
+
massKg: 15,
|
|
52924
|
+
fixed: true
|
|
51851
52925
|
},
|
|
51852
52926
|
{
|
|
51853
52927
|
id: "pantry",
|
|
@@ -51932,7 +53006,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51932
53006
|
h: 1.2,
|
|
51933
53007
|
y: 0,
|
|
51934
53008
|
solid: true,
|
|
51935
|
-
massKg: 40
|
|
53009
|
+
massKg: 40,
|
|
53010
|
+
fixed: true
|
|
51936
53011
|
},
|
|
51937
53012
|
{
|
|
51938
53013
|
id: "sink_bathroom",
|
|
@@ -51942,7 +53017,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51942
53017
|
h: 1.05,
|
|
51943
53018
|
y: 0,
|
|
51944
53019
|
solid: true,
|
|
51945
|
-
massKg: 25
|
|
53020
|
+
massKg: 25,
|
|
53021
|
+
fixed: true
|
|
51946
53022
|
},
|
|
51947
53023
|
{
|
|
51948
53024
|
id: "shower",
|
|
@@ -51952,7 +53028,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51952
53028
|
h: 2.1,
|
|
51953
53029
|
y: 0,
|
|
51954
53030
|
solid: true,
|
|
51955
|
-
massKg: 90
|
|
53031
|
+
massKg: 90,
|
|
53032
|
+
fixed: true
|
|
51956
53033
|
},
|
|
51957
53034
|
{
|
|
51958
53035
|
id: "toilet",
|
|
@@ -51962,7 +53039,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51962
53039
|
h: 0.8,
|
|
51963
53040
|
y: 0,
|
|
51964
53041
|
solid: true,
|
|
51965
|
-
massKg: 30
|
|
53042
|
+
massKg: 30,
|
|
53043
|
+
fixed: true
|
|
51966
53044
|
},
|
|
51967
53045
|
{
|
|
51968
53046
|
id: "utility_sink",
|
|
@@ -51972,7 +53050,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
51972
53050
|
h: 1.2,
|
|
51973
53051
|
y: 0,
|
|
51974
53052
|
solid: true,
|
|
51975
|
-
massKg: 25
|
|
53053
|
+
massKg: 25,
|
|
53054
|
+
fixed: true
|
|
51976
53055
|
},
|
|
51977
53056
|
{
|
|
51978
53057
|
id: "wall_socket",
|
|
@@ -52002,7 +53081,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
52002
53081
|
h: 6.5,
|
|
52003
53082
|
y: 0,
|
|
52004
53083
|
solid: true,
|
|
52005
|
-
massKg:
|
|
53084
|
+
massKg: 320,
|
|
53085
|
+
fixed: true
|
|
52006
53086
|
},
|
|
52007
53087
|
{
|
|
52008
53088
|
id: "service_mast",
|
|
@@ -54954,7 +56034,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
54954
56034
|
}
|
|
54955
56035
|
var residentialTower = residentialTowerTemplate();
|
|
54956
56036
|
|
|
54957
|
-
// ../game-floorplan-three/dist/chunk-
|
|
56037
|
+
// ../game-floorplan-three/dist/chunk-Z3IBCX7E.js
|
|
54958
56038
|
var __defProp4 = Object.defineProperty;
|
|
54959
56039
|
var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp4(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
54960
56040
|
var __publicField2 = (obj, key2, value) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
@@ -62665,8 +63745,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
62665
63745
|
return drawer2 ? "drawer" : /^wardrobe/.test(type) ? "wardrobe" : /fridge|refrig|freezer/.test(type) ? "fridge" : /pantry/.test(type) ? "pantry" : "cabinet";
|
|
62666
63746
|
}
|
|
62667
63747
|
function recordApi(api) {
|
|
62668
|
-
const calls = [], pr = { light: (
|
|
62669
|
-
for (const n of ["box", "cylinder", "leaf", "plane"]) pr[n] = (
|
|
63748
|
+
const calls = [], pr = { light: (MM2, ...a) => api.light(MM2, ...a) };
|
|
63749
|
+
for (const n of ["box", "cylinder", "leaf", "plane"]) pr[n] = (MM2, ...a) => {
|
|
62670
63750
|
calls.push([n, a]);
|
|
62671
63751
|
};
|
|
62672
63752
|
return { pr, calls };
|
|
@@ -67403,8 +68483,51 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67403
68483
|
installBuildBuild(K, shared3);
|
|
67404
68484
|
return buildApi(K, shared3);
|
|
67405
68485
|
}
|
|
68486
|
+
var STRUCTURE_SKIN = {
|
|
68487
|
+
wood_hard: 0.018,
|
|
68488
|
+
wood_soft: 0.018,
|
|
68489
|
+
plywood: 0.015,
|
|
68490
|
+
mdf: 0.018,
|
|
68491
|
+
plastic: 4e-3,
|
|
68492
|
+
rubber: 5e-3,
|
|
68493
|
+
steel: 12e-4,
|
|
68494
|
+
aluminium: 2e-3,
|
|
68495
|
+
cast_iron: 6e-3,
|
|
68496
|
+
copper: 1e-3,
|
|
68497
|
+
glass: 5e-3,
|
|
68498
|
+
tempered_glass: 6e-3,
|
|
68499
|
+
ceramic: 8e-3
|
|
68500
|
+
};
|
|
68501
|
+
var FOAM_DENSITY = 30;
|
|
68502
|
+
var FABRIC_DENSITY = 400;
|
|
68503
|
+
var UPHOLSTERY_COVER = 3e-3;
|
|
68504
|
+
var shellFraction = (shape, skin) => {
|
|
68505
|
+
if (shape.kind === "box") {
|
|
68506
|
+
const [a, b, c] = shape.size;
|
|
68507
|
+
const inner = Math.max(0, a - 2 * skin) * Math.max(0, b - 2 * skin) * Math.max(0, c - 2 * skin);
|
|
68508
|
+
return 1 - inner / (a * b * c);
|
|
68509
|
+
}
|
|
68510
|
+
if (shape.kind === "cylinder") {
|
|
68511
|
+
const { radius: r, height: h } = shape;
|
|
68512
|
+
const inner = Math.max(0, r - skin) ** 2 * Math.max(0, h - 2 * skin);
|
|
68513
|
+
return 1 - inner / (r * r * h);
|
|
68514
|
+
}
|
|
68515
|
+
return 1 - (Math.max(0, shape.radius - skin) / shape.radius) ** 3;
|
|
68516
|
+
};
|
|
68517
|
+
var thinnest = (shape) => shape.kind === "box" ? Math.min(...shape.size) : shape.kind === "cylinder" ? Math.min(shape.radius * 2, shape.height) : shape.radius * 2;
|
|
68518
|
+
function structureFill(material, shape) {
|
|
68519
|
+
if (material === "fabric") {
|
|
68520
|
+
if (thinnest(shape) <= 4 * UPHOLSTERY_COVER) return 1;
|
|
68521
|
+
const cover = shellFraction(shape, UPHOLSTERY_COVER);
|
|
68522
|
+
return cover + (1 - cover) * (FOAM_DENSITY / FABRIC_DENSITY);
|
|
68523
|
+
}
|
|
68524
|
+
const skin = STRUCTURE_SKIN[material];
|
|
68525
|
+
if (skin === void 0 || thinnest(shape) <= 3 * skin) return 1;
|
|
68526
|
+
return shellFraction(shape, skin);
|
|
68527
|
+
}
|
|
67406
68528
|
var HOLD_REACH2 = 0.05;
|
|
67407
68529
|
var BACK_TOUCH = 0.02;
|
|
68530
|
+
var AGAINST_WALL = 0.1;
|
|
67408
68531
|
var SOFT = /* @__PURE__ */ new Set(["fabric", "paper", "foliage"]);
|
|
67409
68532
|
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])));
|
|
67410
68533
|
function groupsOf(parts2, joints) {
|
|
@@ -67423,11 +68546,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67423
68546
|
}
|
|
67424
68547
|
return [...groups.values()];
|
|
67425
68548
|
}
|
|
67426
|
-
function nearestJoint(loose, held,
|
|
68549
|
+
function nearestJoint(loose, held, boxOf4, reach2) {
|
|
67427
68550
|
let best = null;
|
|
67428
68551
|
for (const a of loose) {
|
|
67429
68552
|
for (const b of held) {
|
|
67430
|
-
const gap = gapOf(
|
|
68553
|
+
const gap = gapOf(boxOf4(a.id), boxOf4(b.id));
|
|
67431
68554
|
if (gap <= reach2 && (!best || gap < best.gap)) best = { gap, a, b };
|
|
67432
68555
|
}
|
|
67433
68556
|
}
|
|
@@ -67437,21 +68560,22 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67437
68560
|
}
|
|
67438
68561
|
var FLOOR_TOUCH = 5e-3;
|
|
67439
68562
|
var STANDS_ALONE = 0.3;
|
|
67440
|
-
function standsAlone(group,
|
|
67441
|
-
const feet = group.map((part) =>
|
|
68563
|
+
function standsAlone(group, boxOf4) {
|
|
68564
|
+
const feet = group.map((part) => boxOf4(part.id)).filter((box5) => box5.min[1] <= FLOOR_TOUCH);
|
|
67442
68565
|
if (feet.length === 0) return false;
|
|
67443
|
-
const height = Math.max(...group.map((part) =>
|
|
68566
|
+
const height = Math.max(...group.map((part) => boxOf4(part.id).max[1]));
|
|
67444
68567
|
const across2 = (k) => Math.max(...feet.map((box5) => box5.max[k])) - Math.min(...feet.map((box5) => box5.min[k]));
|
|
67445
68568
|
return Math.min(across2(0), across2(2)) >= STANDS_ALONE * height;
|
|
67446
68569
|
}
|
|
67447
|
-
function joinBodies({ parts: parts2, joints, boxOf:
|
|
68570
|
+
function joinBodies({ parts: parts2, joints, boxOf: boxOf4 }, byId) {
|
|
67448
68571
|
const groups = groupsOf(parts2, joints).map((ids) => ids.map((id) => byId.get(id))).sort((a, b) => b.length - a.length);
|
|
67449
68572
|
const [main, ...rest2] = groups;
|
|
67450
68573
|
if (!main) return;
|
|
68574
|
+
const mainHeld = main.some((part) => part.anchored);
|
|
67451
68575
|
for (const group of rest2) {
|
|
67452
|
-
if (standsAlone(group,
|
|
67453
|
-
const joint2 = nearestJoint(group, main,
|
|
67454
|
-
if (joint2) joints.push(joint2);
|
|
68576
|
+
if (standsAlone(group, boxOf4)) continue;
|
|
68577
|
+
const joint2 = nearestJoint(group, main, boxOf4, Infinity);
|
|
68578
|
+
if (joint2) joints.push(mainHeld && group.some((part) => part.anchored) ? { ...joint2, tears: true } : joint2);
|
|
67455
68579
|
}
|
|
67456
68580
|
}
|
|
67457
68581
|
function holdLooseGroups(params) {
|
|
@@ -67459,8 +68583,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67459
68583
|
holdHanging(params, byId);
|
|
67460
68584
|
joinBodies(params, byId);
|
|
67461
68585
|
}
|
|
67462
|
-
function holdHanging({ parts: parts2, joints, boxOf:
|
|
67463
|
-
const back = Math.min(...parts2.map((part) =>
|
|
68586
|
+
function holdHanging({ parts: parts2, joints, boxOf: boxOf4 }, byId) {
|
|
68587
|
+
const back = Math.min(...parts2.map((part) => boxOf4(part.id).min[2]));
|
|
67464
68588
|
for (let pass = 0; pass < parts2.length; pass++) {
|
|
67465
68589
|
const groups = groupsOf(parts2, joints).map((ids) => ids.map((id) => byId.get(id)));
|
|
67466
68590
|
const held = groups.filter((group) => group.some((part) => part.anchored)).flat();
|
|
@@ -67468,20 +68592,21 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67468
68592
|
if (loose.length === 0) return;
|
|
67469
68593
|
let changed = false;
|
|
67470
68594
|
for (const group of loose) {
|
|
67471
|
-
const joint2 = nearestJoint(group, held,
|
|
68595
|
+
const joint2 = nearestJoint(group, held, boxOf4, HOLD_REACH2);
|
|
67472
68596
|
if (joint2) {
|
|
67473
68597
|
joints.push(joint2);
|
|
67474
68598
|
changed = true;
|
|
67475
68599
|
continue;
|
|
67476
68600
|
}
|
|
67477
|
-
const
|
|
68601
|
+
const againstWall = held.length === 0 || held.some((part) => boxOf4(part.id).min[2] <= back + AGAINST_WALL);
|
|
68602
|
+
const onWall = againstWall ? group.filter((part) => !SOFT.has(part.material) && boxOf4(part.id).min[2] <= back + BACK_TOUCH) : [];
|
|
67478
68603
|
if (onWall.length === 0) continue;
|
|
67479
68604
|
for (const part of onWall) part.anchored = true;
|
|
67480
68605
|
changed = true;
|
|
67481
68606
|
}
|
|
67482
68607
|
if (changed) continue;
|
|
67483
68608
|
for (const group of loose) {
|
|
67484
|
-
const joint2 = nearestJoint(group, held,
|
|
68609
|
+
const joint2 = nearestJoint(group, held, boxOf4, Infinity);
|
|
67485
68610
|
if (joint2) joints.push(joint2);
|
|
67486
68611
|
}
|
|
67487
68612
|
return;
|
|
@@ -67514,7 +68639,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67514
68639
|
if (carcassed) return tops;
|
|
67515
68640
|
for (let i = drawn.length - 1; i >= 0; i--) {
|
|
67516
68641
|
const p = drawn[i];
|
|
67517
|
-
if (p.key !== "wood" || materialOf2.wood !== "wood_hard" || p.shape.kind !== "box" || p.rotation) continue;
|
|
68642
|
+
if (p.material || p.key !== "wood" || materialOf2.wood !== "wood_hard" || p.shape.kind !== "box" || p.rotation) continue;
|
|
67518
68643
|
const [sx, sy, sz] = p.shape.size;
|
|
67519
68644
|
const across2 = sx < sz ? 0 : 2;
|
|
67520
68645
|
const width = Math.min(sx, sz);
|
|
@@ -67537,14 +68662,106 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67537
68662
|
}
|
|
67538
68663
|
return tops;
|
|
67539
68664
|
}
|
|
67540
|
-
|
|
67541
|
-
|
|
68665
|
+
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)$/;
|
|
68666
|
+
var DRAWER_CASES = /^(dresser|nightstand|console_table|vanity_table)$/;
|
|
68667
|
+
var CASE_BODY_MIN = 0.2;
|
|
68668
|
+
var FRONT_THICK = 0.03;
|
|
68669
|
+
var FRONT_REACH = 0.03;
|
|
68670
|
+
var CASE_BOARD = 0.018;
|
|
68671
|
+
var CASE_BACK = 6e-3;
|
|
68672
|
+
var DRAWER_SIDE = 0.012;
|
|
68673
|
+
var DRAWER_BOTTOM = 6e-3;
|
|
68674
|
+
var SHELF_PITCH = 0.45;
|
|
68675
|
+
var WARDROBES = /wardrobe/;
|
|
68676
|
+
var HANGING_SHELF_DROP = 0.35;
|
|
68677
|
+
function board(body, suffix, material, min2, max2, color2 = body.color) {
|
|
68678
|
+
const size = [max2[0] - min2[0], max2[1] - min2[1], max2[2] - min2[2]];
|
|
68679
|
+
const position = [(min2[0] + max2[0]) / 2, (min2[1] + max2[1]) / 2, (min2[2] + max2[2]) / 2];
|
|
68680
|
+
return { id: `${body.id}_${suffix}`, key: body.key, material, shape: { kind: "box", size }, position, rotation: null, color: color2, min: min2, max: max2 };
|
|
68681
|
+
}
|
|
68682
|
+
function hollowCases(drawn, type) {
|
|
68683
|
+
const made2 = /* @__PURE__ */ new Set();
|
|
68684
|
+
if (!CASES.test(type)) return made2;
|
|
68685
|
+
const drawers = DRAWER_CASES.test(type);
|
|
68686
|
+
for (let i = drawn.length - 1; i >= 0; i--) {
|
|
68687
|
+
const body = drawn[i];
|
|
68688
|
+
if (body.key !== "wood" && body.key !== "plain" || body.shape.kind !== "box" || body.rotation) continue;
|
|
68689
|
+
const [sx, sy, sz] = body.shape.size;
|
|
68690
|
+
if (Math.min(sx, sy, sz) < CASE_BODY_MIN) continue;
|
|
68691
|
+
const fronts = drawn.filter((p) => {
|
|
68692
|
+
if (p === body || p.shape.kind !== "box" || p.rotation || p.key !== "wood" && p.key !== "plain") return false;
|
|
68693
|
+
const thick = p.max[2] - p.min[2];
|
|
68694
|
+
if (thick > FRONT_THICK || thick >= p.max[0] - p.min[0] || thick >= p.max[1] - p.min[1]) return false;
|
|
68695
|
+
const cx = (p.min[0] + p.max[0]) / 2;
|
|
68696
|
+
const cy = (p.min[1] + p.max[1]) / 2;
|
|
68697
|
+
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];
|
|
68698
|
+
});
|
|
68699
|
+
if (fronts.length === 0) continue;
|
|
68700
|
+
const [x0, y0, z0] = body.min;
|
|
68701
|
+
const [x1, y1, z1] = body.max;
|
|
68702
|
+
const T2 = CASE_BOARD;
|
|
68703
|
+
const zi = z0 + CASE_BACK;
|
|
68704
|
+
const inner = 0.92;
|
|
68705
|
+
const tone = (k) => {
|
|
68706
|
+
const c = (s) => Math.min(255, Math.round((body.color >> s & 255) * k)) << s;
|
|
68707
|
+
return c(16) | c(8) | c(0);
|
|
68708
|
+
};
|
|
68709
|
+
const boards = [
|
|
68710
|
+
board(body, "back", "plywood", [x0, y0, z0], [x1, y1, zi], tone(0.8)),
|
|
68711
|
+
board(body, "side_l", "mdf", [x0, y0, zi], [x0 + T2, y1, z1]),
|
|
68712
|
+
board(body, "side_r", "mdf", [x1 - T2, y0, zi], [x1, y1, z1]),
|
|
68713
|
+
board(body, "top", "mdf", [x0 + T2, y1 - T2, zi], [x1 - T2, y1, z1]),
|
|
68714
|
+
board(body, "bottom", "mdf", [x0 + T2, y0, zi], [x1 - T2, y0 + T2, z1], tone(inner))
|
|
68715
|
+
];
|
|
68716
|
+
const ix0 = x0 + T2;
|
|
68717
|
+
const ix1 = x1 - T2;
|
|
68718
|
+
const iy0 = y0 + T2;
|
|
68719
|
+
const iy1 = y1 - T2;
|
|
68720
|
+
if (drawers) {
|
|
68721
|
+
const stack = [...fronts].sort((a, b) => a.min[1] - b.min[1]);
|
|
68722
|
+
stack.forEach((front, k) => {
|
|
68723
|
+
const dy0 = Math.max(front.min[1] + 0.01, iy0 + 2e-3);
|
|
68724
|
+
const dy1 = Math.min(front.max[1] - 0.02, iy1 - 2e-3);
|
|
68725
|
+
const dz0 = zi + 0.01;
|
|
68726
|
+
const dz1 = front.min[2];
|
|
68727
|
+
if (dy1 - dy0 < 0.04 || dz1 - dz0 < 0.1) return;
|
|
68728
|
+
const a = ix0 + 2e-3;
|
|
68729
|
+
const b = ix1 - 2e-3;
|
|
68730
|
+
boards.push(
|
|
68731
|
+
board(body, `drawer${k}_side_l`, "mdf", [a, dy0, dz0], [a + DRAWER_SIDE, dy1, dz1], tone(inner)),
|
|
68732
|
+
board(body, `drawer${k}_side_r`, "mdf", [b - DRAWER_SIDE, dy0, dz0], [b, dy1, dz1], tone(inner)),
|
|
68733
|
+
board(body, `drawer${k}_back`, "mdf", [a + DRAWER_SIDE, dy0, dz0], [b - DRAWER_SIDE, dy1, dz0 + DRAWER_SIDE], tone(inner)),
|
|
68734
|
+
board(body, `drawer${k}_bottom`, "mdf", [a + DRAWER_SIDE, dy0, dz0 + DRAWER_SIDE], [b - DRAWER_SIDE, dy0 + DRAWER_BOTTOM, dz1], tone(inner))
|
|
68735
|
+
);
|
|
68736
|
+
const above2 = stack[k + 1];
|
|
68737
|
+
if (!above2) return;
|
|
68738
|
+
const mid = (front.max[1] + above2.min[1]) / 2;
|
|
68739
|
+
if (above2.min[1] - front.max[1] < T2 || mid - T2 / 2 < dy1 || mid + T2 / 2 > iy1) return;
|
|
68740
|
+
boards.push(board(body, `rail${k}`, "mdf", [ix0, mid - T2 / 2, zi], [ix1, mid + T2 / 2, z1], tone(inner)));
|
|
68741
|
+
});
|
|
68742
|
+
} else {
|
|
68743
|
+
const height = iy1 - iy0;
|
|
68744
|
+
const count = Math.max(0, Math.round(height / SHELF_PITCH) - 1);
|
|
68745
|
+
const levels = WARDROBES.test(type) ? [iy1 - HANGING_SHELF_DROP] : Array.from({ length: count }, (_, k) => iy0 + (k + 1) * height / (count + 1));
|
|
68746
|
+
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))));
|
|
68747
|
+
}
|
|
68748
|
+
for (const front of fronts) front.material = "mdf";
|
|
68749
|
+
drawn.splice(i, 1, ...boards);
|
|
68750
|
+
for (const b of boards) made2.add(b.id);
|
|
68751
|
+
}
|
|
68752
|
+
return made2;
|
|
68753
|
+
}
|
|
68754
|
+
function shadeBoard(color2, board2) {
|
|
68755
|
+
const k = [1, 0.94, 1.05, 0.97, 1.03][board2 % 5];
|
|
67542
68756
|
const channel = (shift) => Math.min(255, Math.round((color2 >> shift & 255) * k)) << shift;
|
|
67543
68757
|
return channel(16) | channel(8) | channel(0);
|
|
67544
68758
|
}
|
|
67545
68759
|
var FLOOR_TOUCH2 = 5e-3;
|
|
67546
68760
|
var LOOSE = /* @__PURE__ */ new Set(["paper"]);
|
|
67547
|
-
var PLANTED = /* @__PURE__ */ new Set(["mailbox", "correio", "clothesline", "tree_small", "bbq_simple"]);
|
|
68761
|
+
var PLANTED = /* @__PURE__ */ new Set(["mailbox", "correio", "clothesline", "tree_small", "fruit_tree", "bbq_simple"]);
|
|
68762
|
+
var INSTALLED = /* @__PURE__ */ new Set(["toilet", "washbasin", "pedestal_basin", "shower", "shower_large", "laundry_tub"]);
|
|
68763
|
+
var WEIGHTED_FOOT = /* @__PURE__ */ new Set(["floor_lamp"]);
|
|
68764
|
+
var FOOT_MATERIAL = "cast_iron";
|
|
67548
68765
|
var BASE_MATERIAL = {
|
|
67549
68766
|
wood: "wood_hard",
|
|
67550
68767
|
metal: "steel",
|
|
@@ -67620,13 +68837,18 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67620
68837
|
};
|
|
67621
68838
|
run(A);
|
|
67622
68839
|
if (!drawn.length) throw new Error(`game-floorplan-three: the builder of "${name}" drew no box or cylinder`);
|
|
68840
|
+
hollowCases(drawn, name);
|
|
67623
68841
|
const boardsOf = splitTopsIntoBoards(drawn, materialOf2, Boolean(opts.carcass));
|
|
67624
68842
|
const parts2 = drawn.map((p) => {
|
|
67625
68843
|
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]);
|
|
67626
|
-
let material = materialOf2[p.key] ?? "plastic";
|
|
67627
|
-
if (p.
|
|
68844
|
+
let material = p.material ?? materialOf2[p.key] ?? "plastic";
|
|
68845
|
+
if (p.material) {
|
|
68846
|
+
} else if (p.key === "wood" && material === "wood_hard" && opts.carcass && !opts.materials?.wood) material = "mdf";
|
|
67628
68847
|
else if (p.key === "wood" && material === "wood_hard" && thin < WOOD_THIN) material = "wood_soft";
|
|
68848
|
+
if (WEIGHTED_FOOT.has(name) && p.key === "metal" && p.min[1] <= FLOOR_TOUCH2) material = FOOT_MATERIAL;
|
|
67629
68849
|
const part = { id: p.id, material, shape: p.shape, position: p.position };
|
|
68850
|
+
const fill22 = structureFill(material, p.shape);
|
|
68851
|
+
if (fill22 < 1) part.fill = Math.round(fill22 * 1e4) / 1e4;
|
|
67630
68852
|
if (p.rotation) part.rotation = p.rotation;
|
|
67631
68853
|
if (!LOOSE.has(material) && p.min[1] <= FLOOR_TOUCH2) part.anchored = true;
|
|
67632
68854
|
if (opts.carcass && LOOSE.has(material)) {
|
|
@@ -67656,7 +68878,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67656
68878
|
const wallMounted = parts2.some((part) => part.anchored && low(part) > FLOOR_TOUCH2);
|
|
67657
68879
|
const sunk = parts2.some((part) => low(part) < -FLOOR_TOUCH2);
|
|
67658
68880
|
const rooted = parts2.some((part) => part.material === "foliage") && parts2.some((part) => part.material.startsWith("wood") && low(part) <= FLOOR_TOUCH2);
|
|
67659
|
-
const fixed2 = wallMounted || sunk || rooted || PLANTED.has(name);
|
|
68881
|
+
const fixed2 = wallMounted || sunk || rooted || PLANTED.has(name) || INSTALLED.has(name);
|
|
67660
68882
|
const all = drawn.reduce(
|
|
67661
68883
|
(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]) }),
|
|
67662
68884
|
{ x0: Infinity, x1: -Infinity, z0: Infinity, z1: -Infinity }
|
|
@@ -81600,8 +82822,45 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
81600
82822
|
{ at: 1, ...HOLD }
|
|
81601
82823
|
]
|
|
81602
82824
|
};
|
|
81603
|
-
var
|
|
81604
|
-
|
|
82825
|
+
var KNIFE_SLASH = {
|
|
82826
|
+
keys: [
|
|
82827
|
+
{ at: 0, ...HOLD },
|
|
82828
|
+
{ at: 0.3, offset: [0.06, 0.3, 0.04], turn: [0.35, 0, -0.5] },
|
|
82829
|
+
{ at: 0.43, offset: [-0.1, 0.2, -0.2], turn: [-0.6, 0, 0.5] },
|
|
82830
|
+
{ at: 0.62, offset: [-0.24, 0.04, -0.12], turn: [-1, 0, 0.9] },
|
|
82831
|
+
{ at: 1, ...HOLD }
|
|
82832
|
+
]
|
|
82833
|
+
};
|
|
82834
|
+
var KNIFE_STAB = {
|
|
82835
|
+
keys: [
|
|
82836
|
+
{ at: 0, ...HOLD },
|
|
82837
|
+
{ at: 0.28, offset: [0.02, 0.06, 0.08], turn: [0.15, 0, 0] },
|
|
82838
|
+
{ at: 0.43, offset: [-0.04, 0.12, -0.22], turn: [-0.5, 0, 0] },
|
|
82839
|
+
{ at: 0.6, offset: [-0.04, 0.11, -0.2], turn: [-0.45, 0, 0] },
|
|
82840
|
+
{ at: 1, ...HOLD }
|
|
82841
|
+
]
|
|
82842
|
+
};
|
|
82843
|
+
var ONE_HAND_CHOP = {
|
|
82844
|
+
keys: [
|
|
82845
|
+
{ at: 0, ...HOLD },
|
|
82846
|
+
{ at: 0.3, offset: [0.04, 0.4, 0.04], turn: [0.5, 0, -0.2] },
|
|
82847
|
+
{ at: 0.43, offset: [-0.03, 0.18, -0.22], turn: [-0.6, 0, 0.1] },
|
|
82848
|
+
{ at: 0.62, offset: [-0.05, -0.03, -0.18], turn: [-1.1, 0, 0.2] },
|
|
82849
|
+
{ at: 1, ...HOLD }
|
|
82850
|
+
]
|
|
82851
|
+
};
|
|
82852
|
+
var FAMILY_MOTIONS = /* @__PURE__ */ new Map([
|
|
82853
|
+
["short_blade", /* @__PURE__ */ new Map([["slash", KNIFE_SLASH], ["stab", KNIFE_STAB]])],
|
|
82854
|
+
["one_hand_swing", /* @__PURE__ */ new Map([["chop", ONE_HAND_CHOP]])],
|
|
82855
|
+
// a bat, a pipe or an axe swung with both hands goes as the shovel's swing
|
|
82856
|
+
["two_hand_swing", /* @__PURE__ */ new Map([["swing", SHOVEL_SWING]])]
|
|
82857
|
+
]);
|
|
82858
|
+
var TOOL_MOTIONS = new Map([
|
|
82859
|
+
["shovel", /* @__PURE__ */ new Map([["dig", SHOVEL_DIG], ["fill", SHOVEL_FILL], ["swing", SHOVEL_SWING]])],
|
|
82860
|
+
...MELEE_FAMILIES.flatMap((family) => {
|
|
82861
|
+
const motions = FAMILY_MOTIONS.get(family.id);
|
|
82862
|
+
return motions ? family.weapons.map((weapon2) => [weapon2, motions]) : [];
|
|
82863
|
+
})
|
|
81605
82864
|
]);
|
|
81606
82865
|
var ease2 = (s) => s * s * (3 - 2 * s);
|
|
81607
82866
|
function sampleToolMotion(motion, at4) {
|
|
@@ -81684,696 +82943,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
81684
82943
|
return group;
|
|
81685
82944
|
}
|
|
81686
82945
|
|
|
81687
|
-
// ../game-
|
|
81688
|
-
var liquids_default = [
|
|
81689
|
-
{
|
|
81690
|
-
id: "water",
|
|
81691
|
-
color: 11064558,
|
|
81692
|
-
opacity: 0.35,
|
|
81693
|
-
stainColor: 7309206,
|
|
81694
|
-
viscosity: 1,
|
|
81695
|
-
density: 1e3,
|
|
81696
|
-
dryTime: 180,
|
|
81697
|
-
gloss: 0.9,
|
|
81698
|
-
drink: {
|
|
81699
|
-
thirst: 100,
|
|
81700
|
-
effects: []
|
|
81701
|
-
},
|
|
81702
|
-
tags: [
|
|
81703
|
-
"drink",
|
|
81704
|
-
"clear"
|
|
81705
|
-
]
|
|
81706
|
-
},
|
|
81707
|
-
{
|
|
81708
|
-
id: "coffee",
|
|
81709
|
-
color: 3875604,
|
|
81710
|
-
opacity: 0.95,
|
|
81711
|
-
stainColor: 2824202,
|
|
81712
|
-
viscosity: 1.5,
|
|
81713
|
-
density: 1005,
|
|
81714
|
-
dryTime: 900,
|
|
81715
|
-
gloss: 0.8,
|
|
81716
|
-
leavesMark: true,
|
|
81717
|
-
steamC: 60,
|
|
81718
|
-
drink: {
|
|
81719
|
-
thirst: 80,
|
|
81720
|
-
effects: [
|
|
81721
|
-
"caffeine"
|
|
81722
|
-
]
|
|
81723
|
-
},
|
|
81724
|
-
tags: [
|
|
81725
|
-
"drink",
|
|
81726
|
-
"hot"
|
|
81727
|
-
]
|
|
81728
|
-
},
|
|
81729
|
-
{
|
|
81730
|
-
id: "tea",
|
|
81731
|
-
color: 9063188,
|
|
81732
|
-
opacity: 0.8,
|
|
81733
|
-
stainColor: 6961682,
|
|
81734
|
-
viscosity: 1.4,
|
|
81735
|
-
density: 1005,
|
|
81736
|
-
dryTime: 800,
|
|
81737
|
-
gloss: 0.8,
|
|
81738
|
-
leavesMark: true,
|
|
81739
|
-
steamC: 60,
|
|
81740
|
-
drink: {
|
|
81741
|
-
thirst: 90,
|
|
81742
|
-
effects: []
|
|
81743
|
-
},
|
|
81744
|
-
tags: [
|
|
81745
|
-
"drink",
|
|
81746
|
-
"hot"
|
|
81747
|
-
]
|
|
81748
|
-
},
|
|
81749
|
-
{
|
|
81750
|
-
id: "milk",
|
|
81751
|
-
color: 16052712,
|
|
81752
|
-
opacity: 0.98,
|
|
81753
|
-
stainColor: 14473160,
|
|
81754
|
-
viscosity: 2,
|
|
81755
|
-
density: 1030,
|
|
81756
|
-
dryTime: 900,
|
|
81757
|
-
gloss: 0.5,
|
|
81758
|
-
leavesMark: true,
|
|
81759
|
-
drink: {
|
|
81760
|
-
thirst: 70,
|
|
81761
|
-
effects: []
|
|
81762
|
-
},
|
|
81763
|
-
tags: [
|
|
81764
|
-
"drink"
|
|
81765
|
-
]
|
|
81766
|
-
},
|
|
81767
|
-
{
|
|
81768
|
-
id: "soda",
|
|
81769
|
-
color: 3808530,
|
|
81770
|
-
opacity: 0.85,
|
|
81771
|
-
stainColor: 2757901,
|
|
81772
|
-
viscosity: 1.3,
|
|
81773
|
-
density: 1040,
|
|
81774
|
-
dryTime: 1200,
|
|
81775
|
-
gloss: 0.85,
|
|
81776
|
-
leavesMark: true,
|
|
81777
|
-
drink: {
|
|
81778
|
-
thirst: 60,
|
|
81779
|
-
effects: []
|
|
81780
|
-
},
|
|
81781
|
-
tags: [
|
|
81782
|
-
"drink",
|
|
81783
|
-
"sticky"
|
|
81784
|
-
]
|
|
81785
|
-
},
|
|
81786
|
-
{
|
|
81787
|
-
id: "juice",
|
|
81788
|
-
color: 15239467,
|
|
81789
|
-
opacity: 0.9,
|
|
81790
|
-
stainColor: 12741916,
|
|
81791
|
-
viscosity: 2,
|
|
81792
|
-
density: 1045,
|
|
81793
|
-
dryTime: 1100,
|
|
81794
|
-
gloss: 0.8,
|
|
81795
|
-
leavesMark: true,
|
|
81796
|
-
drink: {
|
|
81797
|
-
thirst: 75,
|
|
81798
|
-
effects: []
|
|
81799
|
-
},
|
|
81800
|
-
tags: [
|
|
81801
|
-
"drink",
|
|
81802
|
-
"sticky"
|
|
81803
|
-
]
|
|
81804
|
-
},
|
|
81805
|
-
{
|
|
81806
|
-
id: "beer",
|
|
81807
|
-
color: 14259740,
|
|
81808
|
-
opacity: 0.8,
|
|
81809
|
-
stainColor: 11039764,
|
|
81810
|
-
viscosity: 1.4,
|
|
81811
|
-
density: 1010,
|
|
81812
|
-
dryTime: 900,
|
|
81813
|
-
gloss: 0.8,
|
|
81814
|
-
drink: {
|
|
81815
|
-
thirst: 50,
|
|
81816
|
-
effects: [
|
|
81817
|
-
"alcohol"
|
|
81818
|
-
]
|
|
81819
|
-
},
|
|
81820
|
-
tags: [
|
|
81821
|
-
"drink",
|
|
81822
|
-
"alcohol"
|
|
81823
|
-
]
|
|
81824
|
-
},
|
|
81825
|
-
{
|
|
81826
|
-
id: "wine",
|
|
81827
|
-
color: 7016223,
|
|
81828
|
-
opacity: 0.9,
|
|
81829
|
-
stainColor: 5048854,
|
|
81830
|
-
viscosity: 1.6,
|
|
81831
|
-
density: 990,
|
|
81832
|
-
dryTime: 800,
|
|
81833
|
-
gloss: 0.85,
|
|
81834
|
-
leavesMark: true,
|
|
81835
|
-
drink: {
|
|
81836
|
-
thirst: 40,
|
|
81837
|
-
effects: [
|
|
81838
|
-
"alcohol"
|
|
81839
|
-
]
|
|
81840
|
-
},
|
|
81841
|
-
tags: [
|
|
81842
|
-
"drink",
|
|
81843
|
-
"alcohol"
|
|
81844
|
-
]
|
|
81845
|
-
},
|
|
81846
|
-
{
|
|
81847
|
-
id: "spirits",
|
|
81848
|
-
color: 13214042,
|
|
81849
|
-
opacity: 0.6,
|
|
81850
|
-
stainColor: 10320959,
|
|
81851
|
-
viscosity: 1.8,
|
|
81852
|
-
density: 940,
|
|
81853
|
-
dryTime: 200,
|
|
81854
|
-
gloss: 0.85,
|
|
81855
|
-
flammable: true,
|
|
81856
|
-
drink: {
|
|
81857
|
-
thirst: 5,
|
|
81858
|
-
effects: [
|
|
81859
|
-
"alcohol"
|
|
81860
|
-
]
|
|
81861
|
-
},
|
|
81862
|
-
tags: [
|
|
81863
|
-
"drink",
|
|
81864
|
-
"alcohol"
|
|
81865
|
-
]
|
|
81866
|
-
},
|
|
81867
|
-
{
|
|
81868
|
-
id: "fuel",
|
|
81869
|
-
color: 14926682,
|
|
81870
|
-
opacity: 0.6,
|
|
81871
|
-
stainColor: 7232298,
|
|
81872
|
-
viscosity: 0.6,
|
|
81873
|
-
density: 740,
|
|
81874
|
-
dryTime: 60,
|
|
81875
|
-
gloss: 0.95,
|
|
81876
|
-
leavesMark: false,
|
|
81877
|
-
flammable: true,
|
|
81878
|
-
drink: {
|
|
81879
|
-
thirst: 0,
|
|
81880
|
-
effects: [
|
|
81881
|
-
"poison"
|
|
81882
|
-
]
|
|
81883
|
-
},
|
|
81884
|
-
tags: [
|
|
81885
|
-
"fuel",
|
|
81886
|
-
"gasoline"
|
|
81887
|
-
]
|
|
81888
|
-
},
|
|
81889
|
-
{
|
|
81890
|
-
id: "diesel",
|
|
81891
|
-
color: 12098094,
|
|
81892
|
-
opacity: 0.8,
|
|
81893
|
-
stainColor: 5917208,
|
|
81894
|
-
viscosity: 3,
|
|
81895
|
-
density: 830,
|
|
81896
|
-
dryTime: 3600,
|
|
81897
|
-
gloss: 0.95,
|
|
81898
|
-
leavesMark: true,
|
|
81899
|
-
flammable: true,
|
|
81900
|
-
drink: {
|
|
81901
|
-
thirst: 0,
|
|
81902
|
-
effects: [
|
|
81903
|
-
"poison"
|
|
81904
|
-
]
|
|
81905
|
-
},
|
|
81906
|
-
tags: [
|
|
81907
|
-
"fuel"
|
|
81908
|
-
]
|
|
81909
|
-
},
|
|
81910
|
-
{
|
|
81911
|
-
id: "motor_oil",
|
|
81912
|
-
color: 3877388,
|
|
81913
|
-
opacity: 0.95,
|
|
81914
|
-
stainColor: 1840134,
|
|
81915
|
-
viscosity: 100,
|
|
81916
|
-
density: 880,
|
|
81917
|
-
dryTime: 0,
|
|
81918
|
-
gloss: 1,
|
|
81919
|
-
leavesMark: true,
|
|
81920
|
-
flammable: true,
|
|
81921
|
-
drink: {
|
|
81922
|
-
thirst: 0,
|
|
81923
|
-
effects: [
|
|
81924
|
-
"poison"
|
|
81925
|
-
]
|
|
81926
|
-
},
|
|
81927
|
-
tags: [
|
|
81928
|
-
"oil"
|
|
81929
|
-
]
|
|
81930
|
-
},
|
|
81931
|
-
{
|
|
81932
|
-
id: "cooking_oil",
|
|
81933
|
-
color: 14267708,
|
|
81934
|
-
opacity: 0.85,
|
|
81935
|
-
stainColor: 11110698,
|
|
81936
|
-
viscosity: 60,
|
|
81937
|
-
density: 920,
|
|
81938
|
-
dryTime: 0,
|
|
81939
|
-
gloss: 1,
|
|
81940
|
-
leavesMark: true,
|
|
81941
|
-
flammable: true,
|
|
81942
|
-
drink: {
|
|
81943
|
-
thirst: 0,
|
|
81944
|
-
effects: [
|
|
81945
|
-
"poison"
|
|
81946
|
-
]
|
|
81947
|
-
},
|
|
81948
|
-
tags: [
|
|
81949
|
-
"oil",
|
|
81950
|
-
"food"
|
|
81951
|
-
]
|
|
81952
|
-
},
|
|
81953
|
-
{
|
|
81954
|
-
id: "blood",
|
|
81955
|
-
color: 7997964,
|
|
81956
|
-
opacity: 0.92,
|
|
81957
|
-
stainColor: 3874068,
|
|
81958
|
-
viscosity: 4,
|
|
81959
|
-
density: 1060,
|
|
81960
|
-
dryTime: 600,
|
|
81961
|
-
gloss: 0.75,
|
|
81962
|
-
leavesMark: true,
|
|
81963
|
-
drink: {
|
|
81964
|
-
thirst: 10,
|
|
81965
|
-
effects: [
|
|
81966
|
-
"disgust"
|
|
81967
|
-
]
|
|
81968
|
-
},
|
|
81969
|
-
tags: [
|
|
81970
|
-
"organic"
|
|
81971
|
-
]
|
|
81972
|
-
},
|
|
81973
|
-
{
|
|
81974
|
-
id: "old_blood",
|
|
81975
|
-
color: 7085078,
|
|
81976
|
-
opacity: 0.92,
|
|
81977
|
-
stainColor: 2758158,
|
|
81978
|
-
viscosity: 4,
|
|
81979
|
-
density: 1060,
|
|
81980
|
-
dryTime: 360,
|
|
81981
|
-
gloss: 0.7,
|
|
81982
|
-
leavesMark: true,
|
|
81983
|
-
drink: {
|
|
81984
|
-
thirst: 10,
|
|
81985
|
-
effects: [
|
|
81986
|
-
"disgust"
|
|
81987
|
-
]
|
|
81988
|
-
},
|
|
81989
|
-
tags: [
|
|
81990
|
-
"organic"
|
|
81991
|
-
]
|
|
81992
|
-
},
|
|
81993
|
-
{
|
|
81994
|
-
id: "bile",
|
|
81995
|
-
color: 9083434,
|
|
81996
|
-
opacity: 0.9,
|
|
81997
|
-
stainColor: 4080160,
|
|
81998
|
-
viscosity: 6,
|
|
81999
|
-
density: 1020,
|
|
82000
|
-
dryTime: 900,
|
|
82001
|
-
gloss: 0.75,
|
|
82002
|
-
leavesMark: true,
|
|
82003
|
-
drink: {
|
|
82004
|
-
thirst: 0,
|
|
82005
|
-
effects: [
|
|
82006
|
-
"disgust"
|
|
82007
|
-
]
|
|
82008
|
-
},
|
|
82009
|
-
tags: [
|
|
82010
|
-
"organic"
|
|
82011
|
-
]
|
|
82012
|
-
},
|
|
82013
|
-
{
|
|
82014
|
-
id: "sap",
|
|
82015
|
-
color: 13146940,
|
|
82016
|
-
opacity: 0.8,
|
|
82017
|
-
stainColor: 10122282,
|
|
82018
|
-
viscosity: 200,
|
|
82019
|
-
density: 1100,
|
|
82020
|
-
dryTime: 3600,
|
|
82021
|
-
gloss: 0.8,
|
|
82022
|
-
leavesMark: true,
|
|
82023
|
-
drink: {
|
|
82024
|
-
thirst: 20,
|
|
82025
|
-
effects: []
|
|
82026
|
-
},
|
|
82027
|
-
tags: [
|
|
82028
|
-
"organic",
|
|
82029
|
-
"sticky"
|
|
82030
|
-
]
|
|
82031
|
-
},
|
|
82032
|
-
{
|
|
82033
|
-
id: "acid",
|
|
82034
|
-
color: 10146378,
|
|
82035
|
-
opacity: 0.6,
|
|
82036
|
-
stainColor: 7313970,
|
|
82037
|
-
viscosity: 1.5,
|
|
82038
|
-
density: 1200,
|
|
82039
|
-
dryTime: 900,
|
|
82040
|
-
gloss: 0.9,
|
|
82041
|
-
leavesMark: true,
|
|
82042
|
-
drink: {
|
|
82043
|
-
thirst: 0,
|
|
82044
|
-
effects: [
|
|
82045
|
-
"poison"
|
|
82046
|
-
]
|
|
82047
|
-
},
|
|
82048
|
-
tags: [
|
|
82049
|
-
"corrosive"
|
|
82050
|
-
]
|
|
82051
|
-
},
|
|
82052
|
-
{
|
|
82053
|
-
id: "paint",
|
|
82054
|
-
color: 11740715,
|
|
82055
|
-
opacity: 0.98,
|
|
82056
|
-
stainColor: 9050655,
|
|
82057
|
-
viscosity: 300,
|
|
82058
|
-
density: 1300,
|
|
82059
|
-
dryTime: 1800,
|
|
82060
|
-
gloss: 0.6,
|
|
82061
|
-
leavesMark: true,
|
|
82062
|
-
drink: {
|
|
82063
|
-
thirst: 0,
|
|
82064
|
-
effects: [
|
|
82065
|
-
"poison"
|
|
82066
|
-
]
|
|
82067
|
-
},
|
|
82068
|
-
tags: [
|
|
82069
|
-
"paint"
|
|
82070
|
-
]
|
|
82071
|
-
},
|
|
82072
|
-
{
|
|
82073
|
-
id: "bleach",
|
|
82074
|
-
color: 15134688,
|
|
82075
|
-
opacity: 0.7,
|
|
82076
|
-
stainColor: 13621446,
|
|
82077
|
-
viscosity: 1.2,
|
|
82078
|
-
density: 1100,
|
|
82079
|
-
dryTime: 900,
|
|
82080
|
-
gloss: 0.85,
|
|
82081
|
-
leavesMark: true,
|
|
82082
|
-
drink: {
|
|
82083
|
-
thirst: 0,
|
|
82084
|
-
effects: [
|
|
82085
|
-
"poison"
|
|
82086
|
-
]
|
|
82087
|
-
},
|
|
82088
|
-
tags: [
|
|
82089
|
-
"corrosive"
|
|
82090
|
-
]
|
|
82091
|
-
},
|
|
82092
|
-
{
|
|
82093
|
-
id: "sewage",
|
|
82094
|
-
color: 5921582,
|
|
82095
|
-
opacity: 0.92,
|
|
82096
|
-
stainColor: 3093273,
|
|
82097
|
-
viscosity: 4,
|
|
82098
|
-
density: 1010,
|
|
82099
|
-
dryTime: 1800,
|
|
82100
|
-
gloss: 0.8,
|
|
82101
|
-
leavesMark: true,
|
|
82102
|
-
drink: {
|
|
82103
|
-
thirst: 0,
|
|
82104
|
-
effects: [
|
|
82105
|
-
"disgust",
|
|
82106
|
-
"poison"
|
|
82107
|
-
]
|
|
82108
|
-
},
|
|
82109
|
-
tags: [
|
|
82110
|
-
"organic",
|
|
82111
|
-
"waste"
|
|
82112
|
-
]
|
|
82113
|
-
},
|
|
82114
|
-
{
|
|
82115
|
-
id: "honey",
|
|
82116
|
-
color: 14193162,
|
|
82117
|
-
opacity: 0.9,
|
|
82118
|
-
stainColor: 12089350,
|
|
82119
|
-
viscosity: 3e3,
|
|
82120
|
-
density: 1420,
|
|
82121
|
-
dryTime: 14400,
|
|
82122
|
-
gloss: 0.95,
|
|
82123
|
-
leavesMark: true,
|
|
82124
|
-
drink: {
|
|
82125
|
-
thirst: 10,
|
|
82126
|
-
effects: []
|
|
82127
|
-
},
|
|
82128
|
-
tags: [
|
|
82129
|
-
"drink",
|
|
82130
|
-
"sticky"
|
|
82131
|
-
]
|
|
82132
|
-
},
|
|
82133
|
-
{
|
|
82134
|
-
id: "mud",
|
|
82135
|
-
color: 4008988,
|
|
82136
|
-
opacity: 0.95,
|
|
82137
|
-
stainColor: 3811866,
|
|
82138
|
-
viscosity: 40,
|
|
82139
|
-
density: 1600,
|
|
82140
|
-
dryTime: 900,
|
|
82141
|
-
gloss: 0.4,
|
|
82142
|
-
tags: [
|
|
82143
|
-
"dirty"
|
|
82144
|
-
]
|
|
82145
|
-
},
|
|
82146
|
-
{
|
|
82147
|
-
id: "coolant",
|
|
82148
|
-
color: 3455050,
|
|
82149
|
-
opacity: 0.7,
|
|
82150
|
-
stainColor: 2783796,
|
|
82151
|
-
viscosity: 4,
|
|
82152
|
-
density: 1070,
|
|
82153
|
-
dryTime: 1200,
|
|
82154
|
-
gloss: 0.85,
|
|
82155
|
-
leavesMark: true,
|
|
82156
|
-
drink: {
|
|
82157
|
-
thirst: 0,
|
|
82158
|
-
effects: [
|
|
82159
|
-
"poison"
|
|
82160
|
-
]
|
|
82161
|
-
},
|
|
82162
|
-
tags: [
|
|
82163
|
-
"coolant"
|
|
82164
|
-
]
|
|
82165
|
-
},
|
|
82166
|
-
{
|
|
82167
|
-
id: "brake_fluid",
|
|
82168
|
-
color: 13145646,
|
|
82169
|
-
opacity: 0.8,
|
|
82170
|
-
stainColor: 9069600,
|
|
82171
|
-
viscosity: 8,
|
|
82172
|
-
density: 1050,
|
|
82173
|
-
dryTime: 3600,
|
|
82174
|
-
gloss: 0.9,
|
|
82175
|
-
leavesMark: true,
|
|
82176
|
-
drink: {
|
|
82177
|
-
thirst: 0,
|
|
82178
|
-
effects: [
|
|
82179
|
-
"poison"
|
|
82180
|
-
]
|
|
82181
|
-
},
|
|
82182
|
-
tags: [
|
|
82183
|
-
"brake_fluid"
|
|
82184
|
-
]
|
|
82185
|
-
}
|
|
82186
|
-
];
|
|
82187
|
-
var LIQUIDS = liquids_default;
|
|
82188
|
-
var SAMPLES = 16;
|
|
82189
|
-
var COS = [];
|
|
82190
|
-
var SIN = [];
|
|
82191
|
-
for (let i = 0; i < SAMPLES; i++) {
|
|
82192
|
-
COS.push(Math.cos(i / SAMPLES * Math.PI * 2));
|
|
82193
|
-
SIN.push(Math.sin(i / SAMPLES * Math.PI * 2));
|
|
82194
|
-
}
|
|
82195
|
-
var RUNOFF_TILT = 6 * Math.PI / 180;
|
|
82196
|
-
var RUNOFF_TILT_MAX = 60 * Math.PI / 180;
|
|
82197
|
-
function hashCell(x, y) {
|
|
82198
|
-
let value = x * 374761393 + y * 668265263 | 0;
|
|
82199
|
-
value = (value ^ value >>> 13) * 1274126177 | 0;
|
|
82200
|
-
return ((value ^ value >>> 16) >>> 0) / 4294967296;
|
|
82201
|
-
}
|
|
82202
|
-
function valueNoise(x, y) {
|
|
82203
|
-
const xi = Math.floor(x);
|
|
82204
|
-
const yi = Math.floor(y);
|
|
82205
|
-
const xf = x - xi;
|
|
82206
|
-
const yf = y - yi;
|
|
82207
|
-
const u = xf * xf * (3 - 2 * xf);
|
|
82208
|
-
const v = yf * yf * (3 - 2 * yf);
|
|
82209
|
-
const a = hashCell(xi, yi);
|
|
82210
|
-
const b = hashCell(xi + 1, yi);
|
|
82211
|
-
const c = hashCell(xi, yi + 1);
|
|
82212
|
-
const d = hashCell(xi + 1, yi + 1);
|
|
82213
|
-
return a + (b - a) * u + (c - a) * v + (a - b - c + d) * u * v;
|
|
82214
|
-
}
|
|
82215
|
-
var REGION_NAMES = ["wall", "sidewalk", "curb", "road"];
|
|
82216
|
-
var dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
82217
|
-
function impactOf(region, position, velocity2, cellSize) {
|
|
82218
|
-
const local2 = [position[0] - region.origin[0], position[1] - region.origin[1], position[2] - region.origin[2]];
|
|
82219
|
-
return {
|
|
82220
|
-
row: region.firstRow + dot3(local2, region.rowAxis) / cellSize,
|
|
82221
|
-
column: dot3(local2, region.columnAxis) / cellSize,
|
|
82222
|
-
along: [dot3(velocity2, region.columnAxis), dot3(velocity2, region.rowAxis)],
|
|
82223
|
-
normalSpeed: -dot3(velocity2, region.normal)
|
|
82224
|
-
};
|
|
82225
|
-
}
|
|
82226
|
-
function cellToWorldOf(regions, cellSize, row, column) {
|
|
82227
|
-
let region = regions[regions.length - 1];
|
|
82228
|
-
for (const candidate of regions) {
|
|
82229
|
-
if (row < candidate.firstRow + candidate.rowCount) {
|
|
82230
|
-
region = candidate;
|
|
82231
|
-
break;
|
|
82232
|
-
}
|
|
82233
|
-
}
|
|
82234
|
-
const across2 = column * cellSize;
|
|
82235
|
-
const down2 = (row - region.firstRow) * cellSize;
|
|
82236
|
-
return [
|
|
82237
|
-
region.origin[0] + region.columnAxis[0] * across2 + region.rowAxis[0] * down2,
|
|
82238
|
-
region.origin[1] + region.columnAxis[1] * across2 + region.rowAxis[1] * down2,
|
|
82239
|
-
region.origin[2] + region.columnAxis[2] * across2 + region.rowAxis[2] * down2
|
|
82240
|
-
];
|
|
82241
|
-
}
|
|
82242
|
-
function createFoldedLayout(params) {
|
|
82243
|
-
const { columns, cellSize, originX, wallRows, sidewalkRows, curbRows, roadRows, wallTopY, sidewalkY, roadY, wallZ, rules } = params;
|
|
82244
|
-
const curbStep = params.curbStep ?? (sidewalkY - roadY) / curbRows;
|
|
82245
|
-
const height = wallRows + sidewalkRows + curbRows + roadRows;
|
|
82246
|
-
const cellCount = columns * height;
|
|
82247
|
-
const bed = new Float32Array(cellCount);
|
|
82248
|
-
const pin = new Float32Array(cellCount);
|
|
82249
|
-
const vertical = new Float32Array(cellCount);
|
|
82250
|
-
const sidewalkEnd = wallRows + sidewalkRows;
|
|
82251
|
-
const curbEnd = sidewalkEnd + curbRows;
|
|
82252
|
-
const regionOfRow = (row) => row < wallRows ? 0 : row < sidewalkEnd ? 1 : row < curbEnd ? 2 : 3;
|
|
82253
|
-
for (let row = 0; row < height; row++) {
|
|
82254
|
-
for (let column = 0; column < columns; column++) {
|
|
82255
|
-
const index = row * columns + column;
|
|
82256
|
-
const region = regionOfRow(row);
|
|
82257
|
-
const x = originX + (column + 0.5) * cellSize;
|
|
82258
|
-
let bedHeight;
|
|
82259
|
-
let roughness = 0.2;
|
|
82260
|
-
if (region === 0) {
|
|
82261
|
-
bedHeight = (wallTopY - (row + 0.5) * cellSize) * 1e3;
|
|
82262
|
-
roughness = 0.3;
|
|
82263
|
-
} else if (region === 1) {
|
|
82264
|
-
const z = (row - wallRows + 0.5) * cellSize;
|
|
82265
|
-
bedHeight = sidewalkY * 1e3 - z * 6;
|
|
82266
|
-
const jointX = Math.abs(((x - originX) % 0.5 + 0.5) % 0.5 - 0.25);
|
|
82267
|
-
const jointZ = Math.abs((z % 0.5 + 0.5) % 0.5 - 0.25);
|
|
82268
|
-
if (jointX > 0.25 - cellSize * 0.6 || jointZ > 0.25 - cellSize * 0.6) bedHeight -= 0.9;
|
|
82269
|
-
roughness = 0.18;
|
|
82270
|
-
} else if (region === 2) {
|
|
82271
|
-
bedHeight = sidewalkY * 1e3 - (row - sidewalkEnd + 0.5) * curbStep * 1e3;
|
|
82272
|
-
} else {
|
|
82273
|
-
const z = (row - curbEnd + 0.5) * cellSize;
|
|
82274
|
-
bedHeight = roadY * 1e3 + z * 14 - (x - params.roadSlopeAnchorX) * 5;
|
|
82275
|
-
roughness = 0.55;
|
|
82276
|
-
}
|
|
82277
|
-
const noise3 = valueNoise(column * 0.35, row * 0.35) * 0.6 + valueNoise(column * 1.3, row * 1.3) * 0.4;
|
|
82278
|
-
bed[index] = bedHeight + (noise3 - 0.5) * roughness * 2;
|
|
82279
|
-
vertical[index] = region === 0 || region === 2 ? 0.95 : 1;
|
|
82280
|
-
pin[index] = 0.62 + 0.76 * (valueNoise(column * 0.21 + 40, row * 0.21) * 0.5 + hashCell(column, row) * 0.5) * (region === 3 ? 1.25 : 1);
|
|
82281
|
-
}
|
|
82282
|
-
}
|
|
82283
|
-
const curbZ = wallZ + sidewalkRows * cellSize;
|
|
82284
|
-
const roadEndZ = curbZ + roadRows * cellSize;
|
|
82285
|
-
const right = [1, 0, 0];
|
|
82286
|
-
const regions = [
|
|
82287
|
-
{ id: REGION_NAMES[0], firstRow: 0, rowCount: wallRows, origin: [originX, wallTopY, wallZ], columnAxis: right, rowAxis: [0, -1, 0], normal: [0, 0, 1], isVertical: true },
|
|
82288
|
-
{ id: REGION_NAMES[1], firstRow: wallRows, rowCount: sidewalkRows, origin: [originX, sidewalkY, wallZ], columnAxis: right, rowAxis: [0, 0, 1], normal: [0, 1, 0], isVertical: false },
|
|
82289
|
-
{ id: REGION_NAMES[2], firstRow: sidewalkEnd, rowCount: curbRows, origin: [originX, sidewalkY, curbZ], columnAxis: right, rowAxis: [0, -1, 0], normal: [0, 0, 1], isVertical: true },
|
|
82290
|
-
{ id: REGION_NAMES[3], firstRow: curbEnd, rowCount: roadRows, origin: [originX, roadY, curbZ], columnAxis: right, rowAxis: [0, 0, 1], normal: [0, 1, 0], isVertical: false }
|
|
82291
|
-
];
|
|
82292
|
-
const maxX = originX + columns * cellSize;
|
|
82293
|
-
return {
|
|
82294
|
-
id: params.id,
|
|
82295
|
-
width: columns,
|
|
82296
|
-
height,
|
|
82297
|
-
cellSize,
|
|
82298
|
-
bed,
|
|
82299
|
-
pin,
|
|
82300
|
-
vertical,
|
|
82301
|
-
regions,
|
|
82302
|
-
rules,
|
|
82303
|
-
cellToWorld: (row, column) => cellToWorldOf(regions, cellSize, row, column),
|
|
82304
|
-
collide(previous, position) {
|
|
82305
|
-
if (position[2] <= wallZ && position[1] > sidewalkY) {
|
|
82306
|
-
position[2] = wallZ;
|
|
82307
|
-
return 0;
|
|
82308
|
-
}
|
|
82309
|
-
if (position[2] < curbZ && (!rules.guardBehindWall || position[2] >= wallZ) && position[1] <= sidewalkY) {
|
|
82310
|
-
position[1] = sidewalkY;
|
|
82311
|
-
return 1;
|
|
82312
|
-
}
|
|
82313
|
-
if (rules.curbCatch && position[2] >= curbZ && previous[2] < curbZ && position[1] < sidewalkY) {
|
|
82314
|
-
position[2] = curbZ;
|
|
82315
|
-
return 2;
|
|
82316
|
-
}
|
|
82317
|
-
if (position[2] >= curbZ && position[1] <= roadY) {
|
|
82318
|
-
position[1] = roadY;
|
|
82319
|
-
return 3;
|
|
82320
|
-
}
|
|
82321
|
-
return -1;
|
|
82322
|
-
},
|
|
82323
|
-
impact: (region, position, velocity2) => impactOf(regions[region], position, velocity2, cellSize),
|
|
82324
|
-
contains: (position) => position[0] > originX && position[0] < maxX && (!rules.clipRoadEnd || position[2] < roadEndZ),
|
|
82325
|
-
escaped(position) {
|
|
82326
|
-
if (position[1] < -1) return true;
|
|
82327
|
-
const box5 = rules.escapeBox;
|
|
82328
|
-
return box5 !== void 0 && (position[0] < box5.minX || position[0] > box5.maxX || position[2] > box5.maxZ);
|
|
82329
|
-
}
|
|
82330
|
-
};
|
|
82331
|
-
}
|
|
82332
|
-
var PADRAO_CELL = 0.0125;
|
|
82333
|
-
var PADRAO_WALL_Z = 0;
|
|
82334
|
-
var PADRAO_LAYOUT = createFoldedLayout({
|
|
82335
|
-
id: "padrao",
|
|
82336
|
-
columns: 256,
|
|
82337
|
-
cellSize: PADRAO_CELL,
|
|
82338
|
-
originX: -1.6,
|
|
82339
|
-
wallRows: 144,
|
|
82340
|
-
sidewalkRows: 128,
|
|
82341
|
-
curbRows: 12,
|
|
82342
|
-
roadRows: 112,
|
|
82343
|
-
wallTopY: 1.95,
|
|
82344
|
-
sidewalkY: 0.15,
|
|
82345
|
-
roadY: 0,
|
|
82346
|
-
wallZ: PADRAO_WALL_Z,
|
|
82347
|
-
curbStep: PADRAO_CELL,
|
|
82348
|
-
roadSlopeAnchorX: 0,
|
|
82349
|
-
rules: {
|
|
82350
|
-
dropCapacity: 600,
|
|
82351
|
-
curbCatch: true,
|
|
82352
|
-
guardBehindWall: true,
|
|
82353
|
-
clipRoadEnd: true,
|
|
82354
|
-
escapeBox: { minX: -3, maxX: 3, maxZ: PADRAO_WALL_Z + 128 * PADRAO_CELL + 112 * PADRAO_CELL + 1 },
|
|
82355
|
-
dripStyle: "padrao"
|
|
82356
|
-
}
|
|
82357
|
-
});
|
|
82358
|
-
var WORKSHOP_CELL = 0.0125;
|
|
82359
|
-
var WORKSHOP_LAYOUT = createFoldedLayout({
|
|
82360
|
-
id: "workshop",
|
|
82361
|
-
columns: 160,
|
|
82362
|
-
cellSize: WORKSHOP_CELL,
|
|
82363
|
-
originX: -2.2,
|
|
82364
|
-
wallRows: 160,
|
|
82365
|
-
sidewalkRows: 128,
|
|
82366
|
-
curbRows: 9,
|
|
82367
|
-
roadRows: 151,
|
|
82368
|
-
wallTopY: 2.12,
|
|
82369
|
-
sidewalkY: 0.1235,
|
|
82370
|
-
roadY: 9e-3,
|
|
82371
|
-
wallZ: -4.497,
|
|
82372
|
-
roadSlopeAnchorX: -1.2,
|
|
82373
|
-
rules: { dropCapacity: 400, curbCatch: false, guardBehindWall: false, clipRoadEnd: false, dripStyle: "workshop" }
|
|
82374
|
-
});
|
|
82375
|
-
|
|
82376
|
-
// ../game-items-three/dist/chunk-S4UUQQOL.js
|
|
82946
|
+
// ../game-items-three/dist/chunk-64JEKMFT.js
|
|
82377
82947
|
var destruction_default = {
|
|
82378
82948
|
families: {
|
|
82379
82949
|
drink_can: {
|
|
@@ -86841,13 +87411,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
86841
87411
|
const hole = metal2(1842463);
|
|
86842
87412
|
const corners = [[2.5, 1.8], [-2.5, 1.8], [2.5, -1.8], [-2.5, -1.8]];
|
|
86843
87413
|
return G(
|
|
86844
|
-
mesh3(bx(
|
|
86845
|
-
mesh3(bx(6, 0.
|
|
86846
|
-
mesh3(bx(6, 0.
|
|
86847
|
-
mesh3(bx(0.16, 0.
|
|
86848
|
-
mesh3(bx(0.16, 0.
|
|
86849
|
-
mesh3(bx(1.2, 0.
|
|
86850
|
-
...corners.map(([x, z]) => mesh3(cyl(0.12, 0.12, 0.
|
|
87414
|
+
mesh3(bx(5.68, 6e-3, 4.18), zinc, [0, 0, 0]),
|
|
87415
|
+
mesh3(bx(6, 0.03, 0.16), edge, [0, 0, 2.17]),
|
|
87416
|
+
mesh3(bx(6, 0.03, 0.16), edge, [0, 0, -2.17]),
|
|
87417
|
+
mesh3(bx(0.16, 0.03, 4.18), edge, [2.92, 0, 0]),
|
|
87418
|
+
mesh3(bx(0.16, 0.03, 4.18), edge, [-2.92, 0, 0]),
|
|
87419
|
+
mesh3(bx(1.2, 0.03, 0.8), metal2(8014380), [-0.8, 0, -0.4]),
|
|
87420
|
+
...corners.map(([x, z]) => mesh3(cyl(0.12, 0.12, 0.03, 8), hole, [x, 0, z]))
|
|
86851
87421
|
);
|
|
86852
87422
|
};
|
|
86853
87423
|
var cementBag = ({ mesh: mesh3, bx, G, paper: paper2, cloth: cloth2 }) => {
|
|
@@ -87715,7 +88285,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
87715
88285
|
};
|
|
87716
88286
|
var laptop = ({ mesh: mesh3, cyl, bx, G, metal: metal2, plastic }) => G(
|
|
87717
88287
|
mesh3(bx(0.36, 0.012, 0.25), metal2(9277588), [0, 6e-3, 0]),
|
|
87718
|
-
mesh3(bx(0.
|
|
88288
|
+
mesh3(bx(0.356, 0.012, 0.246), metal2(2895667), [0, 0.017, 0]),
|
|
88289
|
+
// the lid 2 mm inside the base's sides (CLAUDE.md §13)
|
|
87719
88290
|
mesh3(cyl(6e-3, 6e-3, 0.2, 8), plastic(1842204), [0, 0.0125, -0.12], [0, 0, Math.PI / 2]),
|
|
87720
88291
|
mesh3(bx(0.05, 42e-4, 0.03), metal2(11843514), [0, 0.0231, 0])
|
|
87721
88292
|
);
|
|
@@ -89165,7 +89736,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
89165
89736
|
const q2 = new THREE.Quaternion();
|
|
89166
89737
|
const pointForward = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI / 2);
|
|
89167
89738
|
const frontOf = new THREE.Vector3();
|
|
89168
|
-
const
|
|
89739
|
+
const restBox2 = new THREE.Box3();
|
|
89169
89740
|
const noMotion = new THREE.Vector3();
|
|
89170
89741
|
let inLens = false;
|
|
89171
89742
|
const setLens = (on) => {
|
|
@@ -89181,7 +89752,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
89181
89752
|
def = arsenal.weapons.get(weapon2) ?? null;
|
|
89182
89753
|
if (!def || BODY_ACTIONS.has(def.id)) return;
|
|
89183
89754
|
model = buildWeaponModel(THREE, def, options.items);
|
|
89184
|
-
|
|
89755
|
+
restBox2.setFromObject(model);
|
|
89185
89756
|
inLens = false;
|
|
89186
89757
|
const length2 = new THREE.Box3().setFromObject(model).getSize(v).x;
|
|
89187
89758
|
rear = new THREE.Box3().setFromObject(model).min.x;
|
|
@@ -89351,7 +89922,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
89351
89922
|
setLens(true);
|
|
89352
89923
|
const held = heldHold();
|
|
89353
89924
|
const kind = isOneHand() && def?.action.kind === "firearm" ? "dual" : "tool";
|
|
89354
|
-
placeInView({ THREE, hand, holder: model, camera: camera2, right: heldAnchor(held), box:
|
|
89925
|
+
placeInView({ THREE, hand, holder: model, camera: camera2, right: heldAnchor(held), box: restBox2, kind, aim: 0, offset: noMotion, ...side === "L" ? { mirror: true } : {} });
|
|
89355
89926
|
hand.position.add(v.set(0, -0.12 * dip, 0.05 * kick).applyQuaternion(camera2.quaternion));
|
|
89356
89927
|
applyMotion(camera2.quaternion);
|
|
89357
89928
|
hand.updateMatrixWorld(true);
|
|
@@ -97298,7 +97869,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
97298
97869
|
return [carrier.origin[0] + turned[0], carrier.origin[1] + turned[1], carrier.origin[2] + turned[2]];
|
|
97299
97870
|
}
|
|
97300
97871
|
var CAPACITY3 = 400;
|
|
97301
|
-
var
|
|
97872
|
+
var IDENTITY3 = [0, 0, 0, 1];
|
|
97302
97873
|
function multiply2(a, b) {
|
|
97303
97874
|
const [ax, ay, az, aw] = a;
|
|
97304
97875
|
const [bx, by, bz, bw] = b;
|
|
@@ -97314,7 +97885,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
97314
97885
|
get count() {
|
|
97315
97886
|
return this.particles.length;
|
|
97316
97887
|
}
|
|
97317
|
-
spawn(options, frame2 =
|
|
97888
|
+
spawn(options, frame2 = IDENTITY3, carried) {
|
|
97318
97889
|
const velocity2 = options.v ?? [0, 0, 0];
|
|
97319
97890
|
const world = options.wv ?? [0, 0, 0];
|
|
97320
97891
|
const particle = {
|
|
@@ -98304,7 +98875,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
98304
98875
|
}
|
|
98305
98876
|
var DEGREES = 180 / Math.PI;
|
|
98306
98877
|
|
|
98307
|
-
// ../game-vfx-three/dist/chunk-
|
|
98878
|
+
// ../game-vfx-three/dist/chunk-ACY6ZQC5.js
|
|
98308
98879
|
var GLOW_VERTEX = `attribute vec4 aP;attribute vec4 aC;varying vec2 vU;varying vec4 vC;
|
|
98309
98880
|
void main(){vec3 R=vec3(viewMatrix[0][0],viewMatrix[1][0],viewMatrix[2][0]);vec3 Up=vec3(viewMatrix[0][1],viewMatrix[1][1],viewMatrix[2][1]);
|
|
98310
98881
|
vec3 wp=aP.xyz+(R*position.x+Up*position.y)*aP.w;vU=position.xy;vC=aC;gl_Position=projectionMatrix*viewMatrix*vec4(wp,1.);}`;
|
|
@@ -99352,8 +99923,48 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
99352
99923
|
}
|
|
99353
99924
|
};
|
|
99354
99925
|
}
|
|
99355
|
-
var
|
|
99356
|
-
var
|
|
99926
|
+
var REST_STEP = 15e-4;
|
|
99927
|
+
var REST_TRIES = 8;
|
|
99928
|
+
var SAME_NORMAL = 0.9995;
|
|
99929
|
+
var restBox = () => ({ c: new Float64Array(3), axes: new Float64Array(9), half: new Float64Array(3), ext: new Float64Array(3) });
|
|
99930
|
+
function boxOf3(piece2, out) {
|
|
99931
|
+
const cx = Math.cos(piece2.rx), sx = Math.sin(piece2.rx), cy = Math.cos(piece2.ry), sy = Math.sin(piece2.ry), cz = Math.cos(piece2.rz), sz = Math.sin(piece2.rz);
|
|
99932
|
+
const a = out.axes;
|
|
99933
|
+
a[0] = cy * cz;
|
|
99934
|
+
a[1] = sx * sy * cz + cx * sz;
|
|
99935
|
+
a[2] = sx * sz - cx * sy * cz;
|
|
99936
|
+
a[3] = -cy * sz;
|
|
99937
|
+
a[4] = cx * cz - sx * sy * sz;
|
|
99938
|
+
a[5] = cx * sy * sz + sx * cz;
|
|
99939
|
+
a[6] = sy;
|
|
99940
|
+
a[7] = -sx * cy;
|
|
99941
|
+
a[8] = cx * cy;
|
|
99942
|
+
out.half[0] = piece2.sx / 2;
|
|
99943
|
+
out.half[1] = piece2.sy / 2;
|
|
99944
|
+
out.half[2] = piece2.sz / 2;
|
|
99945
|
+
out.c[0] = piece2.x;
|
|
99946
|
+
out.c[1] = piece2.y;
|
|
99947
|
+
out.c[2] = piece2.z;
|
|
99948
|
+
for (let w = 0; w < 3; w++) out.ext[w] = Math.abs(a[w]) * out.half[0] + Math.abs(a[3 + w]) * out.half[1] + Math.abs(a[6 + w]) * out.half[2];
|
|
99949
|
+
}
|
|
99950
|
+
function sharedPlane(a, b, push) {
|
|
99951
|
+
for (let w = 0; w < 3; w++) if (Math.abs(a.c[w] - b.c[w]) >= a.ext[w] + b.ext[w] + REST_STEP) return false;
|
|
99952
|
+
for (let i = 0; i < 3; i++) for (let j = 0; j < 3; j++) {
|
|
99953
|
+
const ax = a.axes[3 * i], ay = a.axes[3 * i + 1], az = a.axes[3 * i + 2];
|
|
99954
|
+
const dot2 = ax * b.axes[3 * j] + ay * b.axes[3 * j + 1] + az * b.axes[3 * j + 2];
|
|
99955
|
+
if (Math.abs(dot2) < SAME_NORMAL) continue;
|
|
99956
|
+
const ca = ax * a.c[0] + ay * a.c[1] + az * a.c[2];
|
|
99957
|
+
const cb = ax * b.c[0] + ay * b.c[1] + az * b.c[2];
|
|
99958
|
+
for (let side = -1; side <= 1; side += 2) {
|
|
99959
|
+
if (Math.abs(ca + side * a.half[i] - (cb + side * b.half[j])) >= REST_STEP * 0.75) continue;
|
|
99960
|
+
push[0] = ax * side;
|
|
99961
|
+
push[1] = ay * side;
|
|
99962
|
+
push[2] = az * side;
|
|
99963
|
+
return true;
|
|
99964
|
+
}
|
|
99965
|
+
}
|
|
99966
|
+
return false;
|
|
99967
|
+
}
|
|
99357
99968
|
function debrisLayer(THREE, pool) {
|
|
99358
99969
|
const geometry = new THREE.BoxGeometry(1, 1, 1);
|
|
99359
99970
|
const material = new THREE.MeshStandardMaterial({ color: 16777215, roughness: 0.45, metalness: 0.25, flatShading: true });
|
|
@@ -99368,6 +99979,36 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
99368
99979
|
const matrix = new THREE.Matrix4();
|
|
99369
99980
|
const colour = new THREE.Color();
|
|
99370
99981
|
const hidden = new THREE.Matrix4().makeScale(0, 0, 0);
|
|
99982
|
+
const offset = new Float64Array(DEBRIS_CAPACITY * 3);
|
|
99983
|
+
const settled = new Uint8Array(DEBRIS_CAPACITY);
|
|
99984
|
+
const boxes = Array.from({ length: DEBRIS_CAPACITY }, restBox);
|
|
99985
|
+
const push = new Float64Array(3);
|
|
99986
|
+
const settle = (index) => {
|
|
99987
|
+
const box5 = boxes[index];
|
|
99988
|
+
boxOf3(pool.pieces[index], box5);
|
|
99989
|
+
let dx = 0, dy = 0, dz = 0;
|
|
99990
|
+
for (let tries = 0; tries < REST_TRIES; tries++) {
|
|
99991
|
+
let clash = false;
|
|
99992
|
+
for (let other = 0; other < DEBRIS_CAPACITY && !clash; other++) {
|
|
99993
|
+
if (other === index || !settled[other]) continue;
|
|
99994
|
+
if (!sharedPlane(box5, boxes[other], push)) continue;
|
|
99995
|
+
clash = true;
|
|
99996
|
+
const up = Math.abs(push[1]) > 0.7;
|
|
99997
|
+
const ux = up ? 0 : push[0], uy = up ? 1 : push[1], uz = up ? 0 : push[2];
|
|
99998
|
+
dx += ux * REST_STEP;
|
|
99999
|
+
dy += uy * REST_STEP;
|
|
100000
|
+
dz += uz * REST_STEP;
|
|
100001
|
+
box5.c[0] = box5.c[0] + ux * REST_STEP;
|
|
100002
|
+
box5.c[1] = box5.c[1] + uy * REST_STEP;
|
|
100003
|
+
box5.c[2] = box5.c[2] + uz * REST_STEP;
|
|
100004
|
+
}
|
|
100005
|
+
if (!clash) break;
|
|
100006
|
+
}
|
|
100007
|
+
offset[3 * index] = dx;
|
|
100008
|
+
offset[3 * index + 1] = dy;
|
|
100009
|
+
offset[3 * index + 2] = dz;
|
|
100010
|
+
settled[index] = 1;
|
|
100011
|
+
};
|
|
99371
100012
|
for (let index = 0; index < DEBRIS_CAPACITY; index++) mesh3.setMatrixAt(index, hidden);
|
|
99372
100013
|
mesh3.setColorAt(0, colour.setHex(16777215));
|
|
99373
100014
|
return {
|
|
@@ -99376,16 +100017,18 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
99376
100017
|
let drawn = false;
|
|
99377
100018
|
for (let index = 0; index < DEBRIS_CAPACITY; index++) {
|
|
99378
100019
|
const piece2 = pool.pieces[index];
|
|
100020
|
+
if (!piece2.on || !piece2.rest) settled[index] = 0;
|
|
99379
100021
|
if (!piece2.on) {
|
|
99380
100022
|
mesh3.setMatrixAt(index, hidden);
|
|
99381
100023
|
continue;
|
|
99382
100024
|
}
|
|
100025
|
+
if (piece2.rest && !settled[index]) settle(index);
|
|
99383
100026
|
drawn = true;
|
|
99384
100027
|
const shrink = Math.min(1, piece2.life / FADE_SECONDS2);
|
|
99385
100028
|
euler.set(piece2.rx, piece2.ry, piece2.rz);
|
|
99386
100029
|
quaternion2.setFromEuler(euler);
|
|
99387
|
-
const
|
|
99388
|
-
matrix.compose(position.set(piece2.x, piece2.y +
|
|
100030
|
+
const off = piece2.rest ? 3 * index : -1;
|
|
100031
|
+
matrix.compose(position.set(piece2.x + (off >= 0 ? offset[off] : 0), piece2.y + (off >= 0 ? offset[off + 1] : 0), piece2.z + (off >= 0 ? offset[off + 2] : 0)), quaternion2, scale.set(piece2.sx * shrink, piece2.sy * shrink, piece2.sz * shrink));
|
|
99389
100032
|
mesh3.setMatrixAt(index, matrix);
|
|
99390
100033
|
mesh3.setColorAt(index, colour.setHex(piece2.color));
|
|
99391
100034
|
}
|
|
@@ -101107,7 +101750,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
|
|
|
101107
101750
|
const modelBox = new THREE.Box3().setFromObject(model.root);
|
|
101108
101751
|
const length2 = modelBox.getSize(new THREE.Vector3()).x;
|
|
101109
101752
|
modelRear = modelBox.min.x;
|
|
101110
|
-
|
|
101753
|
+
restBox2.copy(modelBox);
|
|
101111
101754
|
lens2 = null;
|
|
101112
101755
|
lensLayer = -1;
|
|
101113
101756
|
holder.add(model.root);
|
|
@@ -101177,7 +101820,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
|
|
|
101177
101820
|
let reach2 = 0;
|
|
101178
101821
|
let pull = 0;
|
|
101179
101822
|
let lift = 0;
|
|
101180
|
-
const
|
|
101823
|
+
const restBox2 = new THREE.Box3();
|
|
101181
101824
|
let lens2 = null;
|
|
101182
101825
|
let lensLayer = -1;
|
|
101183
101826
|
const lensPoint = new THREE.Vector3();
|
|
@@ -101276,7 +101919,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
|
|
|
101276
101919
|
if (options.firstPerson?.()) {
|
|
101277
101920
|
const kind = oneHand ? "dual" : session.model.parts.carry === "hip" ? "hip" : family === "pistol" || family === "revolver" ? "handgun" : family === "rocket" ? "launcher" : "long";
|
|
101278
101921
|
const aim = oneHand || kind === "hip" ? 0 : options.aim?.() ?? 0;
|
|
101279
|
-
placeInView({ THREE, hand, holder, camera: camera2, right: heldAnchor(held), box:
|
|
101922
|
+
placeInView({ THREE, hand, holder, camera: camera2, right: heldAnchor(held), box: restBox2, kind, aim, offset: viewMotion(dt, aim), ...side === "L" ? { mirror: true } : {} });
|
|
101280
101923
|
setLens(kind);
|
|
101281
101924
|
lift = 0;
|
|
101282
101925
|
pull = 0;
|