@adatechnology/game-weapons-three 0.21.5 → 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 +152 -92
- package/dist/index.global.js.map +1 -1
- package/package.json +5 -5
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;
|
|
@@ -26842,6 +26843,25 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26842
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]));
|
|
26843
26844
|
return len;
|
|
26844
26845
|
};
|
|
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
|
+
};
|
|
26845
26865
|
const isTrim = (p) => (p.spec.structure?.role ?? "none") === "none";
|
|
26846
26866
|
const wearJoints = (o, p, amount, near, radius = 0.06, src, split = false, span, blast) => {
|
|
26847
26867
|
if (amount <= 0) return;
|
|
@@ -26853,6 +26873,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
26853
26873
|
if (near && jointReach(o, j, near) > Math.max(radius, jointReachLimit(o, j))) continue;
|
|
26854
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;
|
|
26855
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);
|
|
26856
26877
|
if (j.st.hp <= 0) {
|
|
26857
26878
|
j.st.hp = 0;
|
|
26858
26879
|
j.st.open = true;
|
|
@@ -29995,9 +30016,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
29995
30016
|
if (!(span > 1.5) || !Number.isFinite(span)) return part;
|
|
29996
30017
|
const depth = Math.max(part.y1 - part.y0, beamDepthFor(span, options));
|
|
29997
30018
|
const wide2 = Math.max(width, round2(depth / options.beamWidthRatio));
|
|
29998
|
-
const
|
|
30019
|
+
const grow2 = (wide2 - width) / 2;
|
|
29999
30020
|
changed = true;
|
|
30000
|
-
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]];
|
|
30001
30022
|
return make2({ ...part, aabb, y0: part.y1 - depth });
|
|
30002
30023
|
});
|
|
30003
30024
|
return changed ? { parts, supports: input.supports } : input;
|
|
@@ -66592,66 +66613,58 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66592
66613
|
])
|
|
66593
66614
|
]
|
|
66594
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];
|
|
66595
66628
|
var FACING4 = [0, 0, 1];
|
|
66596
66629
|
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",
|
|
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}`,
|
|
66634
66641
|
team: "destruction",
|
|
66635
|
-
budget: { particles:
|
|
66642
|
+
budget: { particles: 16, debris: 6 },
|
|
66636
66643
|
loop: 2,
|
|
66637
66644
|
timeline: [
|
|
66638
|
-
|
|
66639
|
-
|
|
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 }))
|
|
66640
66649
|
]
|
|
66641
|
-
}
|
|
66642
|
-
|
|
66643
|
-
|
|
66644
|
-
|
|
66645
|
-
|
|
66650
|
+
};
|
|
66651
|
+
}
|
|
66652
|
+
function breachDust(family) {
|
|
66653
|
+
const look = FAMILIES3[family];
|
|
66654
|
+
return {
|
|
66655
|
+
id: `breach_dust_${family}`,
|
|
66656
|
+
pageId: `event:breach_dust_${family}`,
|
|
66646
66657
|
team: "destruction",
|
|
66647
66658
|
budget: { particles: 90, debris: 16 },
|
|
66648
66659
|
loop: 5,
|
|
66649
66660
|
timeline: [
|
|
66650
66661
|
screen({ add: { shake: 0.25 } }),
|
|
66651
|
-
|
|
66652
|
-
|
|
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 })),
|
|
66653
66666
|
repeat(
|
|
66654
|
-
scaled(60),
|
|
66667
|
+
scaled(Math.round(60 * look.cloud)),
|
|
66655
66668
|
spawn("normal", local("angle", rnd(0, 6.283), {
|
|
66656
66669
|
p: [rnd(-1.4, 1.4), 0.2, rnd(-0.6, 0.4)],
|
|
66657
66670
|
dir: vnorm([cos(variable("angle")), 0.3, sin(variable("angle"))]),
|
|
@@ -66661,27 +66674,30 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66661
66674
|
life: [2.5, 4.5],
|
|
66662
66675
|
size: [0.6, 1],
|
|
66663
66676
|
grow: 3,
|
|
66664
|
-
c0:
|
|
66677
|
+
c0: dustTone(look),
|
|
66665
66678
|
c1: 4867648,
|
|
66666
66679
|
a: 0.45,
|
|
66667
66680
|
fi: 0.12
|
|
66668
66681
|
}))
|
|
66669
66682
|
)
|
|
66670
66683
|
]
|
|
66671
|
-
}
|
|
66672
|
-
|
|
66673
|
-
|
|
66674
|
-
|
|
66675
|
-
|
|
66684
|
+
};
|
|
66685
|
+
}
|
|
66686
|
+
function collapseDust(family) {
|
|
66687
|
+
const look = FAMILIES3[family];
|
|
66688
|
+
return {
|
|
66689
|
+
id: `collapse_dust_${family}`,
|
|
66690
|
+
pageId: `event:collapse_dust_${family}`,
|
|
66676
66691
|
team: "destruction",
|
|
66677
66692
|
budget: { particles: 350, debris: 26 },
|
|
66678
66693
|
loop: 8,
|
|
66679
66694
|
timeline: [
|
|
66680
66695
|
screen({ add: { shake: 0.45 } }),
|
|
66681
|
-
|
|
66682
|
-
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 })),
|
|
66683
66699
|
repeat(
|
|
66684
|
-
scaled(70),
|
|
66700
|
+
scaled(Math.round(70 * look.cloud)),
|
|
66685
66701
|
spawn("normal", local("angle", rnd(-0.4, 3.5), {
|
|
66686
66702
|
p: [rnd(-2, 2), 0.2, rnd(-0.5, 0.5)],
|
|
66687
66703
|
dir: vnorm([mul(cos(variable("angle")), 0.6), 0.25, sin(variable("angle"))]),
|
|
@@ -66691,14 +66707,66 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66691
66707
|
life: [3, 6],
|
|
66692
66708
|
size: [0.7, 1.2],
|
|
66693
66709
|
grow: 3,
|
|
66694
|
-
c0:
|
|
66710
|
+
c0: dustTone(look),
|
|
66695
66711
|
c1: 4867648,
|
|
66696
66712
|
a: 0.5,
|
|
66697
66713
|
fi: 0.12
|
|
66698
66714
|
}))
|
|
66699
66715
|
)
|
|
66700
66716
|
]
|
|
66701
|
-
}
|
|
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"),
|
|
66702
66770
|
{
|
|
66703
66771
|
// shopfront_glass (W846-855): the pane coming down as shards, the flash of the glints and the pale dust.
|
|
66704
66772
|
id: "glass_burst",
|
|
@@ -66710,21 +66778,13 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66710
66778
|
screen({ add: { shake: 0.08 } }),
|
|
66711
66779
|
repeat(
|
|
66712
66780
|
scaled(75),
|
|
66713
|
-
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 })
|
|
66714
66782
|
),
|
|
66715
|
-
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 }),
|
|
66716
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 })
|
|
66717
66785
|
]
|
|
66718
66786
|
},
|
|
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
|
-
}
|
|
66787
|
+
...MATERIAL_EVENT_EFFECTS
|
|
66728
66788
|
];
|
|
66729
66789
|
var PI16 = Math.PI;
|
|
66730
66790
|
var SMOKE = { color: 9079430, width: 10, height: 8, gravity: -0.08, drag: 2.2, growth: 2.1 };
|
|
@@ -66735,7 +66795,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66735
66795
|
var FLASH_OPACITY = 0.95;
|
|
66736
66796
|
var FLAME_COLORS = [16742946, 16760896, 13121050, 16773296];
|
|
66737
66797
|
var FLAME_ADDITIVE = 3;
|
|
66738
|
-
var
|
|
66798
|
+
var ORIGIN3 = [0, 0, 0];
|
|
66739
66799
|
var SIZE = variable("size");
|
|
66740
66800
|
var FLASH_SCALE = variable("flash");
|
|
66741
66801
|
var fallback = (name, defaultValue) => ite(ne(variable(name), void 0), variable(name), defaultValue);
|
|
@@ -66783,7 +66843,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66783
66843
|
grow: 2.2
|
|
66784
66844
|
})
|
|
66785
66845
|
];
|
|
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:
|
|
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 });
|
|
66787
66847
|
var MUZZLE_FLASH2 = {
|
|
66788
66848
|
id: "viewmodel_muzzle_flash",
|
|
66789
66849
|
pageId: "event:viewmodel_muzzle_flash",
|
|
@@ -66810,7 +66870,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66810
66870
|
repeat(4, append("angles", add(div(mul(INDEX, PI16), 2), mul(rand(), 0.6)))),
|
|
66811
66871
|
set("roll", mul(rand(), PI16)),
|
|
66812
66872
|
when(gt(FLASH_SCALE, 0), [
|
|
66813
|
-
flash(
|
|
66873
|
+
flash(ORIGIN3, 16756832, mul(4, SIZE, FLASH_SCALE), FLASH_SECONDS, mul(2, SIZE, FLASH_SCALE), true, true),
|
|
66814
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),
|
|
66815
66875
|
repeat(
|
|
66816
66876
|
4,
|
|
@@ -66830,7 +66890,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66830
66890
|
repeat(
|
|
66831
66891
|
variable("puffs"),
|
|
66832
66892
|
puff2(
|
|
66833
|
-
|
|
66893
|
+
ORIGIN3,
|
|
66834
66894
|
[add(variable("drift"), mul(rand(), variable("driftSpread"))), add(variable("rise"), mul(rand(), variable("riseSpread"))), mul(sub(rand(), 0.5), variable("sideSpread"))],
|
|
66835
66895
|
[0, 0, 0],
|
|
66836
66896
|
mul(variable("radius"), SIZE),
|
|
@@ -66847,7 +66907,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66847
66907
|
team: "weapons",
|
|
66848
66908
|
budget: { particles: 1 },
|
|
66849
66909
|
loop: 0.1,
|
|
66850
|
-
timeline: [puff2(
|
|
66910
|
+
timeline: [puff2(ORIGIN3, void 0, [variable("vx"), variable("vy"), variable("vz")], variable("radius"), variable("life"), variable("opacity"))]
|
|
66851
66911
|
};
|
|
66852
66912
|
var BACKBLAST = {
|
|
66853
66913
|
id: "launcher_backblast",
|
|
@@ -66856,8 +66916,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66856
66916
|
budget: { particles: 40 },
|
|
66857
66917
|
loop: 0.1,
|
|
66858
66918
|
timeline: [
|
|
66859
|
-
repeat(26, puff2(
|
|
66860
|
-
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))
|
|
66861
66921
|
]
|
|
66862
66922
|
};
|
|
66863
66923
|
var FLAME_JET = {
|
|
@@ -66976,7 +67036,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
66976
67036
|
}
|
|
66977
67037
|
var COLUMNS = 6;
|
|
66978
67038
|
var ROWS = 5;
|
|
66979
|
-
var
|
|
67039
|
+
var ORIGIN4 = [-2.2, 0, 2.6];
|
|
66980
67040
|
var BLOCK_SIZE = [0.5, 0.44, 0.25];
|
|
66981
67041
|
var OBJECT_ID_DRAWS2 = 4;
|
|
66982
67042
|
var FLOOR2 = 0.13;
|
|
@@ -67019,7 +67079,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67019
67079
|
const chipScale = random.between(0.8, 1.3) * scale;
|
|
67020
67080
|
for (let draw2 = 0; draw2 < OBJECT_ID_DRAWS2; draw2++) random.next();
|
|
67021
67081
|
best.holes.push({ x: offsetX, y: offsetY, scale, chipTurn, chipScale });
|
|
67022
|
-
impact(host.engine, "concrete", [
|
|
67082
|
+
impact(host.engine, "concrete", [ORIGIN4[0] + x, y, ORIGIN4[2] + 0.13], [0, 0, 1], 0.8);
|
|
67023
67083
|
} else if (action === "collapse") {
|
|
67024
67084
|
const { x, y } = args;
|
|
67025
67085
|
for (const block of blocks) {
|
|
@@ -67069,7 +67129,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67069
67129
|
}
|
|
67070
67130
|
};
|
|
67071
67131
|
}
|
|
67072
|
-
var
|
|
67132
|
+
var ORIGIN5 = [5.6, 0, 0.8];
|
|
67073
67133
|
var MAX_TILT = 0.25;
|
|
67074
67134
|
function createCarBehavior() {
|
|
67075
67135
|
let y = 0;
|
|
@@ -67102,7 +67162,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67102
67162
|
}
|
|
67103
67163
|
},
|
|
67104
67164
|
query(_host, name, args) {
|
|
67105
|
-
if (name === "position") return [
|
|
67165
|
+
if (name === "position") return [ORIGIN5[0], y, ORIGIN5[2]];
|
|
67106
67166
|
if (name === "point") {
|
|
67107
67167
|
const [x, py, z] = args;
|
|
67108
67168
|
const point = carPoint(x, py, z);
|
|
@@ -67974,7 +68034,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
67974
68034
|
this.index = previous;
|
|
67975
68035
|
}
|
|
67976
68036
|
};
|
|
67977
|
-
var
|
|
68037
|
+
var ORIGIN6 = [0, 0, 0];
|
|
67978
68038
|
var DEFAULT_HEADING = [0, 0, -1];
|
|
67979
68039
|
var DEFAULT_MAX_INSTANCES = 48;
|
|
67980
68040
|
var ENDLESS_SECONDS = 60;
|
|
@@ -68051,7 +68111,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
68051
68111
|
random: playOptions.seed !== void 0 ? streamOf(playOptions.seed) : void 0,
|
|
68052
68112
|
follow: playOptions.follow,
|
|
68053
68113
|
origin: point,
|
|
68054
|
-
anchor: def.anchor ??
|
|
68114
|
+
anchor: def.anchor ?? ORIGIN6,
|
|
68055
68115
|
yaw: yawOf(heading, playOptions.direction),
|
|
68056
68116
|
orientation: playOptions.orientation,
|
|
68057
68117
|
seconds: playOptions.seconds ?? (def.loop && def.loop > 0 ? def.loop : ENDLESS_SECONDS),
|
|
@@ -72047,7 +72107,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72047
72107
|
uTime: { value: 0 }
|
|
72048
72108
|
};
|
|
72049
72109
|
const puffs = createPuffLayer(THREE, pools.puffs, uniforms);
|
|
72050
|
-
const
|
|
72110
|
+
const sparks2 = createSparkLayer(THREE, pools.sparks);
|
|
72051
72111
|
const glows = createGlowLayer(THREE, pools.glows);
|
|
72052
72112
|
const rockGeometry = new THREE.DodecahedronGeometry(0.5, 0);
|
|
72053
72113
|
const plateGeometry = new THREE.BoxGeometry(1, 1, 1);
|
|
@@ -72056,7 +72116,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72056
72116
|
const sprites = createSpriteLayer(THREE, world.sprites(), options.pointScale ?? 700);
|
|
72057
72117
|
const lights = createLightLayer(THREE, pools.lights, options.lightScale ?? Math.PI, options.lights);
|
|
72058
72118
|
const marks = createMarkLayer(THREE, { ground: pools.ground, ...world.hostGroundAt ? { heightAt: world.hostGroundAt } : {}, createCanvas: options.createCanvas, rockGeometry, plateGeometry, ...options.markLimits });
|
|
72059
|
-
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);
|
|
72060
72120
|
const stopMarks = world.onMarks((event) => marks.handle(event));
|
|
72061
72121
|
const overlay = options.overlay ? createScreenOverlay(options.overlay) : void 0;
|
|
72062
72122
|
let drawCalls = 0;
|
|
@@ -72065,7 +72125,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72065
72125
|
const layerOn = /* @__PURE__ */ new Map();
|
|
72066
72126
|
const layerObjects = () => ({
|
|
72067
72127
|
puffs: [puffs.mesh],
|
|
72068
|
-
sparks: [
|
|
72128
|
+
sparks: [sparks2.mesh],
|
|
72069
72129
|
glows: [glows.mesh],
|
|
72070
72130
|
debris: [chunks.rocks, chunks.plates],
|
|
72071
72131
|
shock: [shocks.group],
|
|
@@ -72093,7 +72153,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72093
72153
|
}
|
|
72094
72154
|
function syncAll() {
|
|
72095
72155
|
lastDrawn.puffs = puffs.sync();
|
|
72096
|
-
lastDrawn.sparks =
|
|
72156
|
+
lastDrawn.sparks = sparks2.sync();
|
|
72097
72157
|
lastDrawn.glows = glows.sync();
|
|
72098
72158
|
lastDrawn.chunks = chunks.sync();
|
|
72099
72159
|
lastDrawn.shocks = shocks.sync();
|
|
@@ -72194,7 +72254,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
72194
72254
|
stopMarks();
|
|
72195
72255
|
overlay?.dispose();
|
|
72196
72256
|
workshopLayers?.dispose();
|
|
72197
|
-
for (const layer22 of [puffs,
|
|
72257
|
+
for (const layer22 of [puffs, sparks2, glows, chunks, shocks, lights, marks, sprites]) layer22.dispose();
|
|
72198
72258
|
rockGeometry.dispose();
|
|
72199
72259
|
plateGeometry.dispose();
|
|
72200
72260
|
options.scene.remove(root);
|