@adatechnology/game-weapons-three 0.21.5 → 0.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +226 -100
- package/dist/index.global.js.map +1 -1
- package/package.json +9 -9
package/dist/index.global.js
CHANGED
|
@@ -22383,7 +22383,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
22383
22383
|
lo1 = Math.min(lo1, cell.center[v] - cell.size[v] / 2);
|
|
22384
22384
|
}
|
|
22385
22385
|
let along = 1, up = 1;
|
|
22386
|
-
for (let
|
|
22386
|
+
for (let grow2 = 0; ; grow2++) {
|
|
22387
22387
|
const bins = /* @__PURE__ */ new Map();
|
|
22388
22388
|
for (const cell of cells) {
|
|
22389
22389
|
const key2 = `${Math.floor((cell.center[u] - lo0) / (along * unit[0]))}:${Math.floor((cell.center[v] - lo1) / (up * unit[1]))}`;
|
|
@@ -22397,7 +22397,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
22397
22397
|
if (bins.size <= cap) {
|
|
22398
22398
|
return [...bins.values()].map(({ lo, hi }) => ({ center: [(lo[0] + hi[0]) / 2, (lo[1] + hi[1]) / 2, (lo[2] + hi[2]) / 2], size: [hi[0] - lo[0], hi[1] - lo[1], hi[2] - lo[2]] }));
|
|
22399
22399
|
}
|
|
22400
|
-
if (
|
|
22400
|
+
if (grow2 % 2 === 0) up++;
|
|
22401
22401
|
else along++;
|
|
22402
22402
|
}
|
|
22403
22403
|
};
|
|
@@ -24912,6 +24912,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
24912
24912
|
var MEMBER_CRATER_CALIBRES = 3.4;
|
|
24913
24913
|
var MEMBER_CUT_LOSS = 0.9;
|
|
24914
24914
|
var MEMBER_UNIT_LOSS = 0.12;
|
|
24915
|
+
var JOINT_OPEN_SHARE = 0.6;
|
|
24915
24916
|
var BLAST_EDGE_WEAR = 0.6;
|
|
24916
24917
|
var RESIDUAL_CAPACITY = 0.15;
|
|
24917
24918
|
var SEVER_BAND = 0.1;
|
|
@@ -26646,7 +26647,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26646
26647
|
if (partSphereMiss(lo, ld, p, maxDist)) continue;
|
|
26647
26648
|
const r = rayPart(o, p, origin, d);
|
|
26648
26649
|
if (!r || r.t0 < 0 || r.t0 > maxDist) continue;
|
|
26649
|
-
if (p.st.opening && insideOpening(o, p, vec.madd(origin, d, r.t0))) continue;
|
|
26650
|
+
if (p.st.opening && insideOpening(o, p, objLocal(o, vec.madd(origin, d, r.t0)))) continue;
|
|
26651
|
+
if (p.spec.apertures && throughAperture(p, objLocal(o, vec.madd(origin, d, r.t0)))) continue;
|
|
26650
26652
|
if (p.st.chipped && insideChip(p, objLocal(o, vec.madd(origin, d, r.t0)))) continue;
|
|
26651
26653
|
if (!best || r.t0 < best.distance) best = { object: o.id, part: p.spec.id, point: vec.madd(origin, d, r.t0), normal: r.n, distance: r.t0, pathLen: r.t1 - r.t0 };
|
|
26652
26654
|
}
|
|
@@ -26842,6 +26844,25 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26842
26844
|
for (let k = 0; k < 3; k++) len = Math.max(len, Math.min(A.max[k], B.max[k]) - Math.max(A.min[k], B.min[k]));
|
|
26843
26845
|
return len;
|
|
26844
26846
|
};
|
|
26847
|
+
const onFoundation = (o, j) => o.parts[j.ia].spec.structure?.role === "foundation" || o.parts[j.ib].spec.structure?.role === "foundation";
|
|
26848
|
+
const wornStretches = /* @__PURE__ */ new WeakMap();
|
|
26849
|
+
const wornShare = (o, j, point, span) => {
|
|
26850
|
+
const A = partWorldAabb(o, o.parts[j.ia]), B = partWorldAabb(o, o.parts[j.ib]);
|
|
26851
|
+
const lo = [0, 1, 2].map((k) => Math.max(A.min[k], B.min[k])), hi = [0, 1, 2].map((k) => Math.min(A.max[k], B.max[k]));
|
|
26852
|
+
const axis2 = [0, 1, 2].reduce((best, k) => hi[k] - lo[k] > hi[best] - lo[best] ? k : best, 0);
|
|
26853
|
+
const length2 = hi[axis2] - lo[axis2];
|
|
26854
|
+
if (length2 <= span) return 1;
|
|
26855
|
+
const at4 = clamp2(point[axis2], lo[axis2], hi[axis2]);
|
|
26856
|
+
const from = Math.max(lo[axis2], at4 - span / 2), to = Math.min(hi[axis2], at4 + span / 2);
|
|
26857
|
+
const worn = [...wornStretches.get(j) ?? [], [from, to]].sort((x, y) => x[0] - y[0]);
|
|
26858
|
+
wornStretches.set(j, worn);
|
|
26859
|
+
let covered = 0, end3 = -Infinity;
|
|
26860
|
+
for (const [a, b] of worn) {
|
|
26861
|
+
covered += Math.max(0, b - Math.max(a, end3));
|
|
26862
|
+
end3 = Math.max(end3, b);
|
|
26863
|
+
}
|
|
26864
|
+
return covered / length2;
|
|
26865
|
+
};
|
|
26845
26866
|
const isTrim = (p) => (p.spec.structure?.role ?? "none") === "none";
|
|
26846
26867
|
const wearJoints = (o, p, amount, near, radius = 0.06, src, split = false, span, blast) => {
|
|
26847
26868
|
if (amount <= 0) return;
|
|
@@ -26853,6 +26874,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26853
26874
|
if (near && jointReach(o, j, near) > Math.max(radius, jointReachLimit(o, j))) continue;
|
|
26854
26875
|
if (blast && (isTrim(o.parts[j.ia]) || isTrim(o.parts[j.ib])) && jointReach(o, j, blast.point) > Math.max(blast.reach, jointReachLimit(o, j))) continue;
|
|
26855
26876
|
j.st.hp -= span === void 0 ? amount : Math.min(amount, j.st.maxHp) * Math.min(1, span / Math.max(jointLength(o, j), 1e-6));
|
|
26877
|
+
if (j.st.hp <= 0 && blast && span !== void 0 && onFoundation(o, j) && wornShare(o, j, blast.point, span) < JOINT_OPEN_SHARE) j.st.hp = Math.min(j.st.maxHp, 1);
|
|
26856
26878
|
if (j.st.hp <= 0) {
|
|
26857
26879
|
j.st.hp = 0;
|
|
26858
26880
|
j.st.open = true;
|
|
@@ -26898,6 +26920,18 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26898
26920
|
const lc = toLocal(p.pos, p.q, op.center);
|
|
26899
26921
|
return Math.hypot(lp[u] - lc[u], lp[v] - lc[v]) <= op.radius;
|
|
26900
26922
|
};
|
|
26923
|
+
const throughAperture = (p, objectPoint) => {
|
|
26924
|
+
const [u, v] = planeAxes(p.thin);
|
|
26925
|
+
const lp = toLocal(p.pos, p.q, objectPoint);
|
|
26926
|
+
return (p.spec.apertures ?? []).some((ap) => {
|
|
26927
|
+
const du = lp[u] - (ap.offset?.[0] ?? 0);
|
|
26928
|
+
const dv = lp[v] - (ap.offset?.[1] ?? 0);
|
|
26929
|
+
if (Math.abs(du) > ap.size[0] / 2 || Math.abs(dv) > ap.size[1] / 2) return false;
|
|
26930
|
+
if (!ap.bars || ap.bars.spacing <= 0) return true;
|
|
26931
|
+
const along = ap.bars.axis === 0 ? du + ap.size[0] / 2 : dv + ap.size[1] / 2;
|
|
26932
|
+
return Math.abs(along - Math.round(along / ap.bars.spacing) * ap.bars.spacing) > ap.bars.width / 2;
|
|
26933
|
+
});
|
|
26934
|
+
};
|
|
26901
26935
|
const breachAreaOf = (p, damage, blast) => damage / (p.mat.hpPerKg * p.mat.density) / Math.max(p.thickness, 5e-3) * (blast ? breachBlastFactor : 1);
|
|
26902
26936
|
const localHolesOf = (p) => p.st.holes.map((h) => ({ point: toLocal(p.pos, p.q, h.point), normal: rotateVec(quat.conjugate(p.q), h.normal), diameter: h.diameter }));
|
|
26903
26937
|
const unitsOf2 = (p) => p.spec.units ?? { size: [p.mat.fragmentSize?.[1] ?? 0.2, p.mat.fragmentSize?.[1] ?? 0.2, p.thickness], bond: "stack" };
|
|
@@ -28004,7 +28038,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
28004
28038
|
const path = Math.min(r.t1, L) - t0;
|
|
28005
28039
|
if (path < shelter.minPath) continue;
|
|
28006
28040
|
const mid = vec.madd(point, d, t0 + path / 2);
|
|
28007
|
-
const opening = p.st.opening && insideOpening(o, p, mid);
|
|
28041
|
+
const opening = p.st.opening && insideOpening(o, p, objLocal(o, mid));
|
|
28008
28042
|
if (opening && was & FLAG_OPEN) continue;
|
|
28009
28043
|
if (p.st.stripped && was & FLAG_OPEN) continue;
|
|
28010
28044
|
const resistance = p.mat.hpPerKg * p.mat.density * path * (p.mat.damageScale?.shelter ?? 1);
|
|
@@ -29995,9 +30029,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
29995
30029
|
if (!(span > 1.5) || !Number.isFinite(span)) return part;
|
|
29996
30030
|
const depth = Math.max(part.y1 - part.y0, beamDepthFor(span, options));
|
|
29997
30031
|
const wide2 = Math.max(width, round2(depth / options.beamWidthRatio));
|
|
29998
|
-
const
|
|
30032
|
+
const grow2 = (wide2 - width) / 2;
|
|
29999
30033
|
changed = true;
|
|
30000
|
-
const aabb = dir === "u" ? [part.aabb[0], part.aabb[1] -
|
|
30034
|
+
const aabb = dir === "u" ? [part.aabb[0], part.aabb[1] - grow2, part.aabb[2], part.aabb[3] + grow2] : [part.aabb[0] - grow2, part.aabb[1], part.aabb[2] + grow2, part.aabb[3]];
|
|
30001
30035
|
return make2({ ...part, aabb, y0: part.y1 - depth });
|
|
30002
30036
|
});
|
|
30003
30037
|
return changed ? { parts, supports: input.supports } : input;
|
|
@@ -30315,6 +30349,42 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
30315
30349
|
}
|
|
30316
30350
|
return { ...next, capacities };
|
|
30317
30351
|
}
|
|
30352
|
+
var planeAxes2 = (thin) => thin === 1 ? [0, 2] : [thin === 0 ? 2 : 0, 1];
|
|
30353
|
+
function toPartFrame(part, point) {
|
|
30354
|
+
const dx = point[0] - part.position[0];
|
|
30355
|
+
const dz = point[2] - part.position[2];
|
|
30356
|
+
const angle = -(part.rotation?.[1] ?? 0);
|
|
30357
|
+
return [dx * Math.cos(angle) + dz * Math.sin(angle), point[1] - part.position[1], -dx * Math.sin(angle) + dz * Math.cos(angle)];
|
|
30358
|
+
}
|
|
30359
|
+
function wallApertures(part, windows) {
|
|
30360
|
+
if (part.shape.kind !== "box") return [];
|
|
30361
|
+
const size = part.shape.size;
|
|
30362
|
+
const thin = size.indexOf(Math.min(...size));
|
|
30363
|
+
if (thin === 1) return [];
|
|
30364
|
+
const [along] = planeAxes2(thin);
|
|
30365
|
+
const turn2 = part.rotation?.[1] ?? 0;
|
|
30366
|
+
const alongU = Math.abs(Math.cos(turn2)) * size[0] + Math.abs(Math.sin(turn2)) * size[2] >= Math.abs(Math.sin(turn2)) * size[0] + Math.abs(Math.cos(turn2)) * size[2];
|
|
30367
|
+
return windows.map((opening2) => {
|
|
30368
|
+
const middle = (opening2.from + opening2.to) / 2;
|
|
30369
|
+
const centre2 = alongU ? [middle, (opening2.y0 + opening2.y1) / 2, part.position[2]] : [part.position[0], (opening2.y0 + opening2.y1) / 2, middle];
|
|
30370
|
+
const local2 = toPartFrame(part, centre2);
|
|
30371
|
+
return { size: [opening2.to - opening2.from, opening2.y1 - opening2.y0], offset: [local2[along], local2[1]] };
|
|
30372
|
+
});
|
|
30373
|
+
}
|
|
30374
|
+
function withWindowApertures(spec, openings) {
|
|
30375
|
+
const byWall = /* @__PURE__ */ new Map();
|
|
30376
|
+
for (const opening2 of openings) if (opening2.kind === "window") byWall.set(opening2.wall, [...byWall.get(opening2.wall) ?? [], opening2]);
|
|
30377
|
+
if (!byWall.size) return spec;
|
|
30378
|
+
return {
|
|
30379
|
+
...spec,
|
|
30380
|
+
parts: spec.parts.map((part) => {
|
|
30381
|
+
const windows = byWall.get(part.id);
|
|
30382
|
+
if (!windows) return part;
|
|
30383
|
+
const apertures = wallApertures(part, windows);
|
|
30384
|
+
return apertures.length ? { ...part, apertures: [...part.apertures ?? [], ...apertures] } : part;
|
|
30385
|
+
})
|
|
30386
|
+
};
|
|
30387
|
+
}
|
|
30318
30388
|
var RAFT_THICKNESS = 0.25;
|
|
30319
30389
|
var PILE_AREA = 9;
|
|
30320
30390
|
var RAFT_MARGIN = 0.15;
|
|
@@ -30413,7 +30483,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
30413
30483
|
const infill = new Set(portico && slabOptions ? kept.filter((part) => part.role === "wall").map((part) => part.id) : []);
|
|
30414
30484
|
const beams = new Set(parts.filter((part) => part.role === "beam" && (part.beamKind === "bond_beam" || part.slab !== void 0)).map((part) => part.id));
|
|
30415
30485
|
const joints = supports.filter((s) => present.has(s.part) && present.has(s.on)).map((s) => ({ id: `${s.part}~${s.on}`, a: s.part, b: s.on, kind: s.joint, bears: s.bears === false || beams.has(s.part) && infill.has(s.on) ? false : "a_on_b" }));
|
|
30416
|
-
const
|
|
30486
|
+
const built2 = { name: options.name ?? "house", parts: specs, joints, tags: ["structure", "house"] };
|
|
30487
|
+
const spec = detail === "coarse" && options.windowApertures !== false ? withWindowApertures(built2, structure.openings) : built2;
|
|
30417
30488
|
return onSoil(withRebar(spec, structure, options, portico, slabOptions !== void 0), structure, options);
|
|
30418
30489
|
}
|
|
30419
30490
|
function withRebar(spec, structure, options, portico, panelled) {
|
|
@@ -32287,7 +32358,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
32287
32358
|
}
|
|
32288
32359
|
var residentialTower = residentialTowerTemplate();
|
|
32289
32360
|
|
|
32290
|
-
// ../game-floorplan-three/dist/chunk-
|
|
32361
|
+
// ../game-floorplan-three/dist/chunk-RZF4G6CY.js
|
|
32291
32362
|
var __defProp4 = Object.defineProperty;
|
|
32292
32363
|
var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp4(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
32293
32364
|
var __publicField2 = (obj, key2, value) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
@@ -33343,6 +33414,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
33343
33414
|
function installHouseWindows(K, shared3) {
|
|
33344
33415
|
const { EPS: EPS6, Y0, boxC, bx, cursor, pieceRecord, roomAt } = K;
|
|
33345
33416
|
const FRAME_COLORS = { budget: 15856110, mid: 12830924, high: 2829875, commercial: 11844287 };
|
|
33417
|
+
const ALUMINIUM_PROFILE_KG_PER_M = 1.2, SILL_KG_PER_M = 6, STEEL_KG_PER_M3 = 7850, GRILLE_BAR = 0.016;
|
|
33346
33418
|
const SILL_COLORS = { budget: 15131870, mid: 14277076, high: 3816770, commercial: 13225166 };
|
|
33347
33419
|
function windows() {
|
|
33348
33420
|
const R = shared3.ctx.r, cut = shared3.ctx.cut, C = shared3.ctx.colors, structure = R.style, fr = FRAME_COLORS[structure] || FRAME_COLORS.budget, pe_ = SILL_COLORS[structure] || SILL_COLORS.budget;
|
|
@@ -33358,7 +33430,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
33358
33430
|
}
|
|
33359
33431
|
const wref = R.walls.find((w) => w.floor === f && w.axis === j.axis && Math.abs((alongU ? w.v0 : w.u0) - L) < EPS6), th = wref ? wref.thickness || 0.15 : 0.15, t = 0.05, tt = th + 0.02;
|
|
33360
33432
|
const bar2 = (u0, y_0, u1, y_1, mat, color2, tw = tt) => alongU ? bx(mat, u0, y0 + y_0, L - tw / 2, u1, y0 + y_1, L + tw / 2, color2) : bx(mat, L - tw / 2, y0 + y_0, u0, L + tw / 2, y0 + y_1, u1, color2);
|
|
33361
|
-
const
|
|
33433
|
+
const outside0 = !roomAt(f, alongU ? j.at : L + 0.4, alongU ? L + 0.4 : j.at) || !roomAt(f, alongU ? j.at : L - 0.4, alongU ? L - 0.4 : j.at);
|
|
33434
|
+
const frameMass = ALUMINIUM_PROFILE_KG_PER_M * (2 * (j.width + (yb - ya)) + j.width + (j.width > 0.9 ? yb - ya : 0)) + (outside0 ? SILL_KG_PER_M * (j.width + 0.1) : 0);
|
|
33435
|
+
const frame2 = pieceRecord("window_frame:" + j.id, "aluminium", null, { floor: f, mass: frameMass, aperture: { alongU, a: a + t, b: b - t, y0: y0 + ya + t, y1: y0 + yb - t } });
|
|
33362
33436
|
cursor.pc = frame2;
|
|
33363
33437
|
bar2(a, ya, a + t, yb, "metal", fr);
|
|
33364
33438
|
bar2(b - t, ya, b, yb, "metal", fr);
|
|
@@ -33377,7 +33451,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
33377
33451
|
if (alongU) bx("plaster", a - 0.05, y0 + ya - 0.04, L + (outside > 0 ? th / 2 : -th / 2 - 0.08), b + 0.05, y0 + ya, L + (outside > 0 ? th / 2 + 0.08 : -th / 2), pe_);
|
|
33378
33452
|
else bx("plaster", L + (outside > 0 ? th / 2 : -th / 2 - 0.08), y0 + ya - 0.04, a - 0.05, L + (outside > 0 ? th / 2 + 0.08 : -th / 2), y0 + ya, b + 0.05, pe_);
|
|
33379
33453
|
if (R.facade.grilles && !cut) {
|
|
33380
|
-
const g = C.gate != null ? C.gate : 2763310, go = outside * (th / 2 + 0.07), n = Math.max(3, Math.round(j.width / 0.12));
|
|
33454
|
+
const g = C.gate != null ? C.gate : 2763310, go = outside * (th / 2 + 0.07), n = Math.max(3, Math.round(j.width / 0.12)), spacing = (j.width - 0.06) / n;
|
|
33455
|
+
cursor.pc = pieceRecord("window_grille:" + j.id, "steel", null, { floor: f, mass: STEEL_KG_PER_M3 * ((n + 1) * (yb - ya + 0.06) * GRILLE_BAR * GRILLE_BAR + 3 * j.width * 0.025 * 0.024), aperture: { alongU, a: a + 0.03, b: a + 0.03 + n * spacing, y0: y0 + ya - 0.03, y1: y0 + yb + 0.03, bars: { spacing, width: GRILLE_BAR } } });
|
|
33381
33456
|
for (let k = 0; k <= n; k++) {
|
|
33382
33457
|
const u = a + 0.03 + k * (j.width - 0.06) / n;
|
|
33383
33458
|
if (alongU) bx("metal", u - 8e-3, y0 + ya - 0.03, L + go - 8e-3, u + 8e-3, y0 + yb + 0.03, L + go + 8e-3, g);
|
|
@@ -33387,6 +33462,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
33387
33462
|
if (alongU) bx("metal", a, y0 + y, L + go - 0.012, b, y0 + y + 0.025, L + go + 0.012, g);
|
|
33388
33463
|
else bx("metal", L + go - 0.012, y0 + y, a, L + go + 0.012, y0 + y + 0.025, b, g);
|
|
33389
33464
|
}
|
|
33465
|
+
cursor.pc = frame2;
|
|
33390
33466
|
}
|
|
33391
33467
|
cursor.pc = null;
|
|
33392
33468
|
}
|
|
@@ -38641,6 +38717,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
38641
38717
|
else if (def.kind === "swing" || def.kind === "drawer") tagObject(def.name, [def.outer], "mdf", null, { mass: 6 });
|
|
38642
38718
|
}
|
|
38643
38719
|
}
|
|
38720
|
+
function apertureOf(sp, ap) {
|
|
38721
|
+
if (!ap || sp.shape.kind !== "box") return null;
|
|
38722
|
+
const size = sp.shape.size, depth = ap.alongU ? 2 : 0;
|
|
38723
|
+
if (size[depth] > Math.min(size[ap.alongU ? 0 : 2], size[1])) return null;
|
|
38724
|
+
const out = { size: [ap.b - ap.a, ap.y1 - ap.y0], offset: [(ap.a + ap.b) / 2 - sp.position[ap.alongU ? 0 : 2], (ap.y0 + ap.y1) / 2 - sp.position[1]] };
|
|
38725
|
+
if (ap.bars) out.bars = { axis: 0, spacing: ap.bars.spacing, width: ap.bars.width };
|
|
38726
|
+
return out;
|
|
38727
|
+
}
|
|
38644
38728
|
function assembleStructure(r0, root) {
|
|
38645
38729
|
const E0 = r0.structure || { parts: [], supports: [], levels: [], elevation: 0 }, meshes = /* @__PURE__ */ new Map(), add2 = (id, it) => {
|
|
38646
38730
|
let l = meshes.get(id);
|
|
@@ -38685,7 +38769,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
38685
38769
|
if (!b) continue;
|
|
38686
38770
|
const vol = Math.max(1e-6, (b[3] - b[0]) * (b[4] - b[1]) * (b[5] - b[2]));
|
|
38687
38771
|
const p = { id, role: "none", material: pc.mat, aabb: [b[0], b[2], b[3], b[5]], y0: b[1], y1: b[4], floor: pc.floor != null ? pc.floor : floorAtY(b[1] + 0.1), mass: pc.mass != null ? pc.mass : Math.max(0.5, vol * (DENSITY[pc.mat] || 800) * (pc.fill != null ? pc.fill : 0.15)), meshes: meshes.get(id).length, extra: true };
|
|
38688
|
-
for (const k of ["contains", "explodes", "tags", "form", "thickness", "fill", "units"]) if (pc[k] != null) p[k] = pc[k];
|
|
38772
|
+
for (const k of ["contains", "explodes", "tags", "form", "thickness", "fill", "units", "aperture"]) if (pc[k] != null) p[k] = pc[k];
|
|
38689
38773
|
parts.push(p);
|
|
38690
38774
|
byId.set(id, p);
|
|
38691
38775
|
}
|
|
@@ -38758,6 +38842,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
38758
38842
|
if (!pc0) return sp;
|
|
38759
38843
|
const extra = {};
|
|
38760
38844
|
for (const k of ["contains", "explodes", "thickness", "fill", "tags"]) if (pc0[k] != null && sp[k] == null) extra[k] = pc0[k];
|
|
38845
|
+
const aperture = apertureOf(sp, pc0.aperture);
|
|
38846
|
+
if (aperture) extra.apertures = [aperture];
|
|
38761
38847
|
return Object.keys(extra).length ? { ...sp, ...extra } : sp;
|
|
38762
38848
|
});
|
|
38763
38849
|
spec.parts = spec.parts.map((sp) => {
|
|
@@ -38781,7 +38867,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
38781
38867
|
return sp;
|
|
38782
38868
|
}
|
|
38783
38869
|
});
|
|
38784
|
-
|
|
38870
|
+
const walls = new Set((E0.openings ?? []).map((op) => op.wall));
|
|
38871
|
+
return withWindowApertures({ ...spec, parts: spec.parts.map((sp) => walls.has(sp.id) && sp.apertures ? (({ apertures: _gone, ...rest2 }) => rest2)(sp) : sp) }, E0.openings ?? []);
|
|
38785
38872
|
}
|
|
38786
38873
|
};
|
|
38787
38874
|
return structure;
|
|
@@ -66592,66 +66679,58 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66592
66679
|
])
|
|
66593
66680
|
]
|
|
66594
66681
|
};
|
|
66682
|
+
var DEBRIS_EFFECT_FAMILIES = ["wood", "masonry", "glass", "metal", "soft", "soil"];
|
|
66683
|
+
var DEBRIS_COLOR_VARIABLE = "debrisColor";
|
|
66684
|
+
var DUST_COLOR_VARIABLE = "dustColor";
|
|
66685
|
+
var FAMILIES3 = {
|
|
66686
|
+
wood: { debris: 8017200, dust: 10127986, piece: [0.015, 0.015, 0.1], spin: 6, cloud: 0.5, sparks: false, glints: false },
|
|
66687
|
+
masonry: { debris: 10197652, dust: 11052187, piece: [0.035, 0.028, 0.035], spin: 4, cloud: 1, sparks: false, glints: false },
|
|
66688
|
+
glass: { debris: 11061464, dust: 12572386, piece: [0.04, 4e-3, 0.04], spin: 14, cloud: 0.25, sparks: false, glints: true },
|
|
66689
|
+
metal: { debris: 9080726, dust: 9078138, piece: [0.04, 6e-3, 0.03], spin: 8, cloud: 0.15, sparks: true, glints: false },
|
|
66690
|
+
soft: { debris: 10130568, dust: 11578014, piece: [0.025, 4e-3, 0.02], spin: 6, cloud: 0.3, sparks: false, glints: false },
|
|
66691
|
+
soil: { debris: 8022613, dust: 9075298, piece: [0.03, 0.025, 0.03], spin: 3, cloud: 1, sparks: false, glints: false }
|
|
66692
|
+
};
|
|
66693
|
+
var ORIGIN = [0, 0, 0];
|
|
66595
66694
|
var FACING4 = [0, 0, 1];
|
|
66596
66695
|
var UP11 = [0, 1, 0];
|
|
66597
|
-
var
|
|
66598
|
-
var
|
|
66599
|
-
var
|
|
66600
|
-
var
|
|
66601
|
-
|
|
66602
|
-
|
|
66603
|
-
|
|
66604
|
-
|
|
66605
|
-
|
|
66606
|
-
|
|
66607
|
-
|
|
66608
|
-
var muzzleEffect = (weapon) => ({
|
|
66609
|
-
id: `muzzle_${weapon}`,
|
|
66610
|
-
pageId: `event:muzzle_${weapon}`,
|
|
66611
|
-
team: "weapons",
|
|
66612
|
-
budget: { particles: 60, lights: 1 },
|
|
66613
|
-
loop: 2.4,
|
|
66614
|
-
timeline: [call2("muzzle", weapon, ORIGIN, FORWARD4)]
|
|
66615
|
-
});
|
|
66616
|
-
var casingEffect = (id, type) => ({
|
|
66617
|
-
id,
|
|
66618
|
-
pageId: `event:${id}`,
|
|
66619
|
-
team: "weapons",
|
|
66620
|
-
budget: { debris: 1 },
|
|
66621
|
-
loop: 2,
|
|
66622
|
-
timeline: [call2("casing", ORIGIN, type)]
|
|
66623
|
-
});
|
|
66624
|
-
var EVENT_EFFECTS = [
|
|
66625
|
-
...IMPACT_MATERIALS.map(impactEffect),
|
|
66626
|
-
...["glock", "ak", "r870", "barrett"].map(muzzleEffect),
|
|
66627
|
-
casingEffect("casing_brass", ""),
|
|
66628
|
-
casingEffect("casing_shell", "shell"),
|
|
66629
|
-
casingEffect("casing_50", "50"),
|
|
66630
|
-
{
|
|
66631
|
-
// door_stages (W856-871): the dust a blow shakes loose from the frame and the splinters.
|
|
66632
|
-
id: "stage_crack",
|
|
66633
|
-
pageId: "event:stage_crack",
|
|
66696
|
+
var grow = (piece2, factor) => [piece2[0] * factor, piece2[1] * factor, piece2[2] * factor];
|
|
66697
|
+
var debrisTone = (look) => or(variable(DEBRIS_COLOR_VARIABLE), look.debris);
|
|
66698
|
+
var dustTone = (look) => or(variable(DUST_COLOR_VARIABLE), look.dust);
|
|
66699
|
+
var sparks = (look, count) => look.sparks ? [call2("spark_at", ORIGIN, FACING4, count, 0.9)] : [];
|
|
66700
|
+
var glints = (look, count) => look.glints ? [burst("add", count, { p: ORIGIN, r: 0.2, size: [0.02, 0.05], life: [0.2, 0.5], c0: 16777215, a: 0.9, fi: 0.3 })] : [];
|
|
66701
|
+
function stageCrack(family) {
|
|
66702
|
+
const look = FAMILIES3[family];
|
|
66703
|
+
const dust = look.sparks ? [] : [burst("normal", 12, { p: ORIGIN, box: [0.3, 0.05, 0.02], dir: [0, -0.287, 0.958], cone: 0.6, sp: [0.2, 0.8], drag: 1.5, life: [0.8, 1.4], size: [0.08, 0.16], grow: 3, c0: dustTone(look), a: 0.45, g: 0.4 })];
|
|
66704
|
+
return {
|
|
66705
|
+
id: `stage_crack_${family}`,
|
|
66706
|
+
pageId: `event:stage_crack_${family}`,
|
|
66634
66707
|
team: "destruction",
|
|
66635
|
-
budget: { particles:
|
|
66708
|
+
budget: { particles: 16, debris: 6 },
|
|
66636
66709
|
loop: 2,
|
|
66637
66710
|
timeline: [
|
|
66638
|
-
|
|
66639
|
-
|
|
66711
|
+
...dust,
|
|
66712
|
+
...sparks(look, 8),
|
|
66713
|
+
...glints(look, 4),
|
|
66714
|
+
repeat(scaled(look.sparks ? 1 : 4), debris({ p: ORIGIN, box: [0.15, 0.15, 0.02], dir: [0, 0.287, 0.958], cone: 0.6, sp: [1, 2.5], size: look.piece, k: [0.6, 1.4], spin: look.spin, c: debrisTone(look), life: 12 }))
|
|
66640
66715
|
]
|
|
66641
|
-
}
|
|
66642
|
-
|
|
66643
|
-
|
|
66644
|
-
|
|
66645
|
-
|
|
66716
|
+
};
|
|
66717
|
+
}
|
|
66718
|
+
function breachDust(family) {
|
|
66719
|
+
const look = FAMILIES3[family];
|
|
66720
|
+
return {
|
|
66721
|
+
id: `breach_dust_${family}`,
|
|
66722
|
+
pageId: `event:breach_dust_${family}`,
|
|
66646
66723
|
team: "destruction",
|
|
66647
66724
|
budget: { particles: 90, debris: 16 },
|
|
66648
66725
|
loop: 5,
|
|
66649
66726
|
timeline: [
|
|
66650
66727
|
screen({ add: { shake: 0.25 } }),
|
|
66651
|
-
|
|
66652
|
-
|
|
66728
|
+
...sparks(look, 14),
|
|
66729
|
+
...glints(look, 20),
|
|
66730
|
+
burst("normal", Math.round(30 * look.cloud), { p: ORIGIN, box: [1.4, 0.8, 0.2], sp: [0.3, 1.2], drag: 1.5, life: [1.5, 2.6], size: [0.4, 0.7], grow: 3, c0: dustTone(look), c1: 4867648, a: 0.45 }),
|
|
66731
|
+
repeat(scaled(16), debris({ p: ORIGIN, box: [1.3, 0.8, 0.1], sp: [1, 3], size: grow(look.piece, 2.2), k: [0.5, 1.5], spin: look.spin, c: debrisTone(look), life: 20 })),
|
|
66653
66732
|
repeat(
|
|
66654
|
-
scaled(60),
|
|
66733
|
+
scaled(Math.round(60 * look.cloud)),
|
|
66655
66734
|
spawn("normal", local("angle", rnd(0, 6.283), {
|
|
66656
66735
|
p: [rnd(-1.4, 1.4), 0.2, rnd(-0.6, 0.4)],
|
|
66657
66736
|
dir: vnorm([cos(variable("angle")), 0.3, sin(variable("angle"))]),
|
|
@@ -66661,27 +66740,30 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66661
66740
|
life: [2.5, 4.5],
|
|
66662
66741
|
size: [0.6, 1],
|
|
66663
66742
|
grow: 3,
|
|
66664
|
-
c0:
|
|
66743
|
+
c0: dustTone(look),
|
|
66665
66744
|
c1: 4867648,
|
|
66666
66745
|
a: 0.45,
|
|
66667
66746
|
fi: 0.12
|
|
66668
66747
|
}))
|
|
66669
66748
|
)
|
|
66670
66749
|
]
|
|
66671
|
-
}
|
|
66672
|
-
|
|
66673
|
-
|
|
66674
|
-
|
|
66675
|
-
|
|
66750
|
+
};
|
|
66751
|
+
}
|
|
66752
|
+
function collapseDust(family) {
|
|
66753
|
+
const look = FAMILIES3[family];
|
|
66754
|
+
return {
|
|
66755
|
+
id: `collapse_dust_${family}`,
|
|
66756
|
+
pageId: `event:collapse_dust_${family}`,
|
|
66676
66757
|
team: "destruction",
|
|
66677
66758
|
budget: { particles: 350, debris: 26 },
|
|
66678
66759
|
loop: 8,
|
|
66679
66760
|
timeline: [
|
|
66680
66761
|
screen({ add: { shake: 0.45 } }),
|
|
66681
|
-
|
|
66682
|
-
repeat(
|
|
66762
|
+
...sparks(look, 20),
|
|
66763
|
+
repeat(6, debris({ p: ORIGIN, box: [2, 0.05, 0.6], v: [rnd(-0.5, 0.5), rnd(-0.5, 0), rnd(0, 0.8)], sp: 0, size: [rnd(0.5, 1.1), look.piece[1] > 0.01 ? 0.25 : 0.03, rnd(0.4, 0.8)], c: debrisTone(look), spin: 3, life: 30, bounce: 0.1 })),
|
|
66764
|
+
repeat(scaled(20), debris({ p: ORIGIN, box: [2.1, 0.1, 0.7], v: [rnd(-1, 1), rnd(-1, 1), rnd(0, 1.5)], sp: 0, size: grow(look.piece, 3.4), k: [0.5, 1.5], spin: look.spin, c: debrisTone(look), life: 30 })),
|
|
66683
66765
|
repeat(
|
|
66684
|
-
scaled(70),
|
|
66766
|
+
scaled(Math.round(70 * look.cloud)),
|
|
66685
66767
|
spawn("normal", local("angle", rnd(-0.4, 3.5), {
|
|
66686
66768
|
p: [rnd(-2, 2), 0.2, rnd(-0.5, 0.5)],
|
|
66687
66769
|
dir: vnorm([mul(cos(variable("angle")), 0.6), 0.25, sin(variable("angle"))]),
|
|
@@ -66691,14 +66773,66 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66691
66773
|
life: [3, 6],
|
|
66692
66774
|
size: [0.7, 1.2],
|
|
66693
66775
|
grow: 3,
|
|
66694
|
-
c0:
|
|
66776
|
+
c0: dustTone(look),
|
|
66695
66777
|
c1: 4867648,
|
|
66696
66778
|
a: 0.5,
|
|
66697
66779
|
fi: 0.12
|
|
66698
66780
|
}))
|
|
66699
66781
|
)
|
|
66700
66782
|
]
|
|
66701
|
-
}
|
|
66783
|
+
};
|
|
66784
|
+
}
|
|
66785
|
+
var MASONRY = FAMILIES3.masonry;
|
|
66786
|
+
var REBAR_EXPOSE = {
|
|
66787
|
+
id: "rebar_expose",
|
|
66788
|
+
pageId: "event:rebar_expose",
|
|
66789
|
+
team: "destruction",
|
|
66790
|
+
budget: { particles: 24, debris: 8 },
|
|
66791
|
+
loop: 2,
|
|
66792
|
+
timeline: [
|
|
66793
|
+
repeat(scaled(8), debris({ p: ORIGIN, dir: UP11, cone: 0.9, sp: [1, 3], size: MASONRY.piece, k: [0.6, 1.4], spin: MASONRY.spin, c: debrisTone(MASONRY), life: 20 })),
|
|
66794
|
+
burst("normal", 8, { p: ORIGIN, dir: UP11, cone: 0.8, sp: [0.3, 1.2], drag: 2, life: [0.8, 1.4], size: [0.08, 0.15], grow: 3, c0: dustTone(MASONRY), a: 0.4 }),
|
|
66795
|
+
call2("rust_at", ORIGIN, 6)
|
|
66796
|
+
]
|
|
66797
|
+
};
|
|
66798
|
+
var MATERIAL_EVENT_EFFECTS = [
|
|
66799
|
+
...DEBRIS_EFFECT_FAMILIES.flatMap((family) => [stageCrack(family), breachDust(family), collapseDust(family)]),
|
|
66800
|
+
REBAR_EXPOSE
|
|
66801
|
+
];
|
|
66802
|
+
var FACING5 = [0, 0, 1];
|
|
66803
|
+
var ORIGIN2 = [0, 0, 0];
|
|
66804
|
+
var FORWARD4 = [0, 0, -1];
|
|
66805
|
+
var IMPACT_MATERIALS = ["concrete", "metal", "wood", "glass", "flesh", "water"];
|
|
66806
|
+
var impactEffect = (material) => ({
|
|
66807
|
+
id: `impact_${material}`,
|
|
66808
|
+
pageId: `event:impact_${material}`,
|
|
66809
|
+
team: "weapons",
|
|
66810
|
+
budget: { particles: 40, decals: 1 },
|
|
66811
|
+
loop: 2,
|
|
66812
|
+
timeline: [call2("impact", material, ORIGIN2, FACING5, 1, 0)]
|
|
66813
|
+
});
|
|
66814
|
+
var muzzleEffect = (weapon) => ({
|
|
66815
|
+
id: `muzzle_${weapon}`,
|
|
66816
|
+
pageId: `event:muzzle_${weapon}`,
|
|
66817
|
+
team: "weapons",
|
|
66818
|
+
budget: { particles: 60, lights: 1 },
|
|
66819
|
+
loop: 2.4,
|
|
66820
|
+
timeline: [call2("muzzle", weapon, ORIGIN2, FORWARD4)]
|
|
66821
|
+
});
|
|
66822
|
+
var casingEffect = (id, type) => ({
|
|
66823
|
+
id,
|
|
66824
|
+
pageId: `event:${id}`,
|
|
66825
|
+
team: "weapons",
|
|
66826
|
+
budget: { debris: 1 },
|
|
66827
|
+
loop: 2,
|
|
66828
|
+
timeline: [call2("casing", ORIGIN2, type)]
|
|
66829
|
+
});
|
|
66830
|
+
var EVENT_EFFECTS = [
|
|
66831
|
+
...IMPACT_MATERIALS.map(impactEffect),
|
|
66832
|
+
...["glock", "ak", "r870", "barrett"].map(muzzleEffect),
|
|
66833
|
+
casingEffect("casing_brass", ""),
|
|
66834
|
+
casingEffect("casing_shell", "shell"),
|
|
66835
|
+
casingEffect("casing_50", "50"),
|
|
66702
66836
|
{
|
|
66703
66837
|
// shopfront_glass (W846-855): the pane coming down as shards, the flash of the glints and the pale dust.
|
|
66704
66838
|
id: "glass_burst",
|
|
@@ -66710,21 +66844,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66710
66844
|
screen({ add: { shake: 0.08 } }),
|
|
66711
66845
|
repeat(
|
|
66712
66846
|
scaled(75),
|
|
66713
|
-
debris({ p:
|
|
66847
|
+
debris({ p: ORIGIN2, box: [1.25, 0.85, 0.02], v: [rnd(-0.4, 0.4), rnd(-0.5, 0.8), rnd(0.6, 2)], sp: 0, size: [rnd(0.05, 0.18), 6e-3, rnd(0.05, 0.18)], c: 11061464, spin: 14, life: 30, bounce: 0.15 })
|
|
66714
66848
|
),
|
|
66715
|
-
burst("add", 30, { p:
|
|
66849
|
+
burst("add", 30, { p: ORIGIN2, box: [1.2, 0.8, 0.05], size: [0.02, 0.05], life: [0.2, 0.6], c0: 16777215, a: 0.9, fi: 0.3 }),
|
|
66716
66850
|
burst("normal", 20, { p: [0, -0.6, 0.1], box: [1.2, 0.5, 0.1], sp: [0.2, 0.6], drag: 2, life: [0.8, 1.4], size: [0.12, 0.2], grow: 3, c0: 12572386, a: 0.2 })
|
|
66717
66851
|
]
|
|
66718
66852
|
},
|
|
66719
|
-
|
|
66720
|
-
// The chips macro the page uses on wood (W849) plus rust (`rustAt`), for rebar laid bare in concrete.
|
|
66721
|
-
id: "rebar_expose",
|
|
66722
|
-
pageId: "event:rebar_expose",
|
|
66723
|
-
team: "destruction",
|
|
66724
|
-
budget: { particles: 20, debris: 8 },
|
|
66725
|
-
loop: 2,
|
|
66726
|
-
timeline: [call2("chips", ORIGIN, UP11, 8, 0.9), call2("rust_at", ORIGIN, 6)]
|
|
66727
|
-
}
|
|
66853
|
+
...MATERIAL_EVENT_EFFECTS
|
|
66728
66854
|
];
|
|
66729
66855
|
var PI16 = Math.PI;
|
|
66730
66856
|
var SMOKE = { color: 9079430, width: 10, height: 8, gravity: -0.08, drag: 2.2, growth: 2.1 };
|
|
@@ -66735,7 +66861,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66735
66861
|
var FLASH_OPACITY = 0.95;
|
|
66736
66862
|
var FLAME_COLORS = [16742946, 16760896, 13121050, 16773296];
|
|
66737
66863
|
var FLAME_ADDITIVE = 3;
|
|
66738
|
-
var
|
|
66864
|
+
var ORIGIN3 = [0, 0, 0];
|
|
66739
66865
|
var SIZE = variable("size");
|
|
66740
66866
|
var FLASH_SCALE = variable("flash");
|
|
66741
66867
|
var fallback = (name, defaultValue) => ite(ne(variable(name), void 0), variable(name), defaultValue);
|
|
@@ -66783,7 +66909,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66783
66909
|
grow: 2.2
|
|
66784
66910
|
})
|
|
66785
66911
|
];
|
|
66786
|
-
var flashPiece = (shape, radius, height, width, at32, rot, color2) => mesh2({ shape, r: radius, ...height === void 0 ? {} : { h: height }, seg: width, seg2: shape === "sphere" ? 8 : 1, p:
|
|
66912
|
+
var flashPiece = (shape, radius, height, width, at32, rot, color2) => mesh2({ shape, r: radius, ...height === void 0 ? {} : { h: height }, seg: width, seg2: shape === "sphere" ? 8 : 1, p: ORIGIN3, at: at32, rot, roll: variable("roll"), ramp: FLASH_RAMP, life: FLASH_SECONDS, c0: color2, a: FLASH_OPACITY, add: true });
|
|
66787
66913
|
var MUZZLE_FLASH2 = {
|
|
66788
66914
|
id: "viewmodel_muzzle_flash",
|
|
66789
66915
|
pageId: "event:viewmodel_muzzle_flash",
|
|
@@ -66810,7 +66936,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66810
66936
|
repeat(4, append("angles", add(div(mul(INDEX, PI16), 2), mul(rand(), 0.6)))),
|
|
66811
66937
|
set("roll", mul(rand(), PI16)),
|
|
66812
66938
|
when(gt(FLASH_SCALE, 0), [
|
|
66813
|
-
flash(
|
|
66939
|
+
flash(ORIGIN3, 16756832, mul(4, SIZE, FLASH_SCALE), FLASH_SECONDS, mul(2, SIZE, FLASH_SCALE), true, true),
|
|
66814
66940
|
flashPiece("cone_open", mul(0.013, SIZE, FLASH_SCALE), mul(0.085, SIZE, FLASH_SCALE), 10, [mul(0.042, SIZE, FLASH_SCALE), 0, 0], [0, 0, -PI16 / 2], 16757575),
|
|
66815
66941
|
repeat(
|
|
66816
66942
|
4,
|
|
@@ -66830,7 +66956,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66830
66956
|
repeat(
|
|
66831
66957
|
variable("puffs"),
|
|
66832
66958
|
puff2(
|
|
66833
|
-
|
|
66959
|
+
ORIGIN3,
|
|
66834
66960
|
[add(variable("drift"), mul(rand(), variable("driftSpread"))), add(variable("rise"), mul(rand(), variable("riseSpread"))), mul(sub(rand(), 0.5), variable("sideSpread"))],
|
|
66835
66961
|
[0, 0, 0],
|
|
66836
66962
|
mul(variable("radius"), SIZE),
|
|
@@ -66847,7 +66973,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66847
66973
|
team: "weapons",
|
|
66848
66974
|
budget: { particles: 1 },
|
|
66849
66975
|
loop: 0.1,
|
|
66850
|
-
timeline: [puff2(
|
|
66976
|
+
timeline: [puff2(ORIGIN3, void 0, [variable("vx"), variable("vy"), variable("vz")], variable("radius"), variable("life"), variable("opacity"))]
|
|
66851
66977
|
};
|
|
66852
66978
|
var BACKBLAST = {
|
|
66853
66979
|
id: "launcher_backblast",
|
|
@@ -66856,8 +66982,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66856
66982
|
budget: { particles: 40 },
|
|
66857
66983
|
loop: 0.1,
|
|
66858
66984
|
timeline: [
|
|
66859
|
-
repeat(26, puff2(
|
|
66860
|
-
repeat(14, ...flameBit(
|
|
66985
|
+
repeat(26, puff2(ORIGIN3, [neg(add(1.5, mul(rand(), 3))), 0, 0], [wide(1.4), wide(0.8), wide(1.4)], add(0.03, mul(rand(), 0.03)), add(1.8, mul(rand(), 1.4)), 0.5)),
|
|
66986
|
+
repeat(14, ...flameBit(ORIGIN3, [neg(add(2, mul(rand(), 2))), 0, 0], [wide(1), wide(0.6), wide(1)], 0.02, 0.25))
|
|
66861
66987
|
]
|
|
66862
66988
|
};
|
|
66863
66989
|
var FLAME_JET = {
|
|
@@ -66976,7 +67102,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66976
67102
|
}
|
|
66977
67103
|
var COLUMNS = 6;
|
|
66978
67104
|
var ROWS = 5;
|
|
66979
|
-
var
|
|
67105
|
+
var ORIGIN4 = [-2.2, 0, 2.6];
|
|
66980
67106
|
var BLOCK_SIZE = [0.5, 0.44, 0.25];
|
|
66981
67107
|
var OBJECT_ID_DRAWS2 = 4;
|
|
66982
67108
|
var FLOOR2 = 0.13;
|
|
@@ -67019,7 +67145,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67019
67145
|
const chipScale = random.between(0.8, 1.3) * scale;
|
|
67020
67146
|
for (let draw2 = 0; draw2 < OBJECT_ID_DRAWS2; draw2++) random.next();
|
|
67021
67147
|
best.holes.push({ x: offsetX, y: offsetY, scale, chipTurn, chipScale });
|
|
67022
|
-
impact(host.engine, "concrete", [
|
|
67148
|
+
impact(host.engine, "concrete", [ORIGIN4[0] + x, y, ORIGIN4[2] + 0.13], [0, 0, 1], 0.8);
|
|
67023
67149
|
} else if (action === "collapse") {
|
|
67024
67150
|
const { x, y } = args;
|
|
67025
67151
|
for (const block of blocks) {
|
|
@@ -67069,7 +67195,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67069
67195
|
}
|
|
67070
67196
|
};
|
|
67071
67197
|
}
|
|
67072
|
-
var
|
|
67198
|
+
var ORIGIN5 = [5.6, 0, 0.8];
|
|
67073
67199
|
var MAX_TILT = 0.25;
|
|
67074
67200
|
function createCarBehavior() {
|
|
67075
67201
|
let y = 0;
|
|
@@ -67102,7 +67228,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67102
67228
|
}
|
|
67103
67229
|
},
|
|
67104
67230
|
query(_host, name, args) {
|
|
67105
|
-
if (name === "position") return [
|
|
67231
|
+
if (name === "position") return [ORIGIN5[0], y, ORIGIN5[2]];
|
|
67106
67232
|
if (name === "point") {
|
|
67107
67233
|
const [x, py, z] = args;
|
|
67108
67234
|
const point = carPoint(x, py, z);
|
|
@@ -67974,7 +68100,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67974
68100
|
this.index = previous;
|
|
67975
68101
|
}
|
|
67976
68102
|
};
|
|
67977
|
-
var
|
|
68103
|
+
var ORIGIN6 = [0, 0, 0];
|
|
67978
68104
|
var DEFAULT_HEADING = [0, 0, -1];
|
|
67979
68105
|
var DEFAULT_MAX_INSTANCES = 48;
|
|
67980
68106
|
var ENDLESS_SECONDS = 60;
|
|
@@ -68051,7 +68177,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
68051
68177
|
random: playOptions.seed !== void 0 ? streamOf(playOptions.seed) : void 0,
|
|
68052
68178
|
follow: playOptions.follow,
|
|
68053
68179
|
origin: point,
|
|
68054
|
-
anchor: def.anchor ??
|
|
68180
|
+
anchor: def.anchor ?? ORIGIN6,
|
|
68055
68181
|
yaw: yawOf(heading, playOptions.direction),
|
|
68056
68182
|
orientation: playOptions.orientation,
|
|
68057
68183
|
seconds: playOptions.seconds ?? (def.loop && def.loop > 0 ? def.loop : ENDLESS_SECONDS),
|
|
@@ -72047,7 +72173,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72047
72173
|
uTime: { value: 0 }
|
|
72048
72174
|
};
|
|
72049
72175
|
const puffs = createPuffLayer(THREE, pools.puffs, uniforms);
|
|
72050
|
-
const
|
|
72176
|
+
const sparks2 = createSparkLayer(THREE, pools.sparks);
|
|
72051
72177
|
const glows = createGlowLayer(THREE, pools.glows);
|
|
72052
72178
|
const rockGeometry = new THREE.DodecahedronGeometry(0.5, 0);
|
|
72053
72179
|
const plateGeometry = new THREE.BoxGeometry(1, 1, 1);
|
|
@@ -72056,7 +72182,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72056
72182
|
const sprites = createSpriteLayer(THREE, world.sprites(), options.pointScale ?? 700);
|
|
72057
72183
|
const lights = createLightLayer(THREE, pools.lights, options.lightScale ?? Math.PI, options.lights);
|
|
72058
72184
|
const marks = createMarkLayer(THREE, { ground: pools.ground, ...world.hostGroundAt ? { heightAt: world.hostGroundAt } : {}, createCanvas: options.createCanvas, rockGeometry, plateGeometry, ...options.markLimits });
|
|
72059
|
-
root.add(puffs.mesh,
|
|
72185
|
+
root.add(puffs.mesh, sparks2.mesh, glows.mesh, chunks.rocks, chunks.plates, shocks.group, lights.group, sprites.additive, sprites.normal, marks.group);
|
|
72060
72186
|
const stopMarks = world.onMarks((event) => marks.handle(event));
|
|
72061
72187
|
const overlay = options.overlay ? createScreenOverlay(options.overlay) : void 0;
|
|
72062
72188
|
let drawCalls = 0;
|
|
@@ -72065,7 +72191,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72065
72191
|
const layerOn = /* @__PURE__ */ new Map();
|
|
72066
72192
|
const layerObjects = () => ({
|
|
72067
72193
|
puffs: [puffs.mesh],
|
|
72068
|
-
sparks: [
|
|
72194
|
+
sparks: [sparks2.mesh],
|
|
72069
72195
|
glows: [glows.mesh],
|
|
72070
72196
|
debris: [chunks.rocks, chunks.plates],
|
|
72071
72197
|
shock: [shocks.group],
|
|
@@ -72093,7 +72219,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72093
72219
|
}
|
|
72094
72220
|
function syncAll() {
|
|
72095
72221
|
lastDrawn.puffs = puffs.sync();
|
|
72096
|
-
lastDrawn.sparks =
|
|
72222
|
+
lastDrawn.sparks = sparks2.sync();
|
|
72097
72223
|
lastDrawn.glows = glows.sync();
|
|
72098
72224
|
lastDrawn.chunks = chunks.sync();
|
|
72099
72225
|
lastDrawn.shocks = shocks.sync();
|
|
@@ -72194,7 +72320,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72194
72320
|
stopMarks();
|
|
72195
72321
|
overlay?.dispose();
|
|
72196
72322
|
workshopLayers?.dispose();
|
|
72197
|
-
for (const layer22 of [puffs,
|
|
72323
|
+
for (const layer22 of [puffs, sparks2, glows, chunks, shocks, lights, marks, sprites]) layer22.dispose();
|
|
72198
72324
|
rockGeometry.dispose();
|
|
72199
72325
|
plateGeometry.dispose();
|
|
72200
72326
|
options.scene.remove(root);
|