@margoengine/vfx 0.0.0-stage → 1.0.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 +2240 -2
- package/dist/base-LGs65K7K.js +709 -0
- package/dist/base.d.ts +869 -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 +237 -0
- package/dist/clouds.js +583 -0
- package/dist/compat-BFjXAQuu.js +14 -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 +154 -0
- package/dist/debris.js +290 -0
- package/dist/depth-collide.d.ts +7 -0
- package/dist/depth-collide.js +96 -0
- package/dist/dust-current.d.ts +66 -0
- package/dist/dust-current.js +92 -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 +610 -0
- package/dist/fire-front.js +1080 -0
- package/dist/fire.d.ts +140 -0
- package/dist/fire.js +194 -0
- package/dist/flame-ramp-VoBKpYnM.js +75 -0
- package/dist/flame-ramp.d.ts +61 -0
- package/dist/flame.d.ts +428 -0
- package/dist/flame.js +817 -0
- package/dist/flipbook.d.ts +7 -0
- package/dist/flipbook.js +23 -0
- package/dist/flocking-shaders.d.ts +48 -0
- package/dist/flocking-sim.d.ts +623 -0
- package/dist/flocking.d.ts +145 -0
- package/dist/flocking.js +1846 -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 +742 -0
- package/dist/gunfire.js +1214 -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 +239 -0
- package/dist/lit-Dx2tNwP-.js +152 -0
- package/dist/lit.d.ts +18 -0
- package/dist/lit.js +1 -0
- package/dist/mesh.d.ts +16 -0
- package/dist/mesh.js +248 -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 +94 -0
- package/dist/reactive-mask-B8xbyzlk.js +69 -0
- package/dist/require-webgpu--tUXPsmA.js +7 -0
- package/dist/ribbons.d.ts +22 -0
- package/dist/ribbons.js +165 -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 +49 -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 +283 -0
- package/dist/smoke.js +504 -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 +198 -4
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { type SettingRow } from './shared/settings.js';
|
|
2
|
+
/** One value of a setting: a number, a colour (linear RGB) or null where `nullable`. */
|
|
3
|
+
export type VfxSettingValue = number | readonly [number, number, number] | null;
|
|
4
|
+
/** Values by setting name; a name left out takes its default. */
|
|
5
|
+
export type VfxSettingValues = Readonly<Record<string, VfxSettingValue>>;
|
|
6
|
+
/** The panel a setting sits in. */
|
|
7
|
+
export type VfxSettingGroup = 'emission' | 'motion' | 'wind' | 'look';
|
|
8
|
+
/** One control: the shared row shape with the effect's groups. Every row is live. */
|
|
9
|
+
export interface VfxSetting extends SettingRow {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly group: VfxSettingGroup;
|
|
12
|
+
readonly kind: 'number' | 'color';
|
|
13
|
+
readonly default: VfxSettingValue;
|
|
14
|
+
}
|
|
15
|
+
/** Every particle control, in panel order. Defaults are what an effect does without the option. */
|
|
16
|
+
export declare const VFX_SETTINGS: readonly VfxSetting[];
|
|
17
|
+
/** The rows that may change every frame (all of them). */
|
|
18
|
+
export declare const VFX_LIVE_SETTINGS: readonly VfxSetting[];
|
|
19
|
+
/** Every setting at its default, as a fresh object to edit (a slider panel's state). */
|
|
20
|
+
export declare function vfxSettingDefaults(): Record<string, VfxSettingValue>;
|
|
21
|
+
/** What {@link applyVfxSettings} writes to: a `VFX`, or anything with options. */
|
|
22
|
+
export interface VfxSettingTarget {
|
|
23
|
+
readonly options: object;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Writes `values` onto the effect (a name left out takes its default), so it shows exactly that state: an option whose
|
|
27
|
+
* values are all at their defaults is left unset, so the effect draws as one that never had it. Null `rate` is the
|
|
28
|
+
* effect's own rate (half its capacity a second). Both wind rows null leave the option unset, which is what the weather
|
|
29
|
+
* drive writes into (and what it leaves alone while a number overrides it); either one given sets the wind `[x, z]`.
|
|
30
|
+
* The options the table does not hold (`position`, `curves`, `emitter` ...) are not touched. To change one value of
|
|
31
|
+
* an effect built with options of its own, start from {@link vfxSettingValues} so the others keep theirs.
|
|
32
|
+
* @throws TypeError for a name not in {@link VFX_SETTINGS}; RangeError for a value outside its row's range or kind, or
|
|
33
|
+
* `lifetime.min` above `lifetime.max`.
|
|
34
|
+
* @example applyVfxSettings(smoke, { ...vfxSettingValues(smoke), 'velocity.y': 5, turbulence: 2 });
|
|
35
|
+
*/
|
|
36
|
+
export declare function applyVfxSettings(target: VfxSettingTarget, values?: VfxSettingValues): void;
|
|
37
|
+
/**
|
|
38
|
+
* The values an effect shows now, as a panel's starting state: each row from the effect's options, or its default
|
|
39
|
+
* where the option is unset (a wind that is not a plain `[x, z]`, such as a sampler, reads as null). Writing them back
|
|
40
|
+
* with {@link applyVfxSettings} leaves the effect's table options as they are.
|
|
41
|
+
*/
|
|
42
|
+
export declare function vfxSettingValues(target: VfxSettingTarget): Record<string, VfxSettingValue>;
|
|
43
|
+
/** The panel a sand setting sits in. */
|
|
44
|
+
export type SandSettingGroup = 'wind' | 'grain' | 'look' | 'layout';
|
|
45
|
+
/** One sand control: the shared row shape. */
|
|
46
|
+
export interface SandSetting extends SettingRow {
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly group: SandSettingGroup;
|
|
49
|
+
readonly kind: 'number' | 'color';
|
|
50
|
+
readonly default: VfxSettingValue;
|
|
51
|
+
}
|
|
52
|
+
/** Every blown-sand control, in panel order. */
|
|
53
|
+
export declare const SAND_SETTINGS: readonly SandSetting[];
|
|
54
|
+
/** The sand rows that may change every frame. */
|
|
55
|
+
export declare const SAND_LIVE_SETTINGS: readonly SandSetting[];
|
|
56
|
+
/** Every sand setting at its default, as a fresh object to edit. */
|
|
57
|
+
export declare function sandSettingDefaults(): Record<string, VfxSettingValue>;
|
|
58
|
+
/** Named looks, values of {@link SAND_SETTINGS}: pass one to {@link applySandSettings}. A wind row left out is null and follows the weather. */
|
|
59
|
+
export declare const SAND_LOOKS: {
|
|
60
|
+
/** Today's defaults: every row at its default, as the blown sand draws with no settings. */
|
|
61
|
+
readonly natural: {};
|
|
62
|
+
/** The animatedFeature family: soft, wide, pale drifts, not a hard streak. */
|
|
63
|
+
readonly animatedFeature: {
|
|
64
|
+
readonly 'wind.speed': 8;
|
|
65
|
+
readonly 'wind.gust': 0.25;
|
|
66
|
+
readonly streak: 0.5;
|
|
67
|
+
readonly height: 0.35;
|
|
68
|
+
readonly opacity: 0.45;
|
|
69
|
+
};
|
|
70
|
+
/** Fine sand in a light wind: a pale low drift. */
|
|
71
|
+
readonly drift: {
|
|
72
|
+
readonly 'wind.speed': 8;
|
|
73
|
+
readonly 'wind.direction': 90;
|
|
74
|
+
readonly 'wind.gust': 0.3;
|
|
75
|
+
readonly streak: 0.5;
|
|
76
|
+
readonly height: 0.2;
|
|
77
|
+
readonly opacity: 0.5;
|
|
78
|
+
};
|
|
79
|
+
/** Sand in a gale: long streaks, thick and high. */
|
|
80
|
+
readonly sandstorm: {
|
|
81
|
+
readonly 'wind.speed': 18;
|
|
82
|
+
readonly 'wind.direction': 90;
|
|
83
|
+
readonly 'wind.gust': 0.7;
|
|
84
|
+
readonly streak: 1.2;
|
|
85
|
+
readonly height: 0.8;
|
|
86
|
+
readonly opacity: 0.8;
|
|
87
|
+
};
|
|
88
|
+
/** Sand of any weather: every wind row null, so the weather's wind blows it. */
|
|
89
|
+
readonly weather: {};
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Writes `values` onto a `BlownSand` (a name left out takes its default), so it shows exactly that state. A null
|
|
93
|
+
* `wind.speed` leaves the wind `{speed: 0}`, which `WeatherDrive` then fills from the weather; a null `fog`,
|
|
94
|
+
* `threshold` or `gustiness` leaves the option unset. Options the table does not hold are not touched.
|
|
95
|
+
* @throws TypeError for a name not in {@link SAND_SETTINGS}; RangeError for a value outside its row's range.
|
|
96
|
+
* @example applySandSettings(sand, SAND_LOOKS.sandstorm);
|
|
97
|
+
*/
|
|
98
|
+
export declare function applySandSettings(target: VfxSettingTarget, values?: VfxSettingValues): void;
|
|
99
|
+
/**
|
|
100
|
+
* The values a sand layer shows now, as a panel's starting state: each row from its options, or its default where
|
|
101
|
+
* the option is unset (a wind that is a `WindField`, or a speed of 0, reads as null: it follows the weather).
|
|
102
|
+
*/
|
|
103
|
+
export declare function sandSettingValues(target: VfxSettingTarget): Record<string, VfxSettingValue>;
|
|
104
|
+
/** The panel a smoke setting sits in. */
|
|
105
|
+
export type SmokeSettingGroup = 'source' | 'air' | 'wind' | 'look';
|
|
106
|
+
/** One smoke control: the shared row shape. */
|
|
107
|
+
export interface SmokeSetting extends SettingRow {
|
|
108
|
+
readonly name: string;
|
|
109
|
+
readonly group: SmokeSettingGroup;
|
|
110
|
+
readonly kind: 'number' | 'color';
|
|
111
|
+
readonly default: VfxSettingValue;
|
|
112
|
+
}
|
|
113
|
+
/** Every smoke column control, in panel order. Defaults are what `Smoke.attach({position})` does. */
|
|
114
|
+
export declare const SMOKE_SETTINGS: readonly SmokeSetting[];
|
|
115
|
+
/** The smoke rows that may change every frame. */
|
|
116
|
+
export declare const SMOKE_LIVE_SETTINGS: readonly SmokeSetting[];
|
|
117
|
+
/** Every smoke setting at its default, as a fresh object to edit. */
|
|
118
|
+
export declare function smokeSettingDefaults(): Record<string, VfxSettingValue>;
|
|
119
|
+
/** Named looks, values of {@link SMOKE_SETTINGS}: pass one to {@link applySmokeSettings}. Wind rows left out follow the weather. */
|
|
120
|
+
export declare const SMOKE_LOOKS: {
|
|
121
|
+
/** Today's defaults: every row at its default, as the smoke draws with no settings. */
|
|
122
|
+
readonly natural: {};
|
|
123
|
+
/** A wood hearth or camp fire: a thin pale column. */
|
|
124
|
+
readonly campfire: {
|
|
125
|
+
readonly heat: 20000;
|
|
126
|
+
readonly radius: 0.3;
|
|
127
|
+
readonly rate: 12;
|
|
128
|
+
readonly color: readonly [0.42, 0.41, 0.4];
|
|
129
|
+
readonly opacity: 0.35;
|
|
130
|
+
readonly turbulence: 0.6;
|
|
131
|
+
};
|
|
132
|
+
/** A burning house: a thick grey-brown column. */
|
|
133
|
+
readonly houseFire: {
|
|
134
|
+
readonly heat: 5000000;
|
|
135
|
+
readonly radius: 3;
|
|
136
|
+
readonly rate: 20;
|
|
137
|
+
readonly color: readonly [0.22, 0.2, 0.18];
|
|
138
|
+
readonly opacity: 0.6;
|
|
139
|
+
};
|
|
140
|
+
/** A wildfire head: a broad column that tops out in the stable air above the mixed layer. */
|
|
141
|
+
readonly wildfire: {
|
|
142
|
+
readonly heat: 1000000000;
|
|
143
|
+
readonly radius: 40;
|
|
144
|
+
readonly rate: 30;
|
|
145
|
+
readonly lifetime: 240;
|
|
146
|
+
readonly stability: 0.0003;
|
|
147
|
+
readonly color: readonly [0.33, 0.29, 0.25];
|
|
148
|
+
readonly opacity: 0.6;
|
|
149
|
+
readonly turbulence: 1;
|
|
150
|
+
};
|
|
151
|
+
/** Burning oil or tyres: black. */
|
|
152
|
+
readonly oil: {
|
|
153
|
+
readonly heat: 20000000;
|
|
154
|
+
readonly radius: 4;
|
|
155
|
+
readonly rate: 25;
|
|
156
|
+
readonly color: readonly [0.03, 0.03, 0.03];
|
|
157
|
+
readonly opacity: 0.8;
|
|
158
|
+
};
|
|
159
|
+
/** The animatedFeature family: a soft lit column in one large shape, little small-scale turbulence. */
|
|
160
|
+
readonly animatedFeature: {
|
|
161
|
+
readonly heat: 500000;
|
|
162
|
+
readonly radius: 1.5;
|
|
163
|
+
readonly rate: 18;
|
|
164
|
+
readonly color: readonly [0.35, 0.33, 0.31];
|
|
165
|
+
readonly opacity: 0.5;
|
|
166
|
+
readonly turbulence: 0.5;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* A `FireFront` of `@margoengine/vfx/fire-front` (or anything that owns a pool of smoke columns): the front sets each
|
|
171
|
+
* column's heat and source radius from its segment every step, so a look writes the other rows onto every column it has
|
|
172
|
+
* and every column it makes later, through `setSmokeLook`.
|
|
173
|
+
*/
|
|
174
|
+
export interface SmokeColumnsTarget {
|
|
175
|
+
readonly smokeColumns: readonly VfxSettingTarget[];
|
|
176
|
+
/** Keeps `write` and calls it on every column now and on each one made later. */
|
|
177
|
+
setSmokeLook(write: (column: VfxSettingTarget) => void): unknown;
|
|
178
|
+
}
|
|
179
|
+
/** What {@link applySmokeSettings} writes to: a `Smoke`, or a `FireFront`'s smoke columns. */
|
|
180
|
+
export type SmokeSettingTarget = VfxSettingTarget | SmokeColumnsTarget;
|
|
181
|
+
/**
|
|
182
|
+
* Writes `values` onto a `Smoke` (a name left out takes its default), so it shows exactly that state. Both wind rows
|
|
183
|
+
* null leave the column's own wind unset (it follows its fire or the weather); either one given sets `[x, z]`.
|
|
184
|
+
* `lifetime` is read at attach: write it before `Smoke.attach` (onto the options object) or it waits for the next.
|
|
185
|
+
* A `FireFront` takes the values on every smoke column it has and makes later, except `heat` and `radius`, which the
|
|
186
|
+
* front sets per column from its segments; there a name left out gives back what the front built the column with
|
|
187
|
+
* (its 300 s life, 16 puffs a second, wood smoke and its `smoke` options) and `lifetime` reaches columns made later.
|
|
188
|
+
* @throws TypeError for a name not in {@link SMOKE_SETTINGS}; RangeError for a value outside its row's range.
|
|
189
|
+
* @example applySmokeSettings(smoke, SMOKE_LOOKS.houseFire);
|
|
190
|
+
*/
|
|
191
|
+
export declare function applySmokeSettings(target: SmokeSettingTarget, values?: VfxSettingValues): void;
|
|
192
|
+
/**
|
|
193
|
+
* The values a smoke column shows now, as a panel's starting state: each row from its options, or its default where
|
|
194
|
+
* the option is unset (a wind that is a sampler reads as null).
|
|
195
|
+
*/
|
|
196
|
+
export declare function smokeSettingValues(target: VfxSettingTarget): Record<string, VfxSettingValue>;
|
|
197
|
+
/** The panel a fire setting sits in. */
|
|
198
|
+
export type FireSettingGroup = 'fuel' | 'wind' | 'embers' | 'structures' | 'smoke';
|
|
199
|
+
/** One fire control: the shared row shape. */
|
|
200
|
+
export interface FireSetting extends SettingRow {
|
|
201
|
+
readonly name: string;
|
|
202
|
+
readonly group: FireSettingGroup;
|
|
203
|
+
readonly kind: 'number';
|
|
204
|
+
readonly default: VfxSettingValue;
|
|
205
|
+
}
|
|
206
|
+
/** Every fire front control, in panel order. Defaults are what `FireFront.attach()` does. */
|
|
207
|
+
export declare const FIRE_SETTINGS: readonly FireSetting[];
|
|
208
|
+
/** The fire rows that may change every step (all of them). */
|
|
209
|
+
export declare const FIRE_LIVE_SETTINGS: readonly FireSetting[];
|
|
210
|
+
/** Every fire setting at its default, as a fresh object to edit. */
|
|
211
|
+
export declare function fireSettingDefaults(): Record<string, VfxSettingValue>;
|
|
212
|
+
/** Named fire looks: only values of the rows. */
|
|
213
|
+
export declare const FIRE_LOOKS: Readonly<Record<string, VfxSettingValues>>;
|
|
214
|
+
/**
|
|
215
|
+
* Writes `values` onto a `FireFront` (a name left out takes its default), so it shows exactly that state. Both wind
|
|
216
|
+
* rows null leave the wind unset, which `WeatherDrive` then fills; either one given sets the 10 m wind `[x, z]`.
|
|
217
|
+
* @throws TypeError for a name not in {@link FIRE_SETTINGS}; RangeError for a value outside its row's range.
|
|
218
|
+
* @example applyFireSettings(front, FIRE_LOOKS.santaAna);
|
|
219
|
+
*/
|
|
220
|
+
export declare function applyFireSettings(target: VfxSettingTarget, values?: VfxSettingValues): void;
|
|
221
|
+
/** The values a fire front shows now, as a panel's starting state (a wind that is a sampler reads as null). */
|
|
222
|
+
export declare function fireSettingValues(target: VfxSettingTarget): Record<string, VfxSettingValue>;
|
|
223
|
+
/** The panel a flame setting sits in. */
|
|
224
|
+
export type FlameSettingGroup = 'flames' | 'embers';
|
|
225
|
+
/** One flame control: the shared row shape. */
|
|
226
|
+
export interface FlameSetting extends SettingRow {
|
|
227
|
+
readonly name: string;
|
|
228
|
+
readonly group: FlameSettingGroup;
|
|
229
|
+
readonly kind: 'number' | 'color';
|
|
230
|
+
readonly default: VfxSettingValue;
|
|
231
|
+
}
|
|
232
|
+
/** Every flame control, in panel order. Defaults leave the fire as its kit built it. */
|
|
233
|
+
export declare const FLAME_SETTINGS: readonly FlameSetting[];
|
|
234
|
+
/** The flame rows that may change every frame (all of them). */
|
|
235
|
+
export declare const FLAME_LIVE_SETTINGS: readonly FlameSetting[];
|
|
236
|
+
/** Every flame setting at its default, as a fresh object to edit. */
|
|
237
|
+
export declare function flameSettingDefaults(): Record<string, VfxSettingValue>;
|
|
238
|
+
/** Named flame looks: only values of the rows. */
|
|
239
|
+
export declare const FLAME_LOOKS: {
|
|
240
|
+
/** The kit as it is (every row at its default). */
|
|
241
|
+
readonly natural: {};
|
|
242
|
+
/** The animatedFeature family: larger softer flames, a lower peak radiance, a core-to-edge ramp, fewer larger embers. */
|
|
243
|
+
readonly animatedFeature: {
|
|
244
|
+
readonly 'flames.size': 1.5;
|
|
245
|
+
readonly 'flames.radiance': 0.75;
|
|
246
|
+
readonly 'flames.opacity': 0.85;
|
|
247
|
+
readonly 'flames.ramp': 0.6;
|
|
248
|
+
readonly 'flames.edgeColor': readonly [0.55, 0.12, 0.04];
|
|
249
|
+
readonly 'embers.size': 2.2;
|
|
250
|
+
readonly 'embers.count': 0.5;
|
|
251
|
+
readonly 'embers.radiance': 0.8;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
/** What {@link applyFlameSettings} writes to: a `Fire`, or anything with `particles` holding VFX-like targets. */
|
|
255
|
+
export interface FlameSettingTarget {
|
|
256
|
+
/** Hearth flames (a `Fire` without `flameLength`) and embers. */
|
|
257
|
+
readonly particles?: {
|
|
258
|
+
readonly flames?: VfxSettingTarget;
|
|
259
|
+
readonly embers?: VfxSettingTarget;
|
|
260
|
+
};
|
|
261
|
+
/** A `Fire` with a `flameLength` draws its flames as this volume; the flame rows go to it. */
|
|
262
|
+
readonly flame?: {
|
|
263
|
+
setFlameLook(values: Readonly<Record<string, unknown>>): unknown;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* A target that owns its flame values (a `Flame` of `@margoengine/vfx/flame`, which derives its size and radiance from
|
|
267
|
+
* its length every frame) takes the resolved rows here instead of having its options written.
|
|
268
|
+
*/
|
|
269
|
+
setFlameLook?(values: Readonly<Record<string, unknown>>): unknown;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Writes `values` onto a fire's flames and embers (a name left out takes its default, which gives the kit's own number
|
|
273
|
+
* back), so it shows exactly that state. Every write is a number into an option the effect reads each frame, so it can
|
|
274
|
+
* run every frame of a shot; nothing is created.
|
|
275
|
+
* @throws TypeError for a name not in {@link FLAME_SETTINGS}, or `flames.ramp` above 0 on flames with no colour curve;
|
|
276
|
+
* RangeError for a value outside its row's range or kind.
|
|
277
|
+
* @example applyFlameSettings(fire, FLAME_LOOKS.animatedFeature);
|
|
278
|
+
*/
|
|
279
|
+
export declare function applyFlameSettings(target: FlameSettingTarget, values?: VfxSettingValues): void;
|
|
280
|
+
/** The panel a gunfire setting sits in. */
|
|
281
|
+
export type GunfireSettingGroup = 'flash' | 'smoke' | 'air' | 'wind' | 'fire' | 'hits';
|
|
282
|
+
/** One gunfire or hull fire control: the shared row shape. */
|
|
283
|
+
export interface GunfireSetting extends SettingRow {
|
|
284
|
+
readonly name: string;
|
|
285
|
+
readonly group: GunfireSettingGroup;
|
|
286
|
+
readonly kind: 'number' | 'color';
|
|
287
|
+
readonly default: number | readonly [number, number, number] | null;
|
|
288
|
+
}
|
|
289
|
+
/** The battery's rows (all live). */
|
|
290
|
+
export declare const GUNFIRE_SETTINGS: readonly GunfireSetting[];
|
|
291
|
+
/** The hull fire's rows (all live). */
|
|
292
|
+
export declare const HULL_FIRE_SETTINGS: readonly GunfireSetting[];
|
|
293
|
+
/** The battery rows that may change every frame (all of them). */
|
|
294
|
+
export declare const GUNFIRE_LIVE_SETTINGS: readonly GunfireSetting[];
|
|
295
|
+
/** The hull fire rows that may change every frame (all of them). */
|
|
296
|
+
export declare const HULL_FIRE_LIVE_SETTINGS: readonly GunfireSetting[];
|
|
297
|
+
/** Every battery setting at its default, as a fresh object to edit. */
|
|
298
|
+
export declare function gunfireSettingDefaults(): Record<string, VfxSettingValue>;
|
|
299
|
+
/** Every hull fire setting at its default. */
|
|
300
|
+
export declare function hullFireSettingDefaults(): Record<string, VfxSettingValue>;
|
|
301
|
+
/** Named looks of a battery, values of {@link GUNFIRE_SETTINGS}. Wind rows left out follow the weather. */
|
|
302
|
+
export declare const GUNFIRE_LOOKS: {
|
|
303
|
+
/** A calm humid day of a fleet action: banks that hang low and thick over the line (the light airs of Trafalgar). */
|
|
304
|
+
readonly trafalgar: {
|
|
305
|
+
readonly stability: 0.0004;
|
|
306
|
+
readonly dispersion: 0.3;
|
|
307
|
+
readonly extinction: 4;
|
|
308
|
+
readonly smokeLife: 1200;
|
|
309
|
+
};
|
|
310
|
+
/** A fresh breeze: banks that thin and blow clear within a minute or two. */
|
|
311
|
+
readonly breezy: {
|
|
312
|
+
readonly stability: 0;
|
|
313
|
+
readonly dispersion: 1;
|
|
314
|
+
readonly extinction: 2.5;
|
|
315
|
+
readonly smokeLife: 300;
|
|
316
|
+
};
|
|
317
|
+
/** The animatedFeature family: bigger, softer flashes and a creamy bank, little fine detail. */
|
|
318
|
+
readonly animatedFeature: {
|
|
319
|
+
readonly flashSize: 1.4;
|
|
320
|
+
readonly flashRadiance: 60;
|
|
321
|
+
readonly flashDuration: 0.06;
|
|
322
|
+
readonly smokeColor: readonly [0.95, 0.92, 0.86];
|
|
323
|
+
readonly extinction: 3.5;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
/** Named looks of a burning hull, values of {@link HULL_FIRE_SETTINGS}. */
|
|
327
|
+
export declare const HULL_FIRE_LOOKS: {
|
|
328
|
+
/** Fresh fire in tarred timber and cordage: fast and black. */
|
|
329
|
+
readonly tarred: {
|
|
330
|
+
readonly spread: 0.08;
|
|
331
|
+
readonly soot: 0.6;
|
|
332
|
+
readonly deckHeat: 400000;
|
|
333
|
+
};
|
|
334
|
+
/** A slow fire smouldering below decks. */
|
|
335
|
+
readonly smouldering: {
|
|
336
|
+
readonly spread: 0.01;
|
|
337
|
+
readonly soot: 0.25;
|
|
338
|
+
readonly deckHeat: 120000;
|
|
339
|
+
readonly opacity: 0.55;
|
|
340
|
+
};
|
|
341
|
+
/** The animatedFeature family: one large soft column, dark but not black. */
|
|
342
|
+
readonly animatedFeature: {
|
|
343
|
+
readonly soot: 0.45;
|
|
344
|
+
readonly opacity: 0.6;
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* Writes `values` onto a `Battery` (a name left out takes its default), so it shows exactly that state. Both wind rows
|
|
349
|
+
* null leave its wind unset (it follows the weather); either one given sets `[x, z]`.
|
|
350
|
+
* @throws TypeError for a name not in {@link GUNFIRE_SETTINGS}; RangeError for a value outside its row's range.
|
|
351
|
+
* @example applyGunfireSettings(battery, GUNFIRE_LOOKS.trafalgar);
|
|
352
|
+
*/
|
|
353
|
+
export declare function applyGunfireSettings(target: VfxSettingTarget, values?: VfxSettingValues): void;
|
|
354
|
+
/** The values a battery shows now, as a panel's starting state. */
|
|
355
|
+
export declare function gunfireSettingValues(target: VfxSettingTarget): Record<string, VfxSettingValue>;
|
|
356
|
+
/**
|
|
357
|
+
* Writes `values` onto a `HullFire` (a name left out takes its default), with the wind rule of {@link applyGunfireSettings}.
|
|
358
|
+
* @throws TypeError for a name not in {@link HULL_FIRE_SETTINGS}; RangeError for a value outside its row's range.
|
|
359
|
+
*/
|
|
360
|
+
export declare function applyHullFireSettings(target: VfxSettingTarget, values?: VfxSettingValues): void;
|
|
361
|
+
/** The values a hull fire shows now, as a panel's starting state. */
|
|
362
|
+
export declare function hullFireSettingValues(target: VfxSettingTarget): Record<string, VfxSettingValue>;
|