@margoengine/vfx 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +1642 -3
- package/dist/base-C9upJytz.js +658 -0
- package/dist/base.d.ts +767 -0
- package/dist/base.js +1 -0
- package/dist/blown-sand.d.ts +218 -0
- package/dist/blown-sand.js +700 -0
- package/dist/clouds.d.ts +229 -0
- package/dist/clouds.js +566 -0
- package/dist/compat-CVSEj1Bp.js +217 -0
- package/dist/compat.d.ts +59 -0
- package/dist/curves.d.ts +11 -0
- package/dist/curves.js +59 -0
- package/dist/debris.d.ts +111 -0
- package/dist/debris.js +258 -0
- package/dist/depth-collide.d.ts +7 -0
- package/dist/depth-collide.js +96 -0
- package/dist/emitter.d.ts +10 -0
- package/dist/emitter.js +125 -0
- package/dist/events.d.ts +9 -0
- package/dist/events.js +131 -0
- package/dist/extra-CgGjbojB.js +4 -0
- package/dist/extra.d.ts +2 -0
- package/dist/fields.d.ts +11 -0
- package/dist/fields.js +95 -0
- package/dist/fire-front.d.ts +539 -0
- package/dist/fire-front.js +840 -0
- package/dist/fire.d.ts +119 -0
- package/dist/fire.js +173 -0
- package/dist/flame-ramp-VoBKpYnM.js +75 -0
- package/dist/flame-ramp.d.ts +61 -0
- package/dist/flame.d.ts +260 -0
- package/dist/flame.js +605 -0
- package/dist/flipbook.d.ts +7 -0
- package/dist/flipbook.js +23 -0
- package/dist/fog-B-kBv7g0.js +32 -0
- package/dist/frame-BuvMFBPp.js +4 -0
- package/dist/frame.d.ts +7 -0
- package/dist/gunfire.d.ts +696 -0
- package/dist/gunfire.js +1204 -0
- package/dist/hash-Btsp6fGK.js +7 -0
- package/dist/hash.d.ts +2 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +60 -0
- package/dist/json.d.ts +53 -0
- package/dist/json.js +237 -0
- package/dist/lit.d.ts +11 -0
- package/dist/lit.js +105 -0
- package/dist/mesh.d.ts +14 -0
- package/dist/mesh.js +225 -0
- package/dist/node-system.d.ts +315 -0
- package/dist/node-system.js +384 -0
- package/dist/nodes.d.ts +14 -0
- package/dist/nodes.js +293 -0
- package/dist/obstacles.d.ts +3 -0
- package/dist/obstacles.js +25 -0
- package/dist/over-life.d.ts +14 -0
- package/dist/over-life.js +93 -0
- package/dist/require-webgpu--tUXPsmA.js +7 -0
- package/dist/ribbons.d.ts +20 -0
- package/dist/ribbons.js +151 -0
- package/dist/schedule.d.ts +29 -0
- package/dist/schedule.js +47 -0
- package/dist/settings.d.ts +362 -0
- package/dist/settings.js +707 -0
- package/dist/shader.d.ts +44 -0
- package/dist/shadows.d.ts +26 -0
- package/dist/shadows.js +182 -0
- package/dist/shapes.d.ts +34 -0
- package/dist/shapes.js +81 -0
- package/dist/shared/fog.d.ts +33 -0
- package/dist/shared/pass.d.ts +53 -0
- package/dist/shared/settings.d.ts +89 -0
- package/dist/skinned.d.ts +11 -0
- package/dist/skinned.js +104 -0
- package/dist/smoke.d.ts +215 -0
- package/dist/smoke.js +280 -0
- package/dist/soft.d.ts +17 -0
- package/dist/soft.js +55 -0
- package/dist/solid.d.ts +168 -0
- package/dist/solid.js +403 -0
- package/dist/sort.d.ts +3 -0
- package/dist/sort.js +58 -0
- package/dist/space.d.ts +14 -0
- package/dist/space.js +88 -0
- package/dist/stretch.d.ts +7 -0
- package/dist/stretch.js +40 -0
- package/dist/texture.d.ts +8 -0
- package/dist/texture.js +45 -0
- package/dist/view-RKprOPAy.js +30 -0
- package/dist/view-rect-DkeiiUtw.js +13 -0
- package/dist/wrap.d.ts +3 -0
- package/dist/wrap.js +5 -0
- package/package.json +192 -6
package/dist/settings.js
ADDED
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
import { s as e } from "./flame-ramp-VoBKpYnM.js";
|
|
2
|
+
//#region ../shared/settings.js
|
|
3
|
+
var t = (e, t, n) => typeof e == "number" && e >= t && e <= n, n = (e, n, r) => Array.isArray(e) && e.length === 3 && e.every((e) => t(e, n, r)), r = (e) => e.stopKey ?? "elevation", i = (e, t, n, r, i, a, o, s, c = !0) => ({
|
|
4
|
+
name: e,
|
|
5
|
+
group: t,
|
|
6
|
+
kind: "number",
|
|
7
|
+
default: n,
|
|
8
|
+
min: r,
|
|
9
|
+
max: i,
|
|
10
|
+
step: a,
|
|
11
|
+
unit: o,
|
|
12
|
+
about: s,
|
|
13
|
+
live: c
|
|
14
|
+
}), a = (e, t, n, r, i, a, o = !0) => ({
|
|
15
|
+
name: e,
|
|
16
|
+
group: t,
|
|
17
|
+
kind: "color",
|
|
18
|
+
default: n,
|
|
19
|
+
min: r,
|
|
20
|
+
max: i,
|
|
21
|
+
step: .01,
|
|
22
|
+
unit: "",
|
|
23
|
+
about: a,
|
|
24
|
+
live: o
|
|
25
|
+
}), o = (e, t) => ({
|
|
26
|
+
...e,
|
|
27
|
+
default: null,
|
|
28
|
+
nullable: !0,
|
|
29
|
+
weather: t
|
|
30
|
+
}), s = Symbol.for("margoengine.weather-held");
|
|
31
|
+
function c(e, t, n = !0) {
|
|
32
|
+
if (typeof e != "object" || !e) return;
|
|
33
|
+
let r = e[s];
|
|
34
|
+
n ? (r || Object.defineProperty(e, s, {
|
|
35
|
+
value: r = /* @__PURE__ */ new Set(),
|
|
36
|
+
configurable: !0
|
|
37
|
+
}), r.add(t)) : r?.delete(t);
|
|
38
|
+
}
|
|
39
|
+
var l = (e, t) => JSON.stringify(e) === JSON.stringify(t);
|
|
40
|
+
function u(e) {
|
|
41
|
+
return Array.isArray(e) ? typeof e[0] == "object" ? e.map((e) => ({
|
|
42
|
+
...e,
|
|
43
|
+
color: [...e.color]
|
|
44
|
+
})) : [...e] : e;
|
|
45
|
+
}
|
|
46
|
+
function d(e) {
|
|
47
|
+
return Object.fromEntries(e.map((e) => [e.name, u(e.default)]));
|
|
48
|
+
}
|
|
49
|
+
var f = (e) => e.filter((e) => e.live), p = (e) => new Map(e.map((e) => [e.name, e]));
|
|
50
|
+
function ee(e, i, a) {
|
|
51
|
+
let o = e.min ?? -Infinity, s = e.max ?? Infinity, c;
|
|
52
|
+
if (i === null) c = !!e.nullable;
|
|
53
|
+
else if (e.kind === "number") c = t(i, o, s);
|
|
54
|
+
else if (e.kind === "color") c = n(i, o, s);
|
|
55
|
+
else if (e.kind === "choice") c = e.choices.includes(i);
|
|
56
|
+
else {
|
|
57
|
+
let a = r(e);
|
|
58
|
+
c = Array.isArray(i) && i.length >= 2 && i.length <= 8 && i.every((e, r) => typeof e == "object" && !!e && t(e[a], o, s) && n(e.color, 0, 1) && (r === 0 || e[a] > i[r - 1][a]));
|
|
59
|
+
}
|
|
60
|
+
if (c) return;
|
|
61
|
+
let l = e.nullable ? e.weather ? ` or null (follow the weather's ${e.weather})` : " or null" : "", u = e.kind === "number" ? `a number from ${o} to ${s}${l}` : e.kind === "color" ? `three numbers from ${o} to ${s} (linear RGB)${l}` : e.kind === "choice" ? e.choices.map((e) => `'${e}'`).join(" or ") + l : `2 to 8 stops {${r(e)}, color}, ${r(e)} ${o} to ${s} rising, colours 0 to 1${l}`;
|
|
62
|
+
throw RangeError(`Invalid ${a} setting ${e.name}; use ${u}`);
|
|
63
|
+
}
|
|
64
|
+
function m(e, t, n, r = `the rows in @margoengine/${n}/settings`) {
|
|
65
|
+
let i = e instanceof Map ? e : p(e);
|
|
66
|
+
for (let e of Object.keys(t)) {
|
|
67
|
+
let a = i.get(e);
|
|
68
|
+
if (!a) throw TypeError(`Unknown ${n} setting ${e}; use a name from ${r}`);
|
|
69
|
+
ee(a, t[e], n);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/settings.ts
|
|
74
|
+
var h = (e, t, n, r, a, o, s, c) => i(e, t, n, r, a, o, s, c), g = [
|
|
75
|
+
{
|
|
76
|
+
...h("rate", "emission", 0, 0, 1e6, 1, "births/s", "Particles born a second; null is half the capacity a second (the effect fills in about two seconds)."),
|
|
77
|
+
default: null,
|
|
78
|
+
nullable: !0
|
|
79
|
+
},
|
|
80
|
+
h("spread", "emission", 1, 0, 50, .01, "m/s", "Random speed added to each birth."),
|
|
81
|
+
h("emissionExtent.x", "emission", 0, 0, 100, .01, "m", "Half width of the box births are spread over (0 is a point)."),
|
|
82
|
+
h("emissionExtent.y", "emission", 0, 0, 100, .01, "m", "Half height of the box births are spread over."),
|
|
83
|
+
h("emissionExtent.z", "emission", 0, 0, 100, .01, "m", "Half depth of the box births are spread over."),
|
|
84
|
+
h("velocity.x", "motion", 0, -100, 100, .01, "m/s", "Launch velocity, east-west."),
|
|
85
|
+
h("velocity.y", "motion", 3, -100, 100, .01, "m/s", "Launch velocity, up: smoke rises at this speed."),
|
|
86
|
+
h("velocity.z", "motion", 0, -100, 100, .01, "m/s", "Launch velocity, north-south."),
|
|
87
|
+
h("gravity.x", "motion", 0, -100, 100, .01, "m/s2", "Acceleration east-west."),
|
|
88
|
+
h("gravity.y", "motion", -9.81, -100, 100, .01, "m/s2", "Acceleration up: -9.81 falls like Earth, a small positive number makes smoke buoyant."),
|
|
89
|
+
h("gravity.z", "motion", 0, -100, 100, .01, "m/s2", "Acceleration north-south."),
|
|
90
|
+
h("turbulence", "motion", .5, 0, 20, .01, "m/s2", "Curl-noise acceleration; 0 turns it off."),
|
|
91
|
+
h("frequency", "motion", 1, 0, 20, .01, "1/m", "How fine the curl noise is, per metre."),
|
|
92
|
+
h("bounce", "motion", .3, 0, 1, .01, "", "Share of speed kept after hitting the ground or an obstacle."),
|
|
93
|
+
h("ground", "motion", 0, -1e3, 1e3, .1, "m", "Height of the collision plane."),
|
|
94
|
+
h("angularVelocity", "motion", 0, -50, 50, .01, "rad/s", "Billboard spin; each particle starts at a random angle."),
|
|
95
|
+
o(h("wind.x", "wind", 0, -100, 100, .1, "m/s", "Wind east-west (+X). Particles lean as they relax toward it in 0.25 s; null follows the weather. With wind.z, one given and the other null reads the null one as 0."), "wind"),
|
|
96
|
+
o(h("wind.z", "wind", 0, -100, 100, .1, "m/s", "Wind north-south (+Z); null follows the weather."), "wind"),
|
|
97
|
+
h("size", "look", .1, .001, 20, .001, "m", "Billboard diameter."),
|
|
98
|
+
h("lifetime.min", "look", 1, .05, 60, .01, "s", "Shortest life of a particle; at most lifetime.max."),
|
|
99
|
+
h("lifetime.max", "look", 3, .05, 120, .01, "s", "Longest life of a particle."),
|
|
100
|
+
a("color", "look", [
|
|
101
|
+
1,
|
|
102
|
+
.5,
|
|
103
|
+
.1
|
|
104
|
+
], 0, 1, "Colour at birth, linear RGB."),
|
|
105
|
+
h("alpha", "look", 1, 0, 1, .01, "", "Opacity at birth; it fades out over the life."),
|
|
106
|
+
h("intensity", "look", 1, 0, 1e3, .01, "", "Brightness multiplier for HDR glow (a flame is about 60).")
|
|
107
|
+
], te = f(g), _ = p(g);
|
|
108
|
+
function v() {
|
|
109
|
+
return d(g);
|
|
110
|
+
}
|
|
111
|
+
var y = (e, t, n, r, i) => {
|
|
112
|
+
let a = n.map((e) => r(e));
|
|
113
|
+
a.every((e, t) => e === i[t]) ? delete e[t] : e[t] = a;
|
|
114
|
+
};
|
|
115
|
+
function ne(e, t = {}) {
|
|
116
|
+
m(_, t, "vfx", "VFX_SETTINGS in @margoengine/vfx/settings");
|
|
117
|
+
let n = (e) => e in t ? t[e] : _.get(e).default, r = e.options;
|
|
118
|
+
if (n("lifetime.min") > n("lifetime.max")) throw RangeError("Invalid vfx setting lifetime.min; use a number at most lifetime.max");
|
|
119
|
+
for (let e of g) e.group === "emission" && e.name === "rate" ? n("rate") === null ? delete r.rate : r.rate = n("rate") : !e.name.includes(".") && e.name !== "color" && e.name !== "alpha" && (l(n(e.name), e.default) ? delete r[e.name] : r[e.name] = n(e.name));
|
|
120
|
+
y(r, "emissionExtent", [
|
|
121
|
+
"emissionExtent.x",
|
|
122
|
+
"emissionExtent.y",
|
|
123
|
+
"emissionExtent.z"
|
|
124
|
+
], n, [
|
|
125
|
+
0,
|
|
126
|
+
0,
|
|
127
|
+
0
|
|
128
|
+
]), y(r, "velocity", [
|
|
129
|
+
"velocity.x",
|
|
130
|
+
"velocity.y",
|
|
131
|
+
"velocity.z"
|
|
132
|
+
], n, [
|
|
133
|
+
0,
|
|
134
|
+
3,
|
|
135
|
+
0
|
|
136
|
+
]), y(r, "gravity", [
|
|
137
|
+
"gravity.x",
|
|
138
|
+
"gravity.y",
|
|
139
|
+
"gravity.z"
|
|
140
|
+
], n, [
|
|
141
|
+
0,
|
|
142
|
+
-9.81,
|
|
143
|
+
0
|
|
144
|
+
]);
|
|
145
|
+
let i = n("wind.x"), a = n("wind.z");
|
|
146
|
+
i === null && a === null ? delete r.wind : r.wind = [i ?? 0, a ?? 0], c(r, "wind", i !== null || a !== null);
|
|
147
|
+
let o = [n("lifetime.min"), n("lifetime.max")];
|
|
148
|
+
o[0] === 1 && o[1] === 3 ? delete r.lifetime : r.lifetime = o;
|
|
149
|
+
let s = n("color"), u = n("alpha");
|
|
150
|
+
l(s, [
|
|
151
|
+
1,
|
|
152
|
+
.5,
|
|
153
|
+
.1
|
|
154
|
+
]) && u === 1 ? delete r.color : r.color = [
|
|
155
|
+
s[0],
|
|
156
|
+
s[1],
|
|
157
|
+
s[2],
|
|
158
|
+
u
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
function re(e) {
|
|
162
|
+
let t = e.options, n = v(), r = (e) => {
|
|
163
|
+
let r = t[e];
|
|
164
|
+
r && [
|
|
165
|
+
"x",
|
|
166
|
+
"y",
|
|
167
|
+
"z"
|
|
168
|
+
].forEach((t, i) => n[`${e}.${t}`] = r[i]);
|
|
169
|
+
};
|
|
170
|
+
for (let e of [
|
|
171
|
+
"spread",
|
|
172
|
+
"turbulence",
|
|
173
|
+
"frequency",
|
|
174
|
+
"bounce",
|
|
175
|
+
"ground",
|
|
176
|
+
"angularVelocity",
|
|
177
|
+
"size",
|
|
178
|
+
"intensity"
|
|
179
|
+
]) t[e] !== void 0 && (n[e] = t[e]);
|
|
180
|
+
return t.rate !== void 0 && (n.rate = t.rate), r("emissionExtent"), r("velocity"), r("gravity"), Array.isArray(t.wind) && (n["wind.x"] = t.wind[0], n["wind.z"] = t.wind[1]), t.lifetime && (n["lifetime.min"] = t.lifetime[0], n["lifetime.max"] = t.lifetime[1]), t.color && (n.color = [
|
|
181
|
+
t.color[0],
|
|
182
|
+
t.color[1],
|
|
183
|
+
t.color[2]
|
|
184
|
+
], n.alpha = t.color[3]), n;
|
|
185
|
+
}
|
|
186
|
+
var b = (e, t, n, r, a, o, s, c, l = !0) => i(e, t, n, r, a, o, s, c, l), x = (e, t) => t ? o(e, t) : {
|
|
187
|
+
...e,
|
|
188
|
+
default: null,
|
|
189
|
+
nullable: !0
|
|
190
|
+
}, S = [
|
|
191
|
+
x(b("wind.speed", "wind", 0, 0, 60, .1, "m/s", "Mean wind at windHeight; null follows the weather. Sand moves above the threshold (6.6 m/s for 0.25 mm sand at 10 m)."), "wind"),
|
|
192
|
+
x(b("wind.direction", "wind", 0, 0, 360, 1, "degrees", "Compass direction the wind blows toward: 0 is +Z, 90 is +X; null follows the weather."), "windDirection"),
|
|
193
|
+
x(b("wind.gust", "wind", .35, 0, 1, .01, "", "Gustiness of the wind; null follows the weather."), "gust"),
|
|
194
|
+
b("wind.gustPeriod", "wind", 8, .5, 600, .5, "s", "Seconds between gusts."),
|
|
195
|
+
x(b("gustiness", "wind", .35, 0, 1, .01, "", "How far gusts swing the sand; null takes the wind gust.")),
|
|
196
|
+
x(b("threshold", "grain", 6.6, .1, 60, .1, "m/s", "Wind speed at which dry sand starts to move (Bagnold); null is the one grainSize and windHeight give.")),
|
|
197
|
+
b("grainSize", "grain", 25e-5, 6e-5, .002, 1e-5, "m", "Grain diameter: 0.06 mm fine sand to 2 mm coarse; sets the default threshold."),
|
|
198
|
+
b("windHeight", "grain", 10, .5, 100, .5, "m", "Height the wind speed is given at."),
|
|
199
|
+
a("color", "look", [
|
|
200
|
+
.5,
|
|
201
|
+
.42,
|
|
202
|
+
.29
|
|
203
|
+
], 0, 1, "Grain colour, linear RGB (terrain dry sand)."),
|
|
204
|
+
b("streak", "look", .6, .05, 5, .01, "m", "Length of a streak of moving sand."),
|
|
205
|
+
b("height", "look", .3, .02, 3, .01, "m", "Height under which most sand moves; crest plumes rise about 4 times it."),
|
|
206
|
+
b("opacity", "look", .6, 0, 1, .01, "", "Opacity of the sand."),
|
|
207
|
+
x(b("fog", "look", 0, 0, 1, 1e-4, "1/m", "Fog density the sand fades by with distance; null follows the weather (the air, dust included)."), "visibility"),
|
|
208
|
+
b("amount", "layout", 1, 0, 1, .01, "", "Density of the blowing sand; lays the particles out again.", !1),
|
|
209
|
+
b("seed", "layout", 1, 0, 2147483647, 1, "", "The same seed and time draw the same sand.", !1),
|
|
210
|
+
b("limit", "layout", 32768, 1, 1048576, 1, "particles", "Most particles drawn.", !1),
|
|
211
|
+
b("range", "layout", 250, 10, 2e3, 1, "m", "Radius around the camera with blowing sand.", !1),
|
|
212
|
+
b("softness", "layout", 0, 0, 100, .1, "m", "Fade in front of the surface behind (needs the scene depth); 0 is off.", !1)
|
|
213
|
+
], C = f(S), w = p(S);
|
|
214
|
+
function T() {
|
|
215
|
+
return d(S);
|
|
216
|
+
}
|
|
217
|
+
var ie = {
|
|
218
|
+
natural: {},
|
|
219
|
+
animatedFeature: {
|
|
220
|
+
"wind.speed": 8,
|
|
221
|
+
"wind.gust": .25,
|
|
222
|
+
streak: .5,
|
|
223
|
+
height: .35,
|
|
224
|
+
opacity: .45
|
|
225
|
+
},
|
|
226
|
+
drift: {
|
|
227
|
+
"wind.speed": 8,
|
|
228
|
+
"wind.direction": 90,
|
|
229
|
+
"wind.gust": .3,
|
|
230
|
+
streak: .5,
|
|
231
|
+
height: .2,
|
|
232
|
+
opacity: .5
|
|
233
|
+
},
|
|
234
|
+
sandstorm: {
|
|
235
|
+
"wind.speed": 18,
|
|
236
|
+
"wind.direction": 90,
|
|
237
|
+
"wind.gust": .7,
|
|
238
|
+
streak: 1.2,
|
|
239
|
+
height: .8,
|
|
240
|
+
opacity: .8
|
|
241
|
+
},
|
|
242
|
+
weather: {}
|
|
243
|
+
};
|
|
244
|
+
function ae(e, t = {}) {
|
|
245
|
+
m(w, t, "vfx", "SAND_SETTINGS in @margoengine/vfx/settings");
|
|
246
|
+
let n = (e) => e in t ? t[e] : w.get(e).default, r = e.options, i = n("wind.speed"), a = n("wind.direction"), o = n("wind.gust");
|
|
247
|
+
r.wind = i === null ? { speed: 0 } : {
|
|
248
|
+
speed: i,
|
|
249
|
+
direction: (a ?? 0) * Math.PI / 180,
|
|
250
|
+
...o === null ? {} : { gust: o },
|
|
251
|
+
gustPeriod: n("wind.gustPeriod")
|
|
252
|
+
}, c(r, "wind", i !== null), c(r, "fog", n("fog") !== null);
|
|
253
|
+
for (let e of [
|
|
254
|
+
"gustiness",
|
|
255
|
+
"threshold",
|
|
256
|
+
"fog"
|
|
257
|
+
]) n(e) === null ? delete r[e] : r[e] = n(e);
|
|
258
|
+
for (let e of [
|
|
259
|
+
"grainSize",
|
|
260
|
+
"windHeight",
|
|
261
|
+
"streak",
|
|
262
|
+
"height",
|
|
263
|
+
"opacity",
|
|
264
|
+
"amount",
|
|
265
|
+
"seed",
|
|
266
|
+
"limit",
|
|
267
|
+
"range",
|
|
268
|
+
"softness"
|
|
269
|
+
]) r[e] = n(e);
|
|
270
|
+
r.color = [...n("color")];
|
|
271
|
+
}
|
|
272
|
+
function oe(e) {
|
|
273
|
+
let t = e.options, n = T(), r = t.wind;
|
|
274
|
+
r && !("options" in r) && typeof r.speed == "number" && r.speed > 0 && (n["wind.speed"] = r.speed, n["wind.direction"] = ((r.direction ?? 0) * 180 / Math.PI % 360 + 360) % 360, r.gust !== void 0 && (n["wind.gust"] = r.gust), r.gustPeriod !== void 0 && (n["wind.gustPeriod"] = r.gustPeriod));
|
|
275
|
+
for (let e of [
|
|
276
|
+
"gustiness",
|
|
277
|
+
"threshold",
|
|
278
|
+
"fog",
|
|
279
|
+
"grainSize",
|
|
280
|
+
"windHeight",
|
|
281
|
+
"streak",
|
|
282
|
+
"height",
|
|
283
|
+
"opacity",
|
|
284
|
+
"amount",
|
|
285
|
+
"seed",
|
|
286
|
+
"limit",
|
|
287
|
+
"range",
|
|
288
|
+
"softness"
|
|
289
|
+
]) typeof t[e] == "number" && (n[e] = t[e]);
|
|
290
|
+
return Array.isArray(t.color) && (n.color = [
|
|
291
|
+
t.color[0],
|
|
292
|
+
t.color[1],
|
|
293
|
+
t.color[2]
|
|
294
|
+
]), n;
|
|
295
|
+
}
|
|
296
|
+
var E = (e, t, n, r, a, o, s, c, l = !0) => i(e, t, n, r, a, o, s, c, l), D = [
|
|
297
|
+
E("heat", "source", 5e6, 0, 1e11, 1e3, "W", "Convective heat release: it sets the rise (Briggs buoyancy flux). 20 kW a hearth, 5 MW a house, 1 GW a wildfire head."),
|
|
298
|
+
E("radius", "source", 2, .05, 2e3, .05, "m", "Radius of the source; the column starts this wide."),
|
|
299
|
+
E("rate", "source", 20, .1, 1e4, .1, "puffs/s", "Puffs born a second (at most the capacity attach made, rate x lifetime)."),
|
|
300
|
+
E("lifetime", "source", 60, 1, 3600, 1, "s", "Seconds a puff lives: the column is its rise at this age. Sets the capacity.", !1),
|
|
301
|
+
E("airTemperature", "air", 288.15, 200, 330, .1, "K", "Air temperature, for the buoyancy flux."),
|
|
302
|
+
E("stability", "air", 0, 0, .01, 1e-5, "1/s2", "Air stability (g/T) dtheta/dz: above 0 the column levels off and spreads (Briggs final rise). 0 is neutral."),
|
|
303
|
+
o(E("wind.x", "wind", 0, -100, 100, .1, "m/s", "Wind east-west; null follows the fire or the weather."), "wind"),
|
|
304
|
+
o(E("wind.z", "wind", 0, -100, 100, .1, "m/s", "Wind north-south; null follows the fire or the weather."), "wind"),
|
|
305
|
+
a("color", "look", [
|
|
306
|
+
.3,
|
|
307
|
+
.29,
|
|
308
|
+
.28
|
|
309
|
+
], 0, 1, "Smoke colour, linear RGB."),
|
|
310
|
+
E("opacity", "look", .5, 0, 1, .01, "", "Opacity of a puff."),
|
|
311
|
+
E("turbulence", "look", .4, 0, 20, .01, "m/s2", "Curl-noise churn; 0 is a smooth column."),
|
|
312
|
+
E("glow", "look", 1, 0, 10, .01, "", "Glow of the fire on the column from below: a multiple of its radiated power (0.3 of the release, Drysdale 2011). 0 turns it off.")
|
|
313
|
+
], se = f(D), O = p(D);
|
|
314
|
+
function k() {
|
|
315
|
+
return d(D);
|
|
316
|
+
}
|
|
317
|
+
var ce = {
|
|
318
|
+
natural: {},
|
|
319
|
+
campfire: {
|
|
320
|
+
heat: 2e4,
|
|
321
|
+
radius: .3,
|
|
322
|
+
rate: 12,
|
|
323
|
+
color: [
|
|
324
|
+
.42,
|
|
325
|
+
.41,
|
|
326
|
+
.4
|
|
327
|
+
],
|
|
328
|
+
opacity: .35,
|
|
329
|
+
turbulence: .6
|
|
330
|
+
},
|
|
331
|
+
houseFire: {
|
|
332
|
+
heat: 5e6,
|
|
333
|
+
radius: 3,
|
|
334
|
+
rate: 20,
|
|
335
|
+
color: [
|
|
336
|
+
.22,
|
|
337
|
+
.2,
|
|
338
|
+
.18
|
|
339
|
+
],
|
|
340
|
+
opacity: .6
|
|
341
|
+
},
|
|
342
|
+
wildfire: {
|
|
343
|
+
heat: 1e9,
|
|
344
|
+
radius: 40,
|
|
345
|
+
rate: 30,
|
|
346
|
+
lifetime: 240,
|
|
347
|
+
stability: 3e-4,
|
|
348
|
+
color: [
|
|
349
|
+
.33,
|
|
350
|
+
.29,
|
|
351
|
+
.25
|
|
352
|
+
],
|
|
353
|
+
opacity: .6,
|
|
354
|
+
turbulence: 1
|
|
355
|
+
},
|
|
356
|
+
oil: {
|
|
357
|
+
heat: 2e7,
|
|
358
|
+
radius: 4,
|
|
359
|
+
rate: 25,
|
|
360
|
+
color: [
|
|
361
|
+
.03,
|
|
362
|
+
.03,
|
|
363
|
+
.03
|
|
364
|
+
],
|
|
365
|
+
opacity: .8
|
|
366
|
+
},
|
|
367
|
+
animatedFeature: {
|
|
368
|
+
heat: 5e5,
|
|
369
|
+
radius: 1.5,
|
|
370
|
+
rate: 18,
|
|
371
|
+
color: [
|
|
372
|
+
.35,
|
|
373
|
+
.33,
|
|
374
|
+
.31
|
|
375
|
+
],
|
|
376
|
+
opacity: .5,
|
|
377
|
+
turbulence: .5
|
|
378
|
+
}
|
|
379
|
+
}, A = [
|
|
380
|
+
"heat",
|
|
381
|
+
"radius",
|
|
382
|
+
"rate",
|
|
383
|
+
"lifetime",
|
|
384
|
+
"airTemperature",
|
|
385
|
+
"stability",
|
|
386
|
+
"opacity",
|
|
387
|
+
"turbulence",
|
|
388
|
+
"glow"
|
|
389
|
+
], le = /* @__PURE__ */ new Set(["heat", "radius"]), j = /* @__PURE__ */ new WeakMap();
|
|
390
|
+
function M(e, t, n) {
|
|
391
|
+
let r = e.options, i;
|
|
392
|
+
if (n && (i = j.get(r), !i)) {
|
|
393
|
+
i = {};
|
|
394
|
+
for (let e of A) i[e] = r[e];
|
|
395
|
+
i.color = Array.isArray(r.color) ? [...r.color] : void 0, j.set(r, i);
|
|
396
|
+
}
|
|
397
|
+
let a = (e) => e in t ? t[e] : i?.[e] ?? O.get(e).default;
|
|
398
|
+
for (let e of A) (!n || !le.has(e)) && (r[e] = a(e));
|
|
399
|
+
r.color = [...a("color")];
|
|
400
|
+
let o = a("wind.x"), s = a("wind.z");
|
|
401
|
+
o === null && s === null ? delete r.wind : r.wind = [o ?? 0, s ?? 0], c(r, "wind", o !== null || s !== null);
|
|
402
|
+
}
|
|
403
|
+
function ue(e, t = {}) {
|
|
404
|
+
if (m(O, t, "vfx", "SMOKE_SETTINGS in @margoengine/vfx/settings"), "setSmokeLook" in e && typeof e.setSmokeLook == "function") {
|
|
405
|
+
let n = { ...t };
|
|
406
|
+
e.setSmokeLook((e) => M(e, n, !0));
|
|
407
|
+
} else M(e, t, !1);
|
|
408
|
+
}
|
|
409
|
+
function de(e) {
|
|
410
|
+
let t = e.options, n = k();
|
|
411
|
+
for (let e of [
|
|
412
|
+
"heat",
|
|
413
|
+
"radius",
|
|
414
|
+
"rate",
|
|
415
|
+
"lifetime",
|
|
416
|
+
"airTemperature",
|
|
417
|
+
"stability",
|
|
418
|
+
"opacity",
|
|
419
|
+
"turbulence",
|
|
420
|
+
"glow"
|
|
421
|
+
]) typeof t[e] == "number" && (n[e] = t[e]);
|
|
422
|
+
return Array.isArray(t.color) && (n.color = [
|
|
423
|
+
t.color[0],
|
|
424
|
+
t.color[1],
|
|
425
|
+
t.color[2]
|
|
426
|
+
]), Array.isArray(t.wind) && (n["wind.x"] = t.wind[0], n["wind.z"] = t.wind[1]), n;
|
|
427
|
+
}
|
|
428
|
+
var N = (e, t, n, r, a, o, s, c) => i(e, t, n, r, a, o, s, c, !0), P = [
|
|
429
|
+
o(N("moisture", "fuel", .06, 0, 1, .005, "", "Dead 1-hour fuel moisture, a fraction of dry weight (Rothermel 1972). 0.03 is a red-flag day, 0.12 the edge of grass spreading, 0.3 rain-soaked. Null follows the weather (a WeatherDrive dries and wets it from the humidity, temperature and rain), 0.06 without one."), "humidity"),
|
|
430
|
+
o(N("moisture10", "fuel", .07, 0, 4, .005, "", "Dead 10-hour fuel moisture (a quarter to one inch). Null follows the weather, or the 1-hour value plus 0.01 without one."), "humidity"),
|
|
431
|
+
o(N("moisture100", "fuel", .08, 0, 4, .005, "", "Dead 100-hour fuel moisture (one to three inches). Null follows the weather, or the 1-hour value plus 0.02 without one."), "humidity"),
|
|
432
|
+
N("liveMoisture", "fuel", .9, 0, 4, .05, "", "Live fuel moisture, a fraction of dry weight. Late-season chaparral is 0.6 to 0.9, green growth 1.5 and more."),
|
|
433
|
+
N("foliarMoisture", "fuel", 1, .3, 4, .05, "", "Foliar moisture of the tree crowns, a fraction of dry weight (Van Wagner 1977): 1 is 100 percent, 0.8 late-summer drought (crowns catch from a weaker surface fire), 1.3 new growth."),
|
|
434
|
+
o(N("wind.x", "wind", 0, -100, 100, .1, "m/s", "Wind 10 m up, east-west; null follows the weather."), "wind"),
|
|
435
|
+
o(N("wind.z", "wind", 0, -100, 100, .1, "m/s", "Wind 10 m up, north-south; null follows the weather."), "wind"),
|
|
436
|
+
N("windReduction", "wind", .4, 0, 1, .01, "", "Midflame wind as a fraction of the 10 m wind (Albini and Baughman 1979): 0.4 under a canopy, 0.6 in open brush, 1 in open grass."),
|
|
437
|
+
N("spotting", "embers", .02, 0, 100, .001, "1/s", "Embers a second from each 64 m2 of burning ground (an 8 m cell) per 1,000 kW/m of fireline intensity over 1,000, whatever the cell size. 0 turns spotting off."),
|
|
438
|
+
N("spotSpread", "embers", .7, 0, 3, .01, "", "Spread of the landing distance (lognormal sigma): larger throws more embers far and near."),
|
|
439
|
+
N("emberIgnition", "embers", .3, 0, 1, .01, "", "Chance an ember that lands on dry fuel starts a fire (scaled by how far the fuel is from its moisture of extinction)."),
|
|
440
|
+
N("smokeYield", "smoke", 15, 0, 1e3, .5, "g/kg", "Fine smoke (PM2.5) a kilogram of fuel gives: 15 is the extratropical forest value of Akagi et al. 2011 (it varies by 7.5). A WeatherDrive raises the weather smoke from it."),
|
|
441
|
+
N("structureExposure", "structures", 90, 1, 86400, 1, "s", "Seconds of flame within 1.5 flame lengths before a building ignites (Cohen and Butler 1998)."),
|
|
442
|
+
N("structureBurnTime", "structures", 1800, 1, 86400, 1, "s", "Seconds a building burns once alight.")
|
|
443
|
+
], fe = f(P), F = p(P);
|
|
444
|
+
function I() {
|
|
445
|
+
return d(P);
|
|
446
|
+
}
|
|
447
|
+
var pe = {
|
|
448
|
+
mild: {
|
|
449
|
+
moisture: .12,
|
|
450
|
+
liveMoisture: 1.4,
|
|
451
|
+
spotting: 0
|
|
452
|
+
},
|
|
453
|
+
redFlag: {
|
|
454
|
+
moisture: .04,
|
|
455
|
+
liveMoisture: .7,
|
|
456
|
+
spotting: .04,
|
|
457
|
+
windReduction: .5
|
|
458
|
+
},
|
|
459
|
+
santaAna: {
|
|
460
|
+
moisture: .03,
|
|
461
|
+
liveMoisture: .6,
|
|
462
|
+
"wind.x": -10.6,
|
|
463
|
+
"wind.z": 10.6,
|
|
464
|
+
spotting: .06,
|
|
465
|
+
windReduction: .5
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
function L(e, t = {}) {
|
|
469
|
+
m(F, t, "vfx", "FIRE_SETTINGS in @margoengine/vfx/settings");
|
|
470
|
+
let n = (e) => e in t ? t[e] : F.get(e).default, r = e.options;
|
|
471
|
+
for (let e of P) e.name.includes(".") || (r[e.name] = n(e.name));
|
|
472
|
+
for (let e of [
|
|
473
|
+
"moisture",
|
|
474
|
+
"moisture10",
|
|
475
|
+
"moisture100"
|
|
476
|
+
]) r[e] === null && delete r[e], c(r, e, r[e] !== void 0);
|
|
477
|
+
let i = n("wind.x"), a = n("wind.z");
|
|
478
|
+
i === null && a === null ? delete r.wind : r.wind = [i ?? 0, a ?? 0], c(r, "wind", i !== null || a !== null);
|
|
479
|
+
}
|
|
480
|
+
function R(e) {
|
|
481
|
+
let t = e.options, n = I();
|
|
482
|
+
for (let e of P) !e.name.includes(".") && typeof t[e.name] == "number" && (n[e.name] = t[e.name]);
|
|
483
|
+
return Array.isArray(t.wind) && (n["wind.x"] = t.wind[0], n["wind.z"] = t.wind[1]), n;
|
|
484
|
+
}
|
|
485
|
+
var z = (e, t, n, r, a, o, s, c) => i(e, t, n, r, a, o, s, c, !0), B = [
|
|
486
|
+
z("flames.size", "flames", 1, .1, 8, .01, "x", "Flame billboard size as a multiple of the kit's: larger flames read as big soft shapes."),
|
|
487
|
+
z("flames.radiance", "flames", 1, 0, 4, .01, "x", "Brightness of the flames as a multiple of the kit's; under 1 keeps the core from blowing out to white."),
|
|
488
|
+
z("flames.opacity", "flames", 1, 0, 1, .01, "x", "Opacity at birth as a multiple of the kit's."),
|
|
489
|
+
z("flames.ramp", "flames", 0, 0, 1, .01, "", "How far the colour curve is pulled toward the edge colour by the end of a flame's life: 0 keeps the kit's curve, 1 ends at the edge colour (a clear core-to-edge ramp)."),
|
|
490
|
+
a("flames.edgeColor", "flames", [
|
|
491
|
+
.55,
|
|
492
|
+
.12,
|
|
493
|
+
.04
|
|
494
|
+
], 0, 1, "The colour the flame edge ramps to (linear RGB), used while flames.ramp is above 0."),
|
|
495
|
+
z("flames.core", "flames", 2200, 1200, 3e3, 10, "K", "Temperature of the hot core (its blackbody colour, through the camera shoulder, sets the yellow-white of the core). At 2200 a hearth keeps its own colours."),
|
|
496
|
+
z("flames.edge", "flames", 1e3, 600, 2e3, 10, "K", "Temperature of the cool edge and the tips (deep orange to red). At 1000 a hearth keeps its own colours."),
|
|
497
|
+
z("flames.peak", "flames", 1, .05, 16, .01, "", "The brightest channel a flame pixel may show, scene-linear: 1 is display white on an 8-bit target; raise it under a tonemap so the core blooms."),
|
|
498
|
+
z("flames.flicker", "flames", 1, 0, 3, .01, "x", "Puffing of the flames and flicker of their light as a multiple of the physical (Cetegen and Ahmed 1993); 0 holds them steady."),
|
|
499
|
+
z("flames.tongues", "flames", 1, .25, 4, .01, "x", "Size of the flame tongues as a multiple of the default (0.22 of the flame length across): smaller is busier."),
|
|
500
|
+
z("flames.glow", "flames", 1, 0, 8, .01, "x", "Light a flame volume throws into the smoky air and onto the ground around it, as a multiple of the physical (Sun et al. 2005); 0 turns it off. Hearth flames have none."),
|
|
501
|
+
z("flames.haze", "flames", 1, 0, 20, .01, "x", "Haze of the air around a flame volume as a multiple of its own (a Flame 0.0005 per metre, a FireFront's flames 0.003): thicker haze glows more round the fire."),
|
|
502
|
+
z("embers.size", "embers", 1, .1, 8, .01, "x", "Ember size as a multiple of the kit's: fewer, larger embers read better at a distance."),
|
|
503
|
+
z("embers.count", "embers", 1, 0, 4, .01, "x", "Embers born a second as a multiple of the kit's rate."),
|
|
504
|
+
z("embers.radiance", "embers", 1, 0, 4, .01, "x", "Ember brightness as a multiple of the kit's.")
|
|
505
|
+
], me = f(B), V = p(B);
|
|
506
|
+
function he() {
|
|
507
|
+
return d(B);
|
|
508
|
+
}
|
|
509
|
+
var ge = {
|
|
510
|
+
natural: {},
|
|
511
|
+
animatedFeature: {
|
|
512
|
+
"flames.size": 1.5,
|
|
513
|
+
"flames.radiance": .75,
|
|
514
|
+
"flames.opacity": .85,
|
|
515
|
+
"flames.ramp": .6,
|
|
516
|
+
"flames.edgeColor": [
|
|
517
|
+
.55,
|
|
518
|
+
.12,
|
|
519
|
+
.04
|
|
520
|
+
],
|
|
521
|
+
"embers.size": 2.2,
|
|
522
|
+
"embers.count": .5,
|
|
523
|
+
"embers.radiance": .8
|
|
524
|
+
}
|
|
525
|
+
}, H = /* @__PURE__ */ new WeakMap();
|
|
526
|
+
function U(e) {
|
|
527
|
+
let t = H.get(e);
|
|
528
|
+
if (!t) {
|
|
529
|
+
let n = e.curves;
|
|
530
|
+
t = {
|
|
531
|
+
size: e.size,
|
|
532
|
+
intensity: e.intensity,
|
|
533
|
+
rate: e.rate,
|
|
534
|
+
turbulence: e.turbulence,
|
|
535
|
+
frequency: e.frequency,
|
|
536
|
+
color: Array.isArray(e.color) ? [...e.color] : void 0,
|
|
537
|
+
stops: n?.color?.map((e) => ({
|
|
538
|
+
at: e.at,
|
|
539
|
+
color: [
|
|
540
|
+
e.color[0],
|
|
541
|
+
e.color[1],
|
|
542
|
+
e.color[2]
|
|
543
|
+
]
|
|
544
|
+
}))
|
|
545
|
+
}, H.set(e, t);
|
|
546
|
+
}
|
|
547
|
+
return t;
|
|
548
|
+
}
|
|
549
|
+
function W(e, t, n, r, i) {
|
|
550
|
+
r === 1 && n === void 0 ? delete e[t] : e[t] = (n ?? i) * r;
|
|
551
|
+
}
|
|
552
|
+
function _e(t, n) {
|
|
553
|
+
let r = n("flames.ramp"), i = n("flames.edgeColor"), a = n("flames.opacity"), o = t.options, s = U(o), c = n("flames.core"), l = n("flames.edge"), u = n("flames.peak"), d = c !== 2200 || l !== 1e3 || u !== 1;
|
|
554
|
+
if (r > 0 && !s.stops) throw TypeError("Flame setting flames.ramp needs flames with a colour curve (curves.color); use 0");
|
|
555
|
+
if (d && !s.stops) throw TypeError("Flame settings flames.core, edge and peak need flames with a colour curve (curves.color)");
|
|
556
|
+
if (W(o, "size", s.size, n("flames.size"), .1), W(o, "intensity", s.intensity, n("flames.radiance"), 1), W(o, "turbulence", s.turbulence, n("flames.flicker"), 0), W(o, "frequency", s.frequency, 1 / n("flames.tongues"), 1), a === 1) s.color ? o.color = [...s.color] : delete o.color;
|
|
557
|
+
else {
|
|
558
|
+
let e = s.color ? [...s.color] : [
|
|
559
|
+
1,
|
|
560
|
+
1,
|
|
561
|
+
1,
|
|
562
|
+
1
|
|
563
|
+
];
|
|
564
|
+
e[3] = (e[3] ?? 1) * a, o.color = e;
|
|
565
|
+
}
|
|
566
|
+
if (s.stops) {
|
|
567
|
+
let t = o.curves, n = d ? e({
|
|
568
|
+
core: Math.max(c, l + 1),
|
|
569
|
+
edge: l,
|
|
570
|
+
peak: u
|
|
571
|
+
}) : void 0;
|
|
572
|
+
t.color = s.stops.map((e, t) => {
|
|
573
|
+
let a = n ? n[Math.min(t, n.length - 1)].at : e.at;
|
|
574
|
+
return {
|
|
575
|
+
at: a,
|
|
576
|
+
color: (n ? n[Math.min(t, n.length - 1)].color : e.color).map((e, t) => e + (i[t] - e) * r * a)
|
|
577
|
+
};
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
function ve(e, t = {}) {
|
|
582
|
+
m(V, t, "vfx", "FLAME_SETTINGS in @margoengine/vfx/settings");
|
|
583
|
+
let n = (e) => e in t ? t[e] : V.get(e).default, r = typeof e.setFlameLook == "function" ? e : e.flame;
|
|
584
|
+
r && r.setFlameLook(Object.fromEntries(B.map((e) => [e.name, n(e.name)])));
|
|
585
|
+
let i = r ? void 0 : e.particles?.flames;
|
|
586
|
+
i && _e(i, n);
|
|
587
|
+
let a = e.particles?.embers;
|
|
588
|
+
if (a) {
|
|
589
|
+
let e = a.options, t = U(e), r = typeof e.capacity == "number" ? e.capacity : 1e3;
|
|
590
|
+
W(e, "size", t.size, n("embers.size"), .1), W(e, "intensity", t.intensity, n("embers.radiance"), 1), W(e, "rate", t.rate, n("embers.count"), r / 2);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
var G = (e, t, n, r, a, o, s, c) => i(e, t, n, r, a, o, s, c), K = (e) => [o(G("wind.x", "wind", 0, -100, 100, .1, "m/s", `Wind east-west on the ${e}; null follows the weather.`), "wind"), o(G("wind.z", "wind", 0, -100, 100, .1, "m/s", `Wind north-south on the ${e}; null follows the weather.`), "wind")], q = [
|
|
594
|
+
G("flashSize", "flash", 1, 0, 10, .01, "", "Flash size, a multiple of the fireball of the gas of the charge at its explosion temperature (Noble and Abel 1875)."),
|
|
595
|
+
G("flashRadiance", "flash", 40, 0, 3e3, .1, "", "Peak radiance of the flash (HDR); averaged over the shutter, so a flash shorter than a frame still shows."),
|
|
596
|
+
G("flashDuration", "flash", .04, .001, 1, .001, "s", "Fade time of the secondary flash: tens of milliseconds for large guns (Klingenberg and Heimerl 1992)."),
|
|
597
|
+
G("flashLight", "flash", 1, 0, 100, .01, "", "The light of the flash on the scene, a multiple of a sphere light as bright as the flash."),
|
|
598
|
+
G("shutter", "flash", .5, 0, 1, .01, "frame", "Shutter open time as a share of the frame (0.5 a 180 degree shutter)."),
|
|
599
|
+
G("extinction", "smoke", 3, 0, 100, .01, "m2/g", "Mass extinction of the white salt smoke (56% of the powder burns to solids): how thick a bank looks."),
|
|
600
|
+
a("smokeColor", "smoke", [
|
|
601
|
+
.97,
|
|
602
|
+
.95545,
|
|
603
|
+
.9312
|
|
604
|
+
], 0, 1, "Colour of the powder smoke, linear RGB (smokeColor(0))."),
|
|
605
|
+
G("dispersion", "smoke", .5, 0, 5, .01, "", "Richardson constant: how fast the turbulence of the air spreads and thins a bank (Batchelor 1952)."),
|
|
606
|
+
G("smokeLife", "smoke", 600, 1, 7200, 1, "s", "Seconds a bank lives at most."),
|
|
607
|
+
G("stability", "air", 1e-4, 0, .01, 1e-5, "1/s2", "Air stability N^2: the warm rise of a bank levels off (from the next shot)."),
|
|
608
|
+
G("heatFraction", "air", .4, 0, 1, .01, "", "Share of the heat of explosion still in the gas at the muzzle: the buoyancy of a bank (from the next shot)."),
|
|
609
|
+
G("entrainment", "air", .25, .05, 1, .01, "", "Puff radius over distance travelled (Richards 1965, Scorer 1957): how soon the jet stops (from the next shot)."),
|
|
610
|
+
G("sparks", "flash", 1, 0, 10, .01, "", "Burning powder grains thrown out with the flash, a multiple of the 2% of the charge that leaves the bore alight."),
|
|
611
|
+
G("sparkRadiance", "flash", 30, 0, 3e3, .1, "", "Radiance of a burning grain (HDR)."),
|
|
612
|
+
G("sparkSize", "flash", .3, .01, 2, .01, "m", "Drawn width of a burning grain streak: its flame and the halation round it."),
|
|
613
|
+
G("grain", "flash", .003, 5e-4, .02, 1e-4, "m", "Powder grain size: a grain burns d / (2 x 1 cm/s) and its drag stops it (from the next shot)."),
|
|
614
|
+
G("splinters", "hits", 1, 0, 10, .01, "", "Splinters a strike on a ship throws, a multiple of the hole timber in hand-sized pieces."),
|
|
615
|
+
...K("banks")
|
|
616
|
+
], J = [
|
|
617
|
+
G("spread", "fire", .03, 0, 10, .001, "m/s", "How fast the fire runs along the hull."),
|
|
618
|
+
G("burnTime", "fire", 2400, 1, 1e6, 1, "s", "Seconds a stretch of hull burns at full before it dies down."),
|
|
619
|
+
G("deckHeat", "fire", 25e4, 0, 5e6, 1e3, "W/m2", "Heat release of the burning deck: the flames stand at the Heskestad height of it."),
|
|
620
|
+
G("soot", "smoke", .35, 0, 1, .01, "", "Soot share of the smoke (Mulholland and Croarkin 2000): 0 white, 0.35 wood and tar, 1 black."),
|
|
621
|
+
G("opacity", "smoke", .7, 0, 1, .01, "", "Opacity of a smoke puff."),
|
|
622
|
+
G("charRate", "fire", .5, 0, 5, .01, "mm/min", "Char rate of the hull timber under the flames: 0.5 hardwood, 0.65 softwood (EN 1995-1-2)."),
|
|
623
|
+
G("mastFall", "fire", 600, 0, 1e6, 1, "s", "Seconds after the fire reaches a mast that its burnt stays let it fall."),
|
|
624
|
+
...K("fire")
|
|
625
|
+
], ye = p(q), be = p(J), xe = f(q), Se = f(J);
|
|
626
|
+
function Y() {
|
|
627
|
+
return d(q);
|
|
628
|
+
}
|
|
629
|
+
function X() {
|
|
630
|
+
return d(J);
|
|
631
|
+
}
|
|
632
|
+
var Z = {
|
|
633
|
+
trafalgar: {
|
|
634
|
+
stability: 4e-4,
|
|
635
|
+
dispersion: .3,
|
|
636
|
+
extinction: 4,
|
|
637
|
+
smokeLife: 1200
|
|
638
|
+
},
|
|
639
|
+
breezy: {
|
|
640
|
+
stability: 0,
|
|
641
|
+
dispersion: 1,
|
|
642
|
+
extinction: 2.5,
|
|
643
|
+
smokeLife: 300
|
|
644
|
+
},
|
|
645
|
+
animatedFeature: {
|
|
646
|
+
flashSize: 1.4,
|
|
647
|
+
flashRadiance: 60,
|
|
648
|
+
flashDuration: .06,
|
|
649
|
+
smokeColor: [
|
|
650
|
+
.95,
|
|
651
|
+
.92,
|
|
652
|
+
.86
|
|
653
|
+
],
|
|
654
|
+
extinction: 3.5
|
|
655
|
+
}
|
|
656
|
+
}, Ce = {
|
|
657
|
+
tarred: {
|
|
658
|
+
spread: .08,
|
|
659
|
+
soot: .6,
|
|
660
|
+
deckHeat: 4e5
|
|
661
|
+
},
|
|
662
|
+
smouldering: {
|
|
663
|
+
spread: .01,
|
|
664
|
+
soot: .25,
|
|
665
|
+
deckHeat: 12e4,
|
|
666
|
+
opacity: .55
|
|
667
|
+
},
|
|
668
|
+
animatedFeature: {
|
|
669
|
+
soot: .45,
|
|
670
|
+
opacity: .6
|
|
671
|
+
}
|
|
672
|
+
}, Q = (e, t, n, r, i) => {
|
|
673
|
+
m(e, r, "vfx", `${i} in @margoengine/vfx/settings`);
|
|
674
|
+
let a = n.options;
|
|
675
|
+
for (let e of t) {
|
|
676
|
+
if (e.group === "wind") continue;
|
|
677
|
+
let t = e.name in r ? r[e.name] : e.default;
|
|
678
|
+
a[e.name] = Array.isArray(t) ? [...t] : t;
|
|
679
|
+
}
|
|
680
|
+
let o = r["wind.x"] ?? null, s = r["wind.z"] ?? null;
|
|
681
|
+
o === null && s === null ? delete a.wind : a.wind = [o ?? 0, s ?? 0], c(a, "wind", o !== null || s !== null);
|
|
682
|
+
}, $ = (e, t, n) => {
|
|
683
|
+
let r = n.options;
|
|
684
|
+
for (let n of e) {
|
|
685
|
+
let e = r[n.name];
|
|
686
|
+
n.kind === "number" && typeof e == "number" && (t[n.name] = e), n.kind === "color" && Array.isArray(e) && (t[n.name] = [
|
|
687
|
+
e[0],
|
|
688
|
+
e[1],
|
|
689
|
+
e[2]
|
|
690
|
+
]);
|
|
691
|
+
}
|
|
692
|
+
return Array.isArray(r.wind) && (t["wind.x"] = r.wind[0], t["wind.z"] = r.wind[1]), t;
|
|
693
|
+
};
|
|
694
|
+
function we(e, t = {}) {
|
|
695
|
+
Q(ye, q, e, t, "GUNFIRE_SETTINGS");
|
|
696
|
+
}
|
|
697
|
+
function Te(e) {
|
|
698
|
+
return $(q, Y(), e);
|
|
699
|
+
}
|
|
700
|
+
function Ee(e, t = {}) {
|
|
701
|
+
Q(be, J, e, t, "HULL_FIRE_SETTINGS");
|
|
702
|
+
}
|
|
703
|
+
function De(e) {
|
|
704
|
+
return $(J, X(), e);
|
|
705
|
+
}
|
|
706
|
+
//#endregion
|
|
707
|
+
export { fe as FIRE_LIVE_SETTINGS, pe as FIRE_LOOKS, P as FIRE_SETTINGS, me as FLAME_LIVE_SETTINGS, ge as FLAME_LOOKS, B as FLAME_SETTINGS, xe as GUNFIRE_LIVE_SETTINGS, Z as GUNFIRE_LOOKS, q as GUNFIRE_SETTINGS, Se as HULL_FIRE_LIVE_SETTINGS, Ce as HULL_FIRE_LOOKS, J as HULL_FIRE_SETTINGS, C as SAND_LIVE_SETTINGS, ie as SAND_LOOKS, S as SAND_SETTINGS, se as SMOKE_LIVE_SETTINGS, ce as SMOKE_LOOKS, D as SMOKE_SETTINGS, te as VFX_LIVE_SETTINGS, g as VFX_SETTINGS, L as applyFireSettings, ve as applyFlameSettings, we as applyGunfireSettings, Ee as applyHullFireSettings, ae as applySandSettings, ue as applySmokeSettings, ne as applyVfxSettings, I as fireSettingDefaults, R as fireSettingValues, he as flameSettingDefaults, Y as gunfireSettingDefaults, Te as gunfireSettingValues, X as hullFireSettingDefaults, De as hullFireSettingValues, T as sandSettingDefaults, oe as sandSettingValues, k as smokeSettingDefaults, de as smokeSettingValues, v as vfxSettingDefaults, re as vfxSettingValues };
|