@adatechnology/game-destruction-three 0.7.1 → 0.7.2
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 +998 -366
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2 -48
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2790,54 +2790,8 @@ var Renderer = class {
|
|
|
2790
2790
|
};
|
|
2791
2791
|
|
|
2792
2792
|
// src/audio/recipes.ts
|
|
2793
|
-
import { DISTANCE_CURVES } from "@adatechnology/game-audio";
|
|
2794
|
-
var
|
|
2795
|
-
var lengthOf = (d, attack) => {
|
|
2796
|
-
if (typeof d === "number") return attack + d;
|
|
2797
|
-
if (Array.isArray(d)) return [attack + d[0], attack + d[1]];
|
|
2798
|
-
return { ...d, add: (d.add ?? 0) + attack };
|
|
2799
|
-
};
|
|
2800
|
-
var envelope = (attack) => [
|
|
2801
|
-
[0, 1e-4, "set", "fixed"],
|
|
2802
|
-
[attack, 1, "exp"],
|
|
2803
|
-
["1d", 1e-4, "exp", "fixed"]
|
|
2804
|
-
];
|
|
2805
|
-
function noise(o) {
|
|
2806
|
-
const a = o.a ?? ATTACK;
|
|
2807
|
-
const over = typeof o.d === "number" ? o.d : 0;
|
|
2808
|
-
return {
|
|
2809
|
-
filters: {
|
|
2810
|
-
mode: "serial",
|
|
2811
|
-
bank: [{ type: o.type ?? "lowpass", frequency: o.f2 === void 0 ? { set: o.f } : { set: o.f, to: o.f2, curve: "exp", over }, q: o.q ?? 0.7 }]
|
|
2812
|
-
},
|
|
2813
|
-
duration: lengthOf(o.d, a),
|
|
2814
|
-
gain: o.vol,
|
|
2815
|
-
...o.delay === void 0 ? {} : { at: o.delay },
|
|
2816
|
-
...o.wet === void 0 ? {} : { wet: o.wet },
|
|
2817
|
-
source: { kind: "noise", offset: "random", offsetScale: 1.5, loop: true },
|
|
2818
|
-
envelope: envelope(a)
|
|
2819
|
-
};
|
|
2820
|
-
}
|
|
2821
|
-
function tone(o) {
|
|
2822
|
-
return {
|
|
2823
|
-
source: { kind: "osc", wave: o.wave ?? "sine", frequency: { from: o.f, to: o.f2 ?? "from", curve: "exp", over: "duration" } },
|
|
2824
|
-
duration: lengthOf(o.d, ATTACK),
|
|
2825
|
-
gain: o.vol,
|
|
2826
|
-
...o.delay === void 0 ? {} : { at: o.delay },
|
|
2827
|
-
...o.wet === void 0 ? {} : { wet: o.wet },
|
|
2828
|
-
envelope: envelope(ATTACK)
|
|
2829
|
-
};
|
|
2830
|
-
}
|
|
2831
|
-
var many = (count, make) => Array.from({ length: count }, make);
|
|
2832
|
-
var scene = (id, layers, line, vars) => ({
|
|
2833
|
-
id,
|
|
2834
|
-
bus: "world",
|
|
2835
|
-
pan: true,
|
|
2836
|
-
layers,
|
|
2837
|
-
falloff: DISTANCE_CURVES.art_scene,
|
|
2838
|
-
...vars ? { vars } : {},
|
|
2839
|
-
sources: [`cena:${line}`]
|
|
2840
|
-
});
|
|
2793
|
+
import { DISTANCE_CURVES, sceneMany as many, sceneNoise as noise, sceneRecipe, sceneTone as tone } from "@adatechnology/game-audio";
|
|
2794
|
+
var scene = (id, layers, line, vars) => sceneRecipe(id, layers, line, vars ? { vars } : {});
|
|
2841
2795
|
var boomLayers = (big) => [
|
|
2842
2796
|
noise({ f: 1200, f2: 120, d: 1.8, vol: 2, wet: 1.2 }),
|
|
2843
2797
|
tone({ f: 65, f2: 24, d: 1, vol: 1.8 }),
|