@adatechnology/game-weapons-three 0.21.4 → 0.21.6
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 +235 -133
- package/dist/index.global.js.map +1 -1
- package/package.json +7 -7
package/dist/index.global.js
CHANGED
|
@@ -15136,6 +15136,10 @@ var GameWeaponsThree = (() => {
|
|
|
15136
15136
|
get fuseRemaining() {
|
|
15137
15137
|
return this.fuseLeft;
|
|
15138
15138
|
}
|
|
15139
|
+
/** Whether this trigger sets it off (`impact` for a rocket or a 40 mm grenade, `timer` for a hand grenade). */
|
|
15140
|
+
isTriggeredBy(trigger) {
|
|
15141
|
+
return this.triggers.has(trigger);
|
|
15142
|
+
}
|
|
15139
15143
|
step(dt, probe) {
|
|
15140
15144
|
const events = [];
|
|
15141
15145
|
if (this.isDone) return events;
|
|
@@ -22379,7 +22383,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
22379
22383
|
lo1 = Math.min(lo1, cell.center[v] - cell.size[v] / 2);
|
|
22380
22384
|
}
|
|
22381
22385
|
let along = 1, up = 1;
|
|
22382
|
-
for (let
|
|
22386
|
+
for (let grow2 = 0; ; grow2++) {
|
|
22383
22387
|
const bins = /* @__PURE__ */ new Map();
|
|
22384
22388
|
for (const cell of cells) {
|
|
22385
22389
|
const key2 = `${Math.floor((cell.center[u] - lo0) / (along * unit[0]))}:${Math.floor((cell.center[v] - lo1) / (up * unit[1]))}`;
|
|
@@ -22393,7 +22397,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
22393
22397
|
if (bins.size <= cap) {
|
|
22394
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]] }));
|
|
22395
22399
|
}
|
|
22396
|
-
if (
|
|
22400
|
+
if (grow2 % 2 === 0) up++;
|
|
22397
22401
|
else along++;
|
|
22398
22402
|
}
|
|
22399
22403
|
};
|
|
@@ -24906,9 +24910,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
24906
24910
|
var PANEL_POINTS_LOADED = 4;
|
|
24907
24911
|
var MEMBER_BAND = 0.1;
|
|
24908
24912
|
var MEMBER_CRATER_CALIBRES = 3.4;
|
|
24909
|
-
var MEMBER_BARED_MAX = 24;
|
|
24910
24913
|
var MEMBER_CUT_LOSS = 0.9;
|
|
24911
|
-
var MEMBER_UNIT_LOSS = 0.
|
|
24914
|
+
var MEMBER_UNIT_LOSS = 0.12;
|
|
24915
|
+
var JOINT_OPEN_SHARE = 0.6;
|
|
24912
24916
|
var BLAST_EDGE_WEAR = 0.6;
|
|
24913
24917
|
var RESIDUAL_CAPACITY = 0.15;
|
|
24914
24918
|
var SEVER_BAND = 0.1;
|
|
@@ -26839,7 +26843,27 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26839
26843
|
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]));
|
|
26840
26844
|
return len;
|
|
26841
26845
|
};
|
|
26842
|
-
const
|
|
26846
|
+
const onFoundation = (o, j) => o.parts[j.ia].spec.structure?.role === "foundation" || o.parts[j.ib].spec.structure?.role === "foundation";
|
|
26847
|
+
const wornStretches = /* @__PURE__ */ new WeakMap();
|
|
26848
|
+
const wornShare = (o, j, point, span) => {
|
|
26849
|
+
const A = partWorldAabb(o, o.parts[j.ia]), B = partWorldAabb(o, o.parts[j.ib]);
|
|
26850
|
+
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]));
|
|
26851
|
+
const axis2 = [0, 1, 2].reduce((best, k) => hi[k] - lo[k] > hi[best] - lo[best] ? k : best, 0);
|
|
26852
|
+
const length2 = hi[axis2] - lo[axis2];
|
|
26853
|
+
if (length2 <= span) return 1;
|
|
26854
|
+
const at4 = clamp2(point[axis2], lo[axis2], hi[axis2]);
|
|
26855
|
+
const from = Math.max(lo[axis2], at4 - span / 2), to = Math.min(hi[axis2], at4 + span / 2);
|
|
26856
|
+
const worn = [...wornStretches.get(j) ?? [], [from, to]].sort((x, y) => x[0] - y[0]);
|
|
26857
|
+
wornStretches.set(j, worn);
|
|
26858
|
+
let covered = 0, end3 = -Infinity;
|
|
26859
|
+
for (const [a, b] of worn) {
|
|
26860
|
+
covered += Math.max(0, b - Math.max(a, end3));
|
|
26861
|
+
end3 = Math.max(end3, b);
|
|
26862
|
+
}
|
|
26863
|
+
return covered / length2;
|
|
26864
|
+
};
|
|
26865
|
+
const isTrim = (p) => (p.spec.structure?.role ?? "none") === "none";
|
|
26866
|
+
const wearJoints = (o, p, amount, near, radius = 0.06, src, split = false, span, blast) => {
|
|
26843
26867
|
if (amount <= 0) return;
|
|
26844
26868
|
const mine = (o.byPart.get(p.spec.id) ?? []).filter((j) => !j.st.open);
|
|
26845
26869
|
if (split && mine.length) amount /= mine.length;
|
|
@@ -26847,7 +26871,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26847
26871
|
if (j.st.open) continue;
|
|
26848
26872
|
if (j.spec.kind === "rebar" && (isReinforced(o.parts[j.ia].spec) || isReinforced(o.parts[j.ib].spec))) continue;
|
|
26849
26873
|
if (near && jointReach(o, j, near) > Math.max(radius, jointReachLimit(o, j))) continue;
|
|
26874
|
+
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;
|
|
26850
26875
|
j.st.hp -= span === void 0 ? amount : Math.min(amount, j.st.maxHp) * Math.min(1, span / Math.max(jointLength(o, j), 1e-6));
|
|
26876
|
+
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);
|
|
26851
26877
|
if (j.st.hp <= 0) {
|
|
26852
26878
|
j.st.hp = 0;
|
|
26853
26879
|
j.st.open = true;
|
|
@@ -27013,8 +27039,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
27013
27039
|
}
|
|
27014
27040
|
return cells.some((c) => Math.abs(lp[u] - c.center[u]) <= c.size[u] / 2 && Math.abs(lp[v] - c.center[v]) <= c.size[v] / 2);
|
|
27015
27041
|
};
|
|
27042
|
+
const wornLocally = (p) => !!p.spec.reinforcement && !!p.spec.units && p.spec.units.mortar === p.spec.material && isMember(p.dims) && p.spec.shape.kind === "box";
|
|
27016
27043
|
const wearMember = (o, p, entry2, d, E, caliber, penMm, src) => {
|
|
27017
|
-
var _a, _b, _c
|
|
27044
|
+
var _a, _b, _c;
|
|
27018
27045
|
if (!p.spec.reinforcement || !p.spec.units || !isMember(p.dims) || p.st.stripped || isLost(p) || p.spec.shape.kind !== "box") return false;
|
|
27019
27046
|
const along = p.dims.indexOf(Math.max(...p.dims));
|
|
27020
27047
|
const lp = toLocal(p.pos, p.q, objLocal(o, entry2));
|
|
@@ -27036,24 +27063,14 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
27036
27063
|
worn[band] = after2;
|
|
27037
27064
|
markDamaged(p);
|
|
27038
27065
|
const bandCenter = -p.dims[along] / 2 + (band + 0.5) * height;
|
|
27039
|
-
if (h > REBAR_COVER && after2 < MEMBER_CUT_LOSS) {
|
|
27040
|
-
const bared = (_b = p.rt).bared ?? (_b.bared = []);
|
|
27041
|
-
const center = [lp[0], lp[1], lp[2]];
|
|
27042
|
-
const size = [p.dims[0], p.dims[1], p.dims[2]];
|
|
27043
|
-
for (let a = 0; a < 3; a++) if (Math.abs(ld[a]) < 0.5) size[a] = 2 * r;
|
|
27044
|
-
if (bared.length < MEMBER_BARED_MAX && !bared.some((box5) => box5.center.every((x, a) => Math.abs(x - center[a]) < box5.size[a] / 4))) {
|
|
27045
|
-
bared.push({ center, size });
|
|
27046
|
-
exposeRebar(o, p, src);
|
|
27047
|
-
}
|
|
27048
|
-
}
|
|
27049
27066
|
const grid = gridOf(p);
|
|
27050
|
-
const gone = (
|
|
27067
|
+
const gone = (_b = p.rt).chips ?? (_b.chips = {});
|
|
27051
27068
|
if (before >= MEMBER_CUT_LOSS || after2 < MEMBER_CUT_LOSS) {
|
|
27052
27069
|
if (h <= REBAR_COVER) return true;
|
|
27053
27070
|
const [u, v] = planeAxes(p.thin);
|
|
27054
27071
|
const hit = grid.findIndex((cell2, i) => gone[i] !== -1 && Math.abs(lp[u] - cell2.center[u]) <= cell2.size[u] / 2 && Math.abs(lp[v] - cell2.center[v]) <= cell2.size[v] / 2);
|
|
27055
27072
|
if (hit < 0) return true;
|
|
27056
|
-
const wear = (
|
|
27073
|
+
const wear = (_c = p.rt).cellWear ?? (_c.cellWear = {});
|
|
27057
27074
|
const cell = grid[hit];
|
|
27058
27075
|
wear[hit] = (wear[hit] ?? 0) + volume;
|
|
27059
27076
|
if (wear[hit] >= MEMBER_UNIT_LOSS * cell.size[0] * cell.size[1] * cell.size[2]) knockOutUnits(o, p, entry2, E, [hit], src);
|
|
@@ -27653,6 +27670,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
27653
27670
|
const chained = trigger !== void 0 && chainDelayOf(p.spec, trigger) !== void 0;
|
|
27654
27671
|
if (chained && p.st.hp <= 0 && p.rt.chainDue === void 0) p.st.hp = Math.min(prev, 1);
|
|
27655
27672
|
if (p.st.hp <= 0 && p.mat.fracture === "none" && !p.spec.explodes) p.st.hp = Math.min(prev, 1);
|
|
27673
|
+
if (p.st.hp <= 0 && type === "ballistic" && wornLocally(p)) p.st.hp = Math.min(prev, 1);
|
|
27656
27674
|
const done = prev - p.st.hp;
|
|
27657
27675
|
if (done > 0) emit2({ ...base(o, src), type: "damage", part: p.spec.id, amount: done, hp: Math.max(0, p.st.hp), damageType: type });
|
|
27658
27676
|
if (p.st.hp <= 0) failPart(o, p, origin, dir, fragEnergy, cap, src);
|
|
@@ -27862,7 +27880,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
27862
27880
|
checkIgnite(o, p, src);
|
|
27863
27881
|
}
|
|
27864
27882
|
}
|
|
27865
|
-
|
|
27883
|
+
const stretch = 2 * BREACH_BLAST_REACH * Math.cbrt(Math.max(0, energy) / 1e3);
|
|
27884
|
+
wearJoints(o, p, Ein * 0.5, void 0, 0, src, false, stretch, { point, reach: stretch });
|
|
27866
27885
|
const amount = Ein * DMG_PER_J * (mat.damageScale?.explosive ?? 1);
|
|
27867
27886
|
if (blastFrontSpeed > 0 && dist2 > 0 && mat.tags?.includes("glass")) {
|
|
27868
27887
|
frontQueue.push({ o, p, due: time + dist2 / blastFrontSpeed, amount, fragEnergy: Ein * 0.3, point, ...src !== void 0 ? { src } : {} });
|
|
@@ -29997,9 +30016,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
29997
30016
|
if (!(span > 1.5) || !Number.isFinite(span)) return part;
|
|
29998
30017
|
const depth = Math.max(part.y1 - part.y0, beamDepthFor(span, options));
|
|
29999
30018
|
const wide2 = Math.max(width, round2(depth / options.beamWidthRatio));
|
|
30000
|
-
const
|
|
30019
|
+
const grow2 = (wide2 - width) / 2;
|
|
30001
30020
|
changed = true;
|
|
30002
|
-
const aabb = dir === "u" ? [part.aabb[0], part.aabb[1] -
|
|
30021
|
+
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]];
|
|
30003
30022
|
return make2({ ...part, aabb, y0: part.y1 - depth });
|
|
30004
30023
|
});
|
|
30005
30024
|
return changed ? { parts, supports: input.supports } : input;
|
|
@@ -32289,7 +32308,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
32289
32308
|
}
|
|
32290
32309
|
var residentialTower = residentialTowerTemplate();
|
|
32291
32310
|
|
|
32292
|
-
// ../game-floorplan-three/dist/chunk-
|
|
32311
|
+
// ../game-floorplan-three/dist/chunk-FUZURKX2.js
|
|
32293
32312
|
var __defProp4 = Object.defineProperty;
|
|
32294
32313
|
var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp4(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
32295
32314
|
var __publicField2 = (obj, key2, value) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
@@ -38829,11 +38848,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
38829
38848
|
var SPALL_RAGGED = 0.045;
|
|
38830
38849
|
var COVER2 = 0.015;
|
|
38831
38850
|
var LUMP_BAR_INSET = 0.035;
|
|
38832
|
-
var LUMPS_PER_BAR =
|
|
38833
|
-
var LUMP_CHANCE = 0.
|
|
38851
|
+
var LUMPS_PER_BAR = 1;
|
|
38852
|
+
var LUMP_CHANCE = 0.5;
|
|
38834
38853
|
var LUMP_MIN = 0.025;
|
|
38835
38854
|
var LUMP_MAX = 0.05;
|
|
38836
|
-
var EDGE_LUMPS =
|
|
38855
|
+
var EDGE_LUMPS = 2;
|
|
38837
38856
|
var EDGE_LUMP_MIN = 0.04;
|
|
38838
38857
|
var EDGE_LUMP_MAX = 0.08;
|
|
38839
38858
|
var MAX_FLAKES = 64;
|
|
@@ -39228,35 +39247,42 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
39228
39247
|
function stuckLumps(gone, mask, bounds2) {
|
|
39229
39248
|
const out = [];
|
|
39230
39249
|
const grey = fragmentMaterial("concrete").color.getHex();
|
|
39250
|
+
const stone = (s, y, d, size, r) => {
|
|
39251
|
+
const centre = mask.start + s;
|
|
39252
|
+
const unit = clipToBox({ x: mask.alongU ? centre : d, y, z: mask.alongU ? d : centre, sx: mask.alongU ? size[0] : size[2], sy: size[1], sz: mask.alongU ? size[2] : size[0], colour: tmp.c.setHex(grey).multiplyScalar(0.85 + 0.2 * r(7)).getHex() }, bounds2);
|
|
39253
|
+
if (unit) out.push(unit);
|
|
39254
|
+
};
|
|
39231
39255
|
for (const { c, part, thick, mid } of gone) {
|
|
39232
39256
|
const p0 = (mask.alongU ? part.aabb[0] : part.aabb[1]) - mask.start, p1 = (mask.alongU ? part.aabb[2] : part.aabb[3]) - mask.start;
|
|
39233
|
-
|
|
39234
|
-
|
|
39235
|
-
|
|
39236
|
-
|
|
39237
|
-
|
|
39238
|
-
|
|
39257
|
+
const lying = p1 - p0 > part.y1 - part.y0;
|
|
39258
|
+
const random = (seed) => (n) => {
|
|
39259
|
+
const x = Math.sin(seed + n * 3.3) * 43758.5453;
|
|
39260
|
+
return x - Math.floor(x);
|
|
39261
|
+
};
|
|
39262
|
+
const faces = lying ? [[c.a, 1], [c.b, 2]] : [[c.y0, 1], [c.y1, 2]];
|
|
39263
|
+
for (const [face, f] of faces) {
|
|
39264
|
+
const open = gone.some((g) => g.part === part && g.c !== c && (lying ? Math.abs((f === 1 ? g.c.b : g.c.a) - face) < 1e-4 && g.c.y1 > c.y0 + 1e-4 && g.c.y0 < c.y1 - 1e-4 : Math.abs((f === 1 ? g.c.y1 : g.c.y0) - face) < 1e-4 && g.c.b > c.a + 1e-4 && g.c.a < c.b - 1e-4));
|
|
39265
|
+
if (open) continue;
|
|
39266
|
+
for (let k = 0; k < EDGE_LUMPS; k++) {
|
|
39267
|
+
const r = random(c.a * 63.1 + c.y0 * 29.7 + mid * 17.3 + f * 11.1 + k * 5.3);
|
|
39239
39268
|
const size = EDGE_LUMP_MIN + (EDGE_LUMP_MAX - EDGE_LUMP_MIN) * r(1);
|
|
39240
|
-
const
|
|
39241
|
-
const
|
|
39242
|
-
|
|
39269
|
+
const d = mid + (r(3) - 0.5) * (thick - 2 * LUMP_BAR_INSET);
|
|
39270
|
+
const s = lying ? face : c.a + (0.1 + 0.8 * r(2)) * (c.b - c.a);
|
|
39271
|
+
const y = lying ? c.y0 + (0.1 + 0.8 * r(2)) * (c.y1 - c.y0) : face;
|
|
39272
|
+
stone(s, y, d, [size, size * (0.6 + 0.5 * r(4)), size], r);
|
|
39243
39273
|
}
|
|
39244
39274
|
}
|
|
39245
|
-
const bars = [p0 + LUMP_BAR_INSET, p1 - LUMP_BAR_INSET].filter((s) => s >= c.a - 1e-6 && s <= c.b + 1e-6);
|
|
39246
|
-
for (const
|
|
39275
|
+
const bars = lying ? [part.y0 + LUMP_BAR_INSET, part.y1 - LUMP_BAR_INSET].filter((y) => y >= c.y0 - 1e-6 && y <= c.y1 + 1e-6) : [p0 + LUMP_BAR_INSET, p1 - LUMP_BAR_INSET].filter((s) => s >= c.a - 1e-6 && s <= c.b + 1e-6);
|
|
39276
|
+
for (const bar2 of bars) {
|
|
39247
39277
|
for (const side of [-1, 1]) {
|
|
39248
39278
|
const d = mid + side * (thick / 2 - LUMP_BAR_INSET);
|
|
39249
39279
|
for (let k = 0; k < LUMPS_PER_BAR; k++) {
|
|
39250
|
-
const r = (
|
|
39251
|
-
const x = Math.sin(s * 91.7 + d * 47.3 + c.y0 * 113.1 + k * 7.9 + n * 3.3) * 43758.5453;
|
|
39252
|
-
return x - Math.floor(x);
|
|
39253
|
-
};
|
|
39280
|
+
const r = random(bar2 * 91.7 + d * 47.3 + c.y0 * 113.1 + c.a * 19.9 + k * 7.9);
|
|
39254
39281
|
if (r(1) > LUMP_CHANCE) continue;
|
|
39255
|
-
const
|
|
39256
|
-
const
|
|
39257
|
-
const
|
|
39258
|
-
|
|
39259
|
-
if (unit) out.push(unit);
|
|
39282
|
+
const at4 = 0.15 + 0.7 * r(2), jitter = (r(6) - 0.5) * 0.02;
|
|
39283
|
+
const s = lying ? c.a + at4 * (c.b - c.a) : bar2 + jitter;
|
|
39284
|
+
const y = lying ? bar2 + jitter : c.y0 + at4 * (c.y1 - c.y0);
|
|
39285
|
+
stone(s, y, d, [LUMP_MIN + (LUMP_MAX - LUMP_MIN) * r(3), LUMP_MIN + (LUMP_MAX - LUMP_MIN) * r(4), LUMP_MIN + (LUMP_MAX - LUMP_MIN) * r(5)], r);
|
|
39260
39286
|
}
|
|
39261
39287
|
}
|
|
39262
39288
|
}
|
|
@@ -66587,66 +66613,58 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66587
66613
|
])
|
|
66588
66614
|
]
|
|
66589
66615
|
};
|
|
66616
|
+
var DEBRIS_EFFECT_FAMILIES = ["wood", "masonry", "glass", "metal", "soft", "soil"];
|
|
66617
|
+
var DEBRIS_COLOR_VARIABLE = "debrisColor";
|
|
66618
|
+
var DUST_COLOR_VARIABLE = "dustColor";
|
|
66619
|
+
var FAMILIES3 = {
|
|
66620
|
+
wood: { debris: 8017200, dust: 10127986, piece: [0.015, 0.015, 0.1], spin: 6, cloud: 0.5, sparks: false, glints: false },
|
|
66621
|
+
masonry: { debris: 10197652, dust: 11052187, piece: [0.035, 0.028, 0.035], spin: 4, cloud: 1, sparks: false, glints: false },
|
|
66622
|
+
glass: { debris: 11061464, dust: 12572386, piece: [0.04, 4e-3, 0.04], spin: 14, cloud: 0.25, sparks: false, glints: true },
|
|
66623
|
+
metal: { debris: 9080726, dust: 9078138, piece: [0.04, 6e-3, 0.03], spin: 8, cloud: 0.15, sparks: true, glints: false },
|
|
66624
|
+
soft: { debris: 10130568, dust: 11578014, piece: [0.025, 4e-3, 0.02], spin: 6, cloud: 0.3, sparks: false, glints: false },
|
|
66625
|
+
soil: { debris: 8022613, dust: 9075298, piece: [0.03, 0.025, 0.03], spin: 3, cloud: 1, sparks: false, glints: false }
|
|
66626
|
+
};
|
|
66627
|
+
var ORIGIN = [0, 0, 0];
|
|
66590
66628
|
var FACING4 = [0, 0, 1];
|
|
66591
66629
|
var UP11 = [0, 1, 0];
|
|
66592
|
-
var
|
|
66593
|
-
var
|
|
66594
|
-
var
|
|
66595
|
-
var
|
|
66596
|
-
|
|
66597
|
-
|
|
66598
|
-
|
|
66599
|
-
|
|
66600
|
-
|
|
66601
|
-
|
|
66602
|
-
|
|
66603
|
-
var muzzleEffect = (weapon) => ({
|
|
66604
|
-
id: `muzzle_${weapon}`,
|
|
66605
|
-
pageId: `event:muzzle_${weapon}`,
|
|
66606
|
-
team: "weapons",
|
|
66607
|
-
budget: { particles: 60, lights: 1 },
|
|
66608
|
-
loop: 2.4,
|
|
66609
|
-
timeline: [call2("muzzle", weapon, ORIGIN, FORWARD4)]
|
|
66610
|
-
});
|
|
66611
|
-
var casingEffect = (id, type) => ({
|
|
66612
|
-
id,
|
|
66613
|
-
pageId: `event:${id}`,
|
|
66614
|
-
team: "weapons",
|
|
66615
|
-
budget: { debris: 1 },
|
|
66616
|
-
loop: 2,
|
|
66617
|
-
timeline: [call2("casing", ORIGIN, type)]
|
|
66618
|
-
});
|
|
66619
|
-
var EVENT_EFFECTS = [
|
|
66620
|
-
...IMPACT_MATERIALS.map(impactEffect),
|
|
66621
|
-
...["glock", "ak", "r870", "barrett"].map(muzzleEffect),
|
|
66622
|
-
casingEffect("casing_brass", ""),
|
|
66623
|
-
casingEffect("casing_shell", "shell"),
|
|
66624
|
-
casingEffect("casing_50", "50"),
|
|
66625
|
-
{
|
|
66626
|
-
// door_stages (W856-871): the dust a blow shakes loose from the frame and the splinters.
|
|
66627
|
-
id: "stage_crack",
|
|
66628
|
-
pageId: "event:stage_crack",
|
|
66630
|
+
var grow = (piece2, factor) => [piece2[0] * factor, piece2[1] * factor, piece2[2] * factor];
|
|
66631
|
+
var debrisTone = (look) => or(variable(DEBRIS_COLOR_VARIABLE), look.debris);
|
|
66632
|
+
var dustTone = (look) => or(variable(DUST_COLOR_VARIABLE), look.dust);
|
|
66633
|
+
var sparks = (look, count) => look.sparks ? [call2("spark_at", ORIGIN, FACING4, count, 0.9)] : [];
|
|
66634
|
+
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 })] : [];
|
|
66635
|
+
function stageCrack(family) {
|
|
66636
|
+
const look = FAMILIES3[family];
|
|
66637
|
+
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 })];
|
|
66638
|
+
return {
|
|
66639
|
+
id: `stage_crack_${family}`,
|
|
66640
|
+
pageId: `event:stage_crack_${family}`,
|
|
66629
66641
|
team: "destruction",
|
|
66630
|
-
budget: { particles:
|
|
66642
|
+
budget: { particles: 16, debris: 6 },
|
|
66631
66643
|
loop: 2,
|
|
66632
66644
|
timeline: [
|
|
66633
|
-
|
|
66634
|
-
|
|
66645
|
+
...dust,
|
|
66646
|
+
...sparks(look, 8),
|
|
66647
|
+
...glints(look, 4),
|
|
66648
|
+
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 }))
|
|
66635
66649
|
]
|
|
66636
|
-
}
|
|
66637
|
-
|
|
66638
|
-
|
|
66639
|
-
|
|
66640
|
-
|
|
66650
|
+
};
|
|
66651
|
+
}
|
|
66652
|
+
function breachDust(family) {
|
|
66653
|
+
const look = FAMILIES3[family];
|
|
66654
|
+
return {
|
|
66655
|
+
id: `breach_dust_${family}`,
|
|
66656
|
+
pageId: `event:breach_dust_${family}`,
|
|
66641
66657
|
team: "destruction",
|
|
66642
66658
|
budget: { particles: 90, debris: 16 },
|
|
66643
66659
|
loop: 5,
|
|
66644
66660
|
timeline: [
|
|
66645
66661
|
screen({ add: { shake: 0.25 } }),
|
|
66646
|
-
|
|
66647
|
-
|
|
66662
|
+
...sparks(look, 14),
|
|
66663
|
+
...glints(look, 20),
|
|
66664
|
+
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 }),
|
|
66665
|
+
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 })),
|
|
66648
66666
|
repeat(
|
|
66649
|
-
scaled(60),
|
|
66667
|
+
scaled(Math.round(60 * look.cloud)),
|
|
66650
66668
|
spawn("normal", local("angle", rnd(0, 6.283), {
|
|
66651
66669
|
p: [rnd(-1.4, 1.4), 0.2, rnd(-0.6, 0.4)],
|
|
66652
66670
|
dir: vnorm([cos(variable("angle")), 0.3, sin(variable("angle"))]),
|
|
@@ -66656,27 +66674,30 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66656
66674
|
life: [2.5, 4.5],
|
|
66657
66675
|
size: [0.6, 1],
|
|
66658
66676
|
grow: 3,
|
|
66659
|
-
c0:
|
|
66677
|
+
c0: dustTone(look),
|
|
66660
66678
|
c1: 4867648,
|
|
66661
66679
|
a: 0.45,
|
|
66662
66680
|
fi: 0.12
|
|
66663
66681
|
}))
|
|
66664
66682
|
)
|
|
66665
66683
|
]
|
|
66666
|
-
}
|
|
66667
|
-
|
|
66668
|
-
|
|
66669
|
-
|
|
66670
|
-
|
|
66684
|
+
};
|
|
66685
|
+
}
|
|
66686
|
+
function collapseDust(family) {
|
|
66687
|
+
const look = FAMILIES3[family];
|
|
66688
|
+
return {
|
|
66689
|
+
id: `collapse_dust_${family}`,
|
|
66690
|
+
pageId: `event:collapse_dust_${family}`,
|
|
66671
66691
|
team: "destruction",
|
|
66672
66692
|
budget: { particles: 350, debris: 26 },
|
|
66673
66693
|
loop: 8,
|
|
66674
66694
|
timeline: [
|
|
66675
66695
|
screen({ add: { shake: 0.45 } }),
|
|
66676
|
-
|
|
66677
|
-
repeat(
|
|
66696
|
+
...sparks(look, 20),
|
|
66697
|
+
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 })),
|
|
66698
|
+
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 })),
|
|
66678
66699
|
repeat(
|
|
66679
|
-
scaled(70),
|
|
66700
|
+
scaled(Math.round(70 * look.cloud)),
|
|
66680
66701
|
spawn("normal", local("angle", rnd(-0.4, 3.5), {
|
|
66681
66702
|
p: [rnd(-2, 2), 0.2, rnd(-0.5, 0.5)],
|
|
66682
66703
|
dir: vnorm([mul(cos(variable("angle")), 0.6), 0.25, sin(variable("angle"))]),
|
|
@@ -66686,14 +66707,66 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66686
66707
|
life: [3, 6],
|
|
66687
66708
|
size: [0.7, 1.2],
|
|
66688
66709
|
grow: 3,
|
|
66689
|
-
c0:
|
|
66710
|
+
c0: dustTone(look),
|
|
66690
66711
|
c1: 4867648,
|
|
66691
66712
|
a: 0.5,
|
|
66692
66713
|
fi: 0.12
|
|
66693
66714
|
}))
|
|
66694
66715
|
)
|
|
66695
66716
|
]
|
|
66696
|
-
}
|
|
66717
|
+
};
|
|
66718
|
+
}
|
|
66719
|
+
var MASONRY = FAMILIES3.masonry;
|
|
66720
|
+
var REBAR_EXPOSE = {
|
|
66721
|
+
id: "rebar_expose",
|
|
66722
|
+
pageId: "event:rebar_expose",
|
|
66723
|
+
team: "destruction",
|
|
66724
|
+
budget: { particles: 24, debris: 8 },
|
|
66725
|
+
loop: 2,
|
|
66726
|
+
timeline: [
|
|
66727
|
+
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 })),
|
|
66728
|
+
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 }),
|
|
66729
|
+
call2("rust_at", ORIGIN, 6)
|
|
66730
|
+
]
|
|
66731
|
+
};
|
|
66732
|
+
var MATERIAL_EVENT_EFFECTS = [
|
|
66733
|
+
...DEBRIS_EFFECT_FAMILIES.flatMap((family) => [stageCrack(family), breachDust(family), collapseDust(family)]),
|
|
66734
|
+
REBAR_EXPOSE
|
|
66735
|
+
];
|
|
66736
|
+
var FACING5 = [0, 0, 1];
|
|
66737
|
+
var ORIGIN2 = [0, 0, 0];
|
|
66738
|
+
var FORWARD4 = [0, 0, -1];
|
|
66739
|
+
var IMPACT_MATERIALS = ["concrete", "metal", "wood", "glass", "flesh", "water"];
|
|
66740
|
+
var impactEffect = (material) => ({
|
|
66741
|
+
id: `impact_${material}`,
|
|
66742
|
+
pageId: `event:impact_${material}`,
|
|
66743
|
+
team: "weapons",
|
|
66744
|
+
budget: { particles: 40, decals: 1 },
|
|
66745
|
+
loop: 2,
|
|
66746
|
+
timeline: [call2("impact", material, ORIGIN2, FACING5, 1, 0)]
|
|
66747
|
+
});
|
|
66748
|
+
var muzzleEffect = (weapon) => ({
|
|
66749
|
+
id: `muzzle_${weapon}`,
|
|
66750
|
+
pageId: `event:muzzle_${weapon}`,
|
|
66751
|
+
team: "weapons",
|
|
66752
|
+
budget: { particles: 60, lights: 1 },
|
|
66753
|
+
loop: 2.4,
|
|
66754
|
+
timeline: [call2("muzzle", weapon, ORIGIN2, FORWARD4)]
|
|
66755
|
+
});
|
|
66756
|
+
var casingEffect = (id, type) => ({
|
|
66757
|
+
id,
|
|
66758
|
+
pageId: `event:${id}`,
|
|
66759
|
+
team: "weapons",
|
|
66760
|
+
budget: { debris: 1 },
|
|
66761
|
+
loop: 2,
|
|
66762
|
+
timeline: [call2("casing", ORIGIN2, type)]
|
|
66763
|
+
});
|
|
66764
|
+
var EVENT_EFFECTS = [
|
|
66765
|
+
...IMPACT_MATERIALS.map(impactEffect),
|
|
66766
|
+
...["glock", "ak", "r870", "barrett"].map(muzzleEffect),
|
|
66767
|
+
casingEffect("casing_brass", ""),
|
|
66768
|
+
casingEffect("casing_shell", "shell"),
|
|
66769
|
+
casingEffect("casing_50", "50"),
|
|
66697
66770
|
{
|
|
66698
66771
|
// shopfront_glass (W846-855): the pane coming down as shards, the flash of the glints and the pale dust.
|
|
66699
66772
|
id: "glass_burst",
|
|
@@ -66705,21 +66778,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66705
66778
|
screen({ add: { shake: 0.08 } }),
|
|
66706
66779
|
repeat(
|
|
66707
66780
|
scaled(75),
|
|
66708
|
-
debris({ p:
|
|
66781
|
+
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 })
|
|
66709
66782
|
),
|
|
66710
|
-
burst("add", 30, { p:
|
|
66783
|
+
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 }),
|
|
66711
66784
|
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 })
|
|
66712
66785
|
]
|
|
66713
66786
|
},
|
|
66714
|
-
|
|
66715
|
-
// The chips macro the page uses on wood (W849) plus rust (`rustAt`), for rebar laid bare in concrete.
|
|
66716
|
-
id: "rebar_expose",
|
|
66717
|
-
pageId: "event:rebar_expose",
|
|
66718
|
-
team: "destruction",
|
|
66719
|
-
budget: { particles: 20, debris: 8 },
|
|
66720
|
-
loop: 2,
|
|
66721
|
-
timeline: [call2("chips", ORIGIN, UP11, 8, 0.9), call2("rust_at", ORIGIN, 6)]
|
|
66722
|
-
}
|
|
66787
|
+
...MATERIAL_EVENT_EFFECTS
|
|
66723
66788
|
];
|
|
66724
66789
|
var PI16 = Math.PI;
|
|
66725
66790
|
var SMOKE = { color: 9079430, width: 10, height: 8, gravity: -0.08, drag: 2.2, growth: 2.1 };
|
|
@@ -66730,7 +66795,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66730
66795
|
var FLASH_OPACITY = 0.95;
|
|
66731
66796
|
var FLAME_COLORS = [16742946, 16760896, 13121050, 16773296];
|
|
66732
66797
|
var FLAME_ADDITIVE = 3;
|
|
66733
|
-
var
|
|
66798
|
+
var ORIGIN3 = [0, 0, 0];
|
|
66734
66799
|
var SIZE = variable("size");
|
|
66735
66800
|
var FLASH_SCALE = variable("flash");
|
|
66736
66801
|
var fallback = (name, defaultValue) => ite(ne(variable(name), void 0), variable(name), defaultValue);
|
|
@@ -66778,7 +66843,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66778
66843
|
grow: 2.2
|
|
66779
66844
|
})
|
|
66780
66845
|
];
|
|
66781
|
-
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:
|
|
66846
|
+
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 });
|
|
66782
66847
|
var MUZZLE_FLASH2 = {
|
|
66783
66848
|
id: "viewmodel_muzzle_flash",
|
|
66784
66849
|
pageId: "event:viewmodel_muzzle_flash",
|
|
@@ -66805,7 +66870,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66805
66870
|
repeat(4, append("angles", add(div(mul(INDEX, PI16), 2), mul(rand(), 0.6)))),
|
|
66806
66871
|
set("roll", mul(rand(), PI16)),
|
|
66807
66872
|
when(gt(FLASH_SCALE, 0), [
|
|
66808
|
-
flash(
|
|
66873
|
+
flash(ORIGIN3, 16756832, mul(4, SIZE, FLASH_SCALE), FLASH_SECONDS, mul(2, SIZE, FLASH_SCALE), true, true),
|
|
66809
66874
|
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),
|
|
66810
66875
|
repeat(
|
|
66811
66876
|
4,
|
|
@@ -66825,7 +66890,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66825
66890
|
repeat(
|
|
66826
66891
|
variable("puffs"),
|
|
66827
66892
|
puff2(
|
|
66828
|
-
|
|
66893
|
+
ORIGIN3,
|
|
66829
66894
|
[add(variable("drift"), mul(rand(), variable("driftSpread"))), add(variable("rise"), mul(rand(), variable("riseSpread"))), mul(sub(rand(), 0.5), variable("sideSpread"))],
|
|
66830
66895
|
[0, 0, 0],
|
|
66831
66896
|
mul(variable("radius"), SIZE),
|
|
@@ -66842,7 +66907,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66842
66907
|
team: "weapons",
|
|
66843
66908
|
budget: { particles: 1 },
|
|
66844
66909
|
loop: 0.1,
|
|
66845
|
-
timeline: [puff2(
|
|
66910
|
+
timeline: [puff2(ORIGIN3, void 0, [variable("vx"), variable("vy"), variable("vz")], variable("radius"), variable("life"), variable("opacity"))]
|
|
66846
66911
|
};
|
|
66847
66912
|
var BACKBLAST = {
|
|
66848
66913
|
id: "launcher_backblast",
|
|
@@ -66851,8 +66916,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66851
66916
|
budget: { particles: 40 },
|
|
66852
66917
|
loop: 0.1,
|
|
66853
66918
|
timeline: [
|
|
66854
|
-
repeat(26, puff2(
|
|
66855
|
-
repeat(14, ...flameBit(
|
|
66919
|
+
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)),
|
|
66920
|
+
repeat(14, ...flameBit(ORIGIN3, [neg(add(2, mul(rand(), 2))), 0, 0], [wide(1), wide(0.6), wide(1)], 0.02, 0.25))
|
|
66856
66921
|
]
|
|
66857
66922
|
};
|
|
66858
66923
|
var FLAME_JET = {
|
|
@@ -66971,7 +67036,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66971
67036
|
}
|
|
66972
67037
|
var COLUMNS = 6;
|
|
66973
67038
|
var ROWS = 5;
|
|
66974
|
-
var
|
|
67039
|
+
var ORIGIN4 = [-2.2, 0, 2.6];
|
|
66975
67040
|
var BLOCK_SIZE = [0.5, 0.44, 0.25];
|
|
66976
67041
|
var OBJECT_ID_DRAWS2 = 4;
|
|
66977
67042
|
var FLOOR2 = 0.13;
|
|
@@ -67014,7 +67079,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67014
67079
|
const chipScale = random.between(0.8, 1.3) * scale;
|
|
67015
67080
|
for (let draw2 = 0; draw2 < OBJECT_ID_DRAWS2; draw2++) random.next();
|
|
67016
67081
|
best.holes.push({ x: offsetX, y: offsetY, scale, chipTurn, chipScale });
|
|
67017
|
-
impact(host.engine, "concrete", [
|
|
67082
|
+
impact(host.engine, "concrete", [ORIGIN4[0] + x, y, ORIGIN4[2] + 0.13], [0, 0, 1], 0.8);
|
|
67018
67083
|
} else if (action === "collapse") {
|
|
67019
67084
|
const { x, y } = args;
|
|
67020
67085
|
for (const block of blocks) {
|
|
@@ -67064,7 +67129,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67064
67129
|
}
|
|
67065
67130
|
};
|
|
67066
67131
|
}
|
|
67067
|
-
var
|
|
67132
|
+
var ORIGIN5 = [5.6, 0, 0.8];
|
|
67068
67133
|
var MAX_TILT = 0.25;
|
|
67069
67134
|
function createCarBehavior() {
|
|
67070
67135
|
let y = 0;
|
|
@@ -67097,7 +67162,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67097
67162
|
}
|
|
67098
67163
|
},
|
|
67099
67164
|
query(_host, name, args) {
|
|
67100
|
-
if (name === "position") return [
|
|
67165
|
+
if (name === "position") return [ORIGIN5[0], y, ORIGIN5[2]];
|
|
67101
67166
|
if (name === "point") {
|
|
67102
67167
|
const [x, py, z] = args;
|
|
67103
67168
|
const point = carPoint(x, py, z);
|
|
@@ -67969,7 +68034,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67969
68034
|
this.index = previous;
|
|
67970
68035
|
}
|
|
67971
68036
|
};
|
|
67972
|
-
var
|
|
68037
|
+
var ORIGIN6 = [0, 0, 0];
|
|
67973
68038
|
var DEFAULT_HEADING = [0, 0, -1];
|
|
67974
68039
|
var DEFAULT_MAX_INSTANCES = 48;
|
|
67975
68040
|
var ENDLESS_SECONDS = 60;
|
|
@@ -68046,7 +68111,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
68046
68111
|
random: playOptions.seed !== void 0 ? streamOf(playOptions.seed) : void 0,
|
|
68047
68112
|
follow: playOptions.follow,
|
|
68048
68113
|
origin: point,
|
|
68049
|
-
anchor: def.anchor ??
|
|
68114
|
+
anchor: def.anchor ?? ORIGIN6,
|
|
68050
68115
|
yaw: yawOf(heading, playOptions.direction),
|
|
68051
68116
|
orientation: playOptions.orientation,
|
|
68052
68117
|
seconds: playOptions.seconds ?? (def.loop && def.loop > 0 ? def.loop : ENDLESS_SECONDS),
|
|
@@ -70682,6 +70747,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
70682
70747
|
catalog: () => [.../* @__PURE__ */ new Set([...Object.keys(explosions), ...Object.keys(aliases)])]
|
|
70683
70748
|
};
|
|
70684
70749
|
}
|
|
70750
|
+
var DEGREES = 180 / Math.PI;
|
|
70685
70751
|
|
|
70686
70752
|
// ../game-vfx-three/dist/chunk-HJXLYDNY.js
|
|
70687
70753
|
var GLOW_VERTEX = `attribute vec4 aP;attribute vec4 aC;varying vec2 vU;varying vec4 vC;
|
|
@@ -72041,7 +72107,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72041
72107
|
uTime: { value: 0 }
|
|
72042
72108
|
};
|
|
72043
72109
|
const puffs = createPuffLayer(THREE, pools.puffs, uniforms);
|
|
72044
|
-
const
|
|
72110
|
+
const sparks2 = createSparkLayer(THREE, pools.sparks);
|
|
72045
72111
|
const glows = createGlowLayer(THREE, pools.glows);
|
|
72046
72112
|
const rockGeometry = new THREE.DodecahedronGeometry(0.5, 0);
|
|
72047
72113
|
const plateGeometry = new THREE.BoxGeometry(1, 1, 1);
|
|
@@ -72050,7 +72116,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72050
72116
|
const sprites = createSpriteLayer(THREE, world.sprites(), options.pointScale ?? 700);
|
|
72051
72117
|
const lights = createLightLayer(THREE, pools.lights, options.lightScale ?? Math.PI, options.lights);
|
|
72052
72118
|
const marks = createMarkLayer(THREE, { ground: pools.ground, ...world.hostGroundAt ? { heightAt: world.hostGroundAt } : {}, createCanvas: options.createCanvas, rockGeometry, plateGeometry, ...options.markLimits });
|
|
72053
|
-
root.add(puffs.mesh,
|
|
72119
|
+
root.add(puffs.mesh, sparks2.mesh, glows.mesh, chunks.rocks, chunks.plates, shocks.group, lights.group, sprites.additive, sprites.normal, marks.group);
|
|
72054
72120
|
const stopMarks = world.onMarks((event) => marks.handle(event));
|
|
72055
72121
|
const overlay = options.overlay ? createScreenOverlay(options.overlay) : void 0;
|
|
72056
72122
|
let drawCalls = 0;
|
|
@@ -72059,7 +72125,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72059
72125
|
const layerOn = /* @__PURE__ */ new Map();
|
|
72060
72126
|
const layerObjects = () => ({
|
|
72061
72127
|
puffs: [puffs.mesh],
|
|
72062
|
-
sparks: [
|
|
72128
|
+
sparks: [sparks2.mesh],
|
|
72063
72129
|
glows: [glows.mesh],
|
|
72064
72130
|
debris: [chunks.rocks, chunks.plates],
|
|
72065
72131
|
shock: [shocks.group],
|
|
@@ -72087,7 +72153,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72087
72153
|
}
|
|
72088
72154
|
function syncAll() {
|
|
72089
72155
|
lastDrawn.puffs = puffs.sync();
|
|
72090
|
-
lastDrawn.sparks =
|
|
72156
|
+
lastDrawn.sparks = sparks2.sync();
|
|
72091
72157
|
lastDrawn.glows = glows.sync();
|
|
72092
72158
|
lastDrawn.chunks = chunks.sync();
|
|
72093
72159
|
lastDrawn.shocks = shocks.sync();
|
|
@@ -72188,7 +72254,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72188
72254
|
stopMarks();
|
|
72189
72255
|
overlay?.dispose();
|
|
72190
72256
|
workshopLayers?.dispose();
|
|
72191
|
-
for (const layer22 of [puffs,
|
|
72257
|
+
for (const layer22 of [puffs, sparks2, glows, chunks, shocks, lights, marks, sprites]) layer22.dispose();
|
|
72192
72258
|
rockGeometry.dispose();
|
|
72193
72259
|
plateGeometry.dispose();
|
|
72194
72260
|
options.scene.remove(root);
|
|
@@ -72197,6 +72263,42 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72197
72263
|
}
|
|
72198
72264
|
var LIGHT_BUDGET = EVENT_BUDGET.blastLights + EVENT_BUDGET.fireLights;
|
|
72199
72265
|
|
|
72266
|
+
// ../game-vfx-three/dist/index.js
|
|
72267
|
+
var NOISE = `float wHash(vec2 p){return fract(sin(dot(p,vec2(12.9898,78.233)))*43758.5453);}
|
|
72268
|
+
float wNoise(vec2 p){vec2 i=floor(p);vec2 f=fract(p);f=f*f*(3.-2.*f);return mix(mix(wHash(i),wHash(i+vec2(1.,0.)),f.x),mix(wHash(i+vec2(0.,1.)),wHash(i+vec2(1.,1.)),f.x),f.y);}`;
|
|
72269
|
+
var OUTPUT = `
|
|
72270
|
+
#include <tonemapping_fragment>
|
|
72271
|
+
#include <colorspace_fragment>`;
|
|
72272
|
+
var WATER_SURFACE_FRAGMENT = `uniform vec3 uFoam;varying vec2 vU;varying vec3 vD;${NOISE}
|
|
72273
|
+
void main(){float r=length(vU);if(r>1.)discard;float a=atan(vU.y,vU.x);float kind=vD.y;float s=vD.z;float m;
|
|
72274
|
+
if(kind>2.5){float n=wNoise(vU*7.+s*13.)*.6+wNoise(vU*19.-s*7.)*.4;m=smoothstep(1.,.55,r)*smoothstep(.25,.6,n);}
|
|
72275
|
+
else{float w=kind>1.5?.16:kind>.5?.05:.09;float band=smoothstep(1.,1.-w,r)*smoothstep(1.-w*3.,1.-w,r);float broken=kind>.5?1.:.65+.35*wNoise(vec2(a*5.+s*20.,s));m=band*broken;}
|
|
72276
|
+
float alpha=m*vD.x;if(alpha<.004)discard;gl_FragColor=vec4(uFoam,alpha);${OUTPUT}
|
|
72277
|
+
}`;
|
|
72278
|
+
var WATER_SPRITE_FRAGMENT = `uniform vec3 uFoam;uniform vec3 uDeep;varying vec2 vU;varying vec3 vD;${NOISE}
|
|
72279
|
+
void main(){float r=length(vU);if(r>1.)discard;float kind=vD.y;float m;vec3 c=uFoam;
|
|
72280
|
+
if(kind>1.5){m=exp(-r*r*3.)*(.75+.25*wNoise(vU*3.+vD.z*9.));}
|
|
72281
|
+
else if(kind>.5){m=smoothstep(.55,.85,r)*smoothstep(1.,.88,r)+.25*smoothstep(.5,.2,length(vU-vec2(-.3,.3)));c=mix(uDeep,uFoam,.8);}
|
|
72282
|
+
else{m=smoothstep(1.,.6,r);c=mix(uDeep,uFoam,.55+.45*smoothstep(.2,.8,1.-length(vU-vec2(-.3,.35))));}
|
|
72283
|
+
float alpha=m*vD.x;if(alpha<.004)discard;gl_FragColor=vec4(c,alpha);${OUTPUT}
|
|
72284
|
+
}`;
|
|
72285
|
+
var WATER_COLUMN_VERTEX = `attribute vec4 aP;attribute vec4 aD;attribute vec2 aK;varying float vY;varying float vA;varying vec2 vK;varying float vF;${NOISE}
|
|
72286
|
+
void main(){vY=position.y;float ang=atan(position.z,position.x);vK=aK;
|
|
72287
|
+
float dome=aK.x;float s=aK.y;float h=position.y;
|
|
72288
|
+
float jag=.8+.4*wNoise(vec2(ang*3.+s*17.,h*4.+s));
|
|
72289
|
+
float flare=dome>.5?1.:(.55+.9*h*h)*jag;
|
|
72290
|
+
vec3 p=vec3(position.x*aP.w*flare,position.y*aD.x,position.z*aP.w*flare);
|
|
72291
|
+
p.x+=aD.z*aD.x*h*h;p.z+=aD.w*aD.x*h*h;
|
|
72292
|
+
vec3 w=aP.xyz+p;vec3 n=normalize(vec3(position.x,dome>.5?position.y:.25,position.z));
|
|
72293
|
+
vec3 v=normalize(cameraPosition-w);vF=abs(dot(n,v));
|
|
72294
|
+
vA=aD.y;gl_Position=projectionMatrix*viewMatrix*vec4(w,1.);}`;
|
|
72295
|
+
var WATER_COLUMN_FRAGMENT = `uniform vec3 uFoam;uniform vec3 uDeep;varying float vY;varying float vA;varying vec2 vK;varying float vF;${NOISE}
|
|
72296
|
+
void main(){float dome=vK.x;float s=vK.y;
|
|
72297
|
+
float streak=wNoise(vec2(gl_FragCoord.x*.05+s*31.,vY*6.+s));
|
|
72298
|
+
float body=dome>.5?mix(.95,.5,vY)*(.6+.4*(1.-vF)):(1.-smoothstep(.55,1.,vY))*(.45+.55*streak)*(.55+.45*(1.-vF*.6));
|
|
72299
|
+
vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)discard;gl_FragColor=vec4(c,alpha);${OUTPUT}
|
|
72300
|
+
}`;
|
|
72301
|
+
|
|
72200
72302
|
// src/fx/effects.ts
|
|
72201
72303
|
var FLASH_BY_CASE = { shell: 1.6, big: 2.6, tiny: 0.5, pistol: 0.8, rifle: 1.2 };
|
|
72202
72304
|
var VIEWMODEL_EFFECT_IDS = { flash: "viewmodel_muzzle_flash", smoke: "weapon_smoke_puff", backblast: "launcher_backblast", flameJet: "flame_jet" };
|