@zylem/behaviors 0.2.0 → 0.3.1
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 +21 -0
- package/dist/chunk-7JJEIADR.js +2631 -0
- package/dist/chunk-7JJEIADR.js.map +1 -0
- package/dist/{chunk-POZER3MQ.js → chunk-ZPSAXX73.js} +100 -94
- package/dist/chunk-ZPSAXX73.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/particle-emitter/presets.d.ts +2 -2
- package/dist/particle-emitter/presets.js +1 -1
- package/dist/particle-emitter.d.ts +9 -4
- package/dist/particle-emitter.js +2 -2
- package/dist/spark-Dx3cJbTW.d.ts +356 -0
- package/package.json +159 -159
- package/dist/chunk-GYURWCIQ.js +0 -1985
- package/dist/chunk-GYURWCIQ.js.map +0 -1
- package/dist/chunk-POZER3MQ.js.map +0 -1
- package/dist/spark-DDlIg1nM.d.ts +0 -148
package/dist/chunk-GYURWCIQ.js
DELETED
|
@@ -1,1985 +0,0 @@
|
|
|
1
|
-
// src/lib/behaviors/particle-emitter/presets/electricity/arc.ts
|
|
2
|
-
import { RenderMode as RenderMode2 } from "three.quarks";
|
|
3
|
-
|
|
4
|
-
// src/lib/behaviors/particle-emitter/preset-builder.ts
|
|
5
|
-
import {
|
|
6
|
-
AdditiveBlending,
|
|
7
|
-
Color,
|
|
8
|
-
MeshBasicMaterial
|
|
9
|
-
} from "three";
|
|
10
|
-
import {
|
|
11
|
-
Bezier,
|
|
12
|
-
ColorOverLife,
|
|
13
|
-
ConeEmitter,
|
|
14
|
-
ConstantColor,
|
|
15
|
-
ConstantValue,
|
|
16
|
-
ForceOverLife,
|
|
17
|
-
Gradient,
|
|
18
|
-
IntervalValue,
|
|
19
|
-
Noise,
|
|
20
|
-
OrbitOverLife,
|
|
21
|
-
ParticleSystem,
|
|
22
|
-
PiecewiseBezier,
|
|
23
|
-
PointEmitter,
|
|
24
|
-
RenderMode,
|
|
25
|
-
RotationOverLife,
|
|
26
|
-
SizeOverLife,
|
|
27
|
-
SpeedOverLife,
|
|
28
|
-
SphereEmitter,
|
|
29
|
-
Vector3,
|
|
30
|
-
Vector4
|
|
31
|
-
} from "three.quarks";
|
|
32
|
-
var DEFAULT_MAGIC_BEHAVIOR_BY_ALIGNMENT = {
|
|
33
|
-
arcane: {
|
|
34
|
-
temperament: "regal",
|
|
35
|
-
agency: "reactive",
|
|
36
|
-
order: "geometric",
|
|
37
|
-
realityEffect: "warping",
|
|
38
|
-
intensity: 1
|
|
39
|
-
},
|
|
40
|
-
holy: {
|
|
41
|
-
temperament: "calm",
|
|
42
|
-
agency: "passive",
|
|
43
|
-
order: "geometric",
|
|
44
|
-
realityEffect: "illuminating",
|
|
45
|
-
intensity: 1
|
|
46
|
-
},
|
|
47
|
-
corrupted: {
|
|
48
|
-
temperament: "ominous",
|
|
49
|
-
agency: "seeking",
|
|
50
|
-
order: "chaotic",
|
|
51
|
-
realityEffect: "decaying",
|
|
52
|
-
intensity: 1.05
|
|
53
|
-
},
|
|
54
|
-
nature: {
|
|
55
|
-
temperament: "calm",
|
|
56
|
-
agency: "reactive",
|
|
57
|
-
order: "organic",
|
|
58
|
-
realityEffect: "healing",
|
|
59
|
-
intensity: 0.9
|
|
60
|
-
},
|
|
61
|
-
void: {
|
|
62
|
-
temperament: "ominous",
|
|
63
|
-
agency: "seeking",
|
|
64
|
-
order: "chaotic",
|
|
65
|
-
realityEffect: "warping",
|
|
66
|
-
intensity: 1.15
|
|
67
|
-
},
|
|
68
|
-
psychic: {
|
|
69
|
-
temperament: "predatory",
|
|
70
|
-
agency: "sentient-feeling",
|
|
71
|
-
order: "organic",
|
|
72
|
-
realityEffect: "binding",
|
|
73
|
-
intensity: 1
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
var MAGIC_PALETTES = {
|
|
77
|
-
arcane: {
|
|
78
|
-
start: "#dbeafe",
|
|
79
|
-
mid: "#60a5fa",
|
|
80
|
-
end: "#1d4ed8"
|
|
81
|
-
},
|
|
82
|
-
holy: {
|
|
83
|
-
start: "#fff7d1",
|
|
84
|
-
mid: "#fde68a",
|
|
85
|
-
end: "#f59e0b"
|
|
86
|
-
},
|
|
87
|
-
corrupted: {
|
|
88
|
-
start: "#bef264",
|
|
89
|
-
mid: "#84cc16",
|
|
90
|
-
end: "#4d7c0f"
|
|
91
|
-
},
|
|
92
|
-
nature: {
|
|
93
|
-
start: "#dcfce7",
|
|
94
|
-
mid: "#4ade80",
|
|
95
|
-
end: "#15803d"
|
|
96
|
-
},
|
|
97
|
-
void: {
|
|
98
|
-
start: "#c4b5fd",
|
|
99
|
-
mid: "#475569",
|
|
100
|
-
end: "#0f172a"
|
|
101
|
-
},
|
|
102
|
-
psychic: {
|
|
103
|
-
start: "#fce7f3",
|
|
104
|
-
mid: "#f472b6",
|
|
105
|
-
end: "#db2777"
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
function particleEffect(create) {
|
|
109
|
-
return { create };
|
|
110
|
-
}
|
|
111
|
-
function defineSemanticParticlePreset(preset) {
|
|
112
|
-
return preset;
|
|
113
|
-
}
|
|
114
|
-
function createMagicModifier(alignment, overrides = {}) {
|
|
115
|
-
return {
|
|
116
|
-
alignment,
|
|
117
|
-
...DEFAULT_MAGIC_BEHAVIOR_BY_ALIGNMENT[alignment],
|
|
118
|
-
...overrides
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function createRangeValue(value, defaultValue) {
|
|
122
|
-
if (Array.isArray(value)) {
|
|
123
|
-
const min = value[0] ?? defaultValue[0];
|
|
124
|
-
const max = value[1] ?? defaultValue[1];
|
|
125
|
-
return min === max ? new ConstantValue(min) : new IntervalValue(min, max);
|
|
126
|
-
}
|
|
127
|
-
return new ConstantValue(value);
|
|
128
|
-
}
|
|
129
|
-
function toColorVector(color) {
|
|
130
|
-
const parsed = new Color(color);
|
|
131
|
-
return new Vector4(parsed.r, parsed.g, parsed.b, 1);
|
|
132
|
-
}
|
|
133
|
-
function createParticleMaterial(color, options, defaultOpacity) {
|
|
134
|
-
const materialOptions = {
|
|
135
|
-
color,
|
|
136
|
-
transparent: true
|
|
137
|
-
};
|
|
138
|
-
if (options.texture) {
|
|
139
|
-
materialOptions.map = options.texture;
|
|
140
|
-
materialOptions.depthWrite = options.depthWrite ?? false;
|
|
141
|
-
materialOptions.alphaTest = options.alphaTest ?? 0.01;
|
|
142
|
-
} else {
|
|
143
|
-
if (options.depthWrite !== void 0) {
|
|
144
|
-
materialOptions.depthWrite = options.depthWrite;
|
|
145
|
-
}
|
|
146
|
-
if (options.alphaTest !== void 0) {
|
|
147
|
-
materialOptions.alphaTest = options.alphaTest;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
const opacity = options.opacity ?? defaultOpacity;
|
|
151
|
-
if (opacity !== void 0) {
|
|
152
|
-
materialOptions.opacity = opacity;
|
|
153
|
-
}
|
|
154
|
-
if (options.blending !== void 0) {
|
|
155
|
-
materialOptions.blending = options.blending;
|
|
156
|
-
}
|
|
157
|
-
return new MeshBasicMaterial(materialOptions);
|
|
158
|
-
}
|
|
159
|
-
function createTextureSystemOptions(options) {
|
|
160
|
-
const systemOptions = {};
|
|
161
|
-
if (options.uTileCount !== void 0) {
|
|
162
|
-
systemOptions.uTileCount = options.uTileCount;
|
|
163
|
-
}
|
|
164
|
-
if (options.vTileCount !== void 0) {
|
|
165
|
-
systemOptions.vTileCount = options.vTileCount;
|
|
166
|
-
}
|
|
167
|
-
if (options.blendTiles !== void 0) {
|
|
168
|
-
systemOptions.blendTiles = options.blendTiles;
|
|
169
|
-
}
|
|
170
|
-
return systemOptions;
|
|
171
|
-
}
|
|
172
|
-
function createSemanticParticleEffect(preset, options = {}) {
|
|
173
|
-
return particleEffect(() => {
|
|
174
|
-
const magic = normalizeMagicModifier(options.magic);
|
|
175
|
-
const resolvedShape = mergeShapeConfig(preset.system.shape, options.shape);
|
|
176
|
-
const baseBehaviors = mergeBehaviorConfig(
|
|
177
|
-
preset.system.behaviors,
|
|
178
|
-
options.behaviors
|
|
179
|
-
);
|
|
180
|
-
const baseColor = options.color ?? preset.system.defaults.color;
|
|
181
|
-
const resolvedColor = magic ? mixColors(baseColor, MAGIC_PALETTES[magic.alignment].start, 0.2) : baseColor;
|
|
182
|
-
const resolvedBehaviors = magic ? applyMagicBehaviors(baseBehaviors, resolvedColor, magic) : baseBehaviors;
|
|
183
|
-
const resolvedBlending = options.blending ?? (magic ? AdditiveBlending : void 0);
|
|
184
|
-
const materialOptions = {
|
|
185
|
-
...options,
|
|
186
|
-
blending: resolvedBlending
|
|
187
|
-
};
|
|
188
|
-
const resolvedRendererEmitterSettings = {
|
|
189
|
-
...preset.system.rendererEmitterSettings,
|
|
190
|
-
...options.rendererEmitterSettings
|
|
191
|
-
};
|
|
192
|
-
return new ParticleSystem({
|
|
193
|
-
duration: options.duration ?? preset.system.defaults.duration,
|
|
194
|
-
looping: options.looping ?? preset.system.defaults.looping ?? preset.system.emission.type === "rate",
|
|
195
|
-
worldSpace: options.worldSpace ?? preset.system.defaults.worldSpace ?? false,
|
|
196
|
-
startLife: createRangeValue(
|
|
197
|
-
options.life ?? preset.system.defaults.life,
|
|
198
|
-
toRange(preset.system.defaults.life)
|
|
199
|
-
),
|
|
200
|
-
startSpeed: createRangeValue(
|
|
201
|
-
options.speed ?? preset.system.defaults.speed,
|
|
202
|
-
toRange(preset.system.defaults.speed)
|
|
203
|
-
),
|
|
204
|
-
startSize: createRangeValue(
|
|
205
|
-
options.size ?? preset.system.defaults.size,
|
|
206
|
-
toRange(preset.system.defaults.size)
|
|
207
|
-
),
|
|
208
|
-
startRotation: options.rotation !== void 0 || preset.system.defaults.rotation !== void 0 ? createRangeValue(
|
|
209
|
-
options.rotation ?? preset.system.defaults.rotation ?? 0,
|
|
210
|
-
toRange(preset.system.defaults.rotation ?? 0)
|
|
211
|
-
) : void 0,
|
|
212
|
-
startColor: new ConstantColor(toColorVector(resolvedColor)),
|
|
213
|
-
emissionOverTime: preset.system.emission.type === "rate" ? new ConstantValue(
|
|
214
|
-
options.emissionRate ?? preset.system.emission.rate
|
|
215
|
-
) : new ConstantValue(0),
|
|
216
|
-
emissionBursts: preset.system.emission.type === "burst" ? [
|
|
217
|
-
{
|
|
218
|
-
time: 0,
|
|
219
|
-
count: new ConstantValue(
|
|
220
|
-
options.count ?? preset.system.emission.count
|
|
221
|
-
),
|
|
222
|
-
cycle: 1,
|
|
223
|
-
interval: 0,
|
|
224
|
-
probability: 1
|
|
225
|
-
}
|
|
226
|
-
] : void 0,
|
|
227
|
-
shape: createEmitterShape(resolvedShape),
|
|
228
|
-
material: createParticleMaterial(
|
|
229
|
-
resolvedColor,
|
|
230
|
-
materialOptions,
|
|
231
|
-
preset.system.defaults.opacity
|
|
232
|
-
),
|
|
233
|
-
behaviors: createBehaviors(resolvedBehaviors),
|
|
234
|
-
...createTextureSystemOptions(materialOptions),
|
|
235
|
-
renderMode: options.renderMode ?? (magic && magic.agency === "seeking" ? RenderMode.StretchedBillBoard : void 0) ?? preset.system.defaults.renderMode ?? RenderMode.BillBoard,
|
|
236
|
-
rendererEmitterSettings: resolvedRendererEmitterSettings
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
function normalizeMagicModifier(input) {
|
|
241
|
-
if (!input) {
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
if (typeof input === "string") {
|
|
245
|
-
return createMagicModifier(input);
|
|
246
|
-
}
|
|
247
|
-
return createMagicModifier(input.alignment, input);
|
|
248
|
-
}
|
|
249
|
-
function applyMagicBehaviors(base, baseColor, magic) {
|
|
250
|
-
const intensity = clamp(magic.intensity ?? 1, 0.25, 1.5);
|
|
251
|
-
const palette = MAGIC_PALETTES[magic.alignment];
|
|
252
|
-
return {
|
|
253
|
-
...base,
|
|
254
|
-
colorOverLife: tintColorOverLife(
|
|
255
|
-
base?.colorOverLife,
|
|
256
|
-
baseColor,
|
|
257
|
-
palette,
|
|
258
|
-
intensity
|
|
259
|
-
),
|
|
260
|
-
rotationOverLife: addRanges(
|
|
261
|
-
base?.rotationOverLife,
|
|
262
|
-
resolveMagicRotation(magic, intensity)
|
|
263
|
-
),
|
|
264
|
-
forceOverLife: mergeForce(
|
|
265
|
-
base?.forceOverLife,
|
|
266
|
-
resolveMagicForce(magic, intensity)
|
|
267
|
-
),
|
|
268
|
-
noise: mergeNoise(base?.noise, resolveMagicNoise(magic, intensity)),
|
|
269
|
-
orbitOverLife: resolveMagicOrbit(magic, intensity) ?? base?.orbitOverLife
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
function resolveMagicRotation(magic, intensity) {
|
|
273
|
-
const amount = 0.7 + intensity * 1.4;
|
|
274
|
-
switch (magic.order) {
|
|
275
|
-
case "geometric":
|
|
276
|
-
return [amount * 0.45, amount];
|
|
277
|
-
case "organic":
|
|
278
|
-
return [-amount * 0.55, amount * 0.55];
|
|
279
|
-
case "chaotic":
|
|
280
|
-
return [-amount * 2.4, amount * 2.4];
|
|
281
|
-
default:
|
|
282
|
-
return void 0;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function resolveMagicForce(magic, intensity) {
|
|
286
|
-
const amount = 0.2 + intensity * 0.55;
|
|
287
|
-
switch (magic.realityEffect) {
|
|
288
|
-
case "illuminating":
|
|
289
|
-
case "healing":
|
|
290
|
-
return { y: [amount * 0.6, amount] };
|
|
291
|
-
case "decaying":
|
|
292
|
-
return { y: [-amount, -amount * 0.5] };
|
|
293
|
-
case "binding":
|
|
294
|
-
return { y: [-amount * 0.35, amount * 0.15] };
|
|
295
|
-
case "warping":
|
|
296
|
-
return { x: [-amount * 0.35, amount * 0.35], z: [-amount * 0.35, amount * 0.35] };
|
|
297
|
-
default:
|
|
298
|
-
return void 0;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
function resolveMagicNoise(magic, intensity) {
|
|
302
|
-
const calmMultiplier = magic.temperament === "calm" ? 0.6 : 1;
|
|
303
|
-
const ominousBoost = magic.temperament === "ominous" ? 1.25 : 1;
|
|
304
|
-
const basePower = (0.08 + intensity * 0.1) * calmMultiplier * ominousBoost;
|
|
305
|
-
switch (magic.order) {
|
|
306
|
-
case "geometric":
|
|
307
|
-
return {
|
|
308
|
-
frequency: [1.5, 3.5],
|
|
309
|
-
power: [basePower * 0.4, basePower * 0.8],
|
|
310
|
-
positionAmount: [0.08, 0.2],
|
|
311
|
-
rotationAmount: [0.1, 0.2]
|
|
312
|
-
};
|
|
313
|
-
case "organic":
|
|
314
|
-
return {
|
|
315
|
-
frequency: [2.5, 5.5],
|
|
316
|
-
power: [basePower * 0.7, basePower * 1.2],
|
|
317
|
-
positionAmount: [0.12, 0.3],
|
|
318
|
-
rotationAmount: [0.14, 0.26]
|
|
319
|
-
};
|
|
320
|
-
case "chaotic":
|
|
321
|
-
default:
|
|
322
|
-
return {
|
|
323
|
-
frequency: [4, 8],
|
|
324
|
-
power: [basePower, basePower * 1.7],
|
|
325
|
-
positionAmount: [0.18, 0.38],
|
|
326
|
-
rotationAmount: [0.18, 0.34]
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
function resolveMagicOrbit(magic, intensity) {
|
|
331
|
-
if (magic.order === "geometric") {
|
|
332
|
-
return {
|
|
333
|
-
speed: [3 + intensity * 2, 6 + intensity * 3],
|
|
334
|
-
axis: [0, 1, 0]
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
if (magic.agency === "sentient-feeling") {
|
|
338
|
-
return {
|
|
339
|
-
speed: [1 + intensity, 2.5 + intensity * 1.2],
|
|
340
|
-
axis: [0, 1, 0]
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
return void 0;
|
|
344
|
-
}
|
|
345
|
-
function tintColorOverLife(base, baseColor, palette, intensity) {
|
|
346
|
-
if (!base) {
|
|
347
|
-
return {
|
|
348
|
-
colors: [
|
|
349
|
-
[mixColors(baseColor, palette.start, 0.25), 0],
|
|
350
|
-
[mixColors(baseColor, palette.mid, 0.55), 0.45],
|
|
351
|
-
[mixColors(baseColor, palette.end, 0.75), 1]
|
|
352
|
-
],
|
|
353
|
-
alpha: [
|
|
354
|
-
[0.22, 0],
|
|
355
|
-
[1, 0.12],
|
|
356
|
-
[0.52 + intensity * 0.08, 0.64],
|
|
357
|
-
[0, 1]
|
|
358
|
-
]
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
return {
|
|
362
|
-
colors: base.colors.map(([color, stop], index) => {
|
|
363
|
-
const target = index === 0 ? palette.start : index === base.colors.length - 1 ? palette.end : palette.mid;
|
|
364
|
-
const amount = index === 0 ? 0.18 : 0.3 + intensity * 0.15;
|
|
365
|
-
return [mixColors(color, target, amount), stop];
|
|
366
|
-
}),
|
|
367
|
-
alpha: base.alpha
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
function mergeNoise(base, overlay) {
|
|
371
|
-
if (!base) {
|
|
372
|
-
return overlay;
|
|
373
|
-
}
|
|
374
|
-
if (!overlay) {
|
|
375
|
-
return base;
|
|
376
|
-
}
|
|
377
|
-
return {
|
|
378
|
-
frequency: addRanges(base.frequency, overlay.frequency) ?? base.frequency,
|
|
379
|
-
power: addRanges(base.power, overlay.power) ?? base.power,
|
|
380
|
-
positionAmount: addRanges(base.positionAmount, overlay.positionAmount),
|
|
381
|
-
rotationAmount: addRanges(base.rotationAmount, overlay.rotationAmount)
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
function mergeForce(base, overlay) {
|
|
385
|
-
if (!base) {
|
|
386
|
-
return overlay;
|
|
387
|
-
}
|
|
388
|
-
if (!overlay) {
|
|
389
|
-
return base;
|
|
390
|
-
}
|
|
391
|
-
return {
|
|
392
|
-
x: addRanges(base.x, overlay.x),
|
|
393
|
-
y: addRanges(base.y, overlay.y),
|
|
394
|
-
z: addRanges(base.z, overlay.z)
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
function mergeBehaviorConfig(base, overrides) {
|
|
398
|
-
if (!base && !overrides) {
|
|
399
|
-
return void 0;
|
|
400
|
-
}
|
|
401
|
-
const merged = {};
|
|
402
|
-
assignIfDefined(
|
|
403
|
-
merged,
|
|
404
|
-
"colorOverLife",
|
|
405
|
-
resolveOverrideValue(base?.colorOverLife, overrides?.colorOverLife)
|
|
406
|
-
);
|
|
407
|
-
assignIfDefined(
|
|
408
|
-
merged,
|
|
409
|
-
"sizeOverLife",
|
|
410
|
-
resolveOverrideValue(base?.sizeOverLife, overrides?.sizeOverLife)
|
|
411
|
-
);
|
|
412
|
-
assignIfDefined(
|
|
413
|
-
merged,
|
|
414
|
-
"speedOverLife",
|
|
415
|
-
resolveOverrideValue(base?.speedOverLife, overrides?.speedOverLife)
|
|
416
|
-
);
|
|
417
|
-
assignIfDefined(
|
|
418
|
-
merged,
|
|
419
|
-
"rotationOverLife",
|
|
420
|
-
resolveOverrideValue(base?.rotationOverLife, overrides?.rotationOverLife)
|
|
421
|
-
);
|
|
422
|
-
assignIfDefined(
|
|
423
|
-
merged,
|
|
424
|
-
"forceOverLife",
|
|
425
|
-
resolvePartialOverride(base?.forceOverLife, overrides?.forceOverLife)
|
|
426
|
-
);
|
|
427
|
-
assignIfDefined(
|
|
428
|
-
merged,
|
|
429
|
-
"noise",
|
|
430
|
-
resolveNoiseOverride(base?.noise, overrides?.noise)
|
|
431
|
-
);
|
|
432
|
-
assignIfDefined(
|
|
433
|
-
merged,
|
|
434
|
-
"orbitOverLife",
|
|
435
|
-
resolveOrbitOverride(base?.orbitOverLife, overrides?.orbitOverLife)
|
|
436
|
-
);
|
|
437
|
-
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
438
|
-
}
|
|
439
|
-
function mergeShapeConfig(base, override) {
|
|
440
|
-
if (!override) {
|
|
441
|
-
return base;
|
|
442
|
-
}
|
|
443
|
-
if (!base || override.type !== base.type) {
|
|
444
|
-
return override;
|
|
445
|
-
}
|
|
446
|
-
if (override.type === "point") {
|
|
447
|
-
return override;
|
|
448
|
-
}
|
|
449
|
-
if (override.type === "cone" && base.type === "cone") {
|
|
450
|
-
return {
|
|
451
|
-
...base,
|
|
452
|
-
...override
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
if (override.type === "sphere" && base.type === "sphere") {
|
|
456
|
-
return {
|
|
457
|
-
...base,
|
|
458
|
-
...override
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
return override;
|
|
462
|
-
}
|
|
463
|
-
function addRanges(base, overlay) {
|
|
464
|
-
if (base === void 0) {
|
|
465
|
-
return overlay;
|
|
466
|
-
}
|
|
467
|
-
if (overlay === void 0) {
|
|
468
|
-
return base;
|
|
469
|
-
}
|
|
470
|
-
const [baseMin, baseMax] = toRange(base);
|
|
471
|
-
const [overlayMin, overlayMax] = toRange(overlay);
|
|
472
|
-
return [baseMin + overlayMin, baseMax + overlayMax];
|
|
473
|
-
}
|
|
474
|
-
function resolveOverrideValue(base, override) {
|
|
475
|
-
if (override === null) {
|
|
476
|
-
return void 0;
|
|
477
|
-
}
|
|
478
|
-
return override ?? base;
|
|
479
|
-
}
|
|
480
|
-
function resolvePartialOverride(base, override) {
|
|
481
|
-
if (override === null) {
|
|
482
|
-
return void 0;
|
|
483
|
-
}
|
|
484
|
-
if (!override) {
|
|
485
|
-
return base;
|
|
486
|
-
}
|
|
487
|
-
const resolved = {
|
|
488
|
-
...base,
|
|
489
|
-
...override
|
|
490
|
-
};
|
|
491
|
-
return Object.keys(resolved).length > 0 ? resolved : void 0;
|
|
492
|
-
}
|
|
493
|
-
function resolveNoiseOverride(base, override) {
|
|
494
|
-
if (override === null) {
|
|
495
|
-
return void 0;
|
|
496
|
-
}
|
|
497
|
-
if (!override) {
|
|
498
|
-
return base;
|
|
499
|
-
}
|
|
500
|
-
const frequency = override.frequency ?? base?.frequency;
|
|
501
|
-
const power = override.power ?? base?.power;
|
|
502
|
-
if (frequency === void 0 || power === void 0) {
|
|
503
|
-
return void 0;
|
|
504
|
-
}
|
|
505
|
-
return {
|
|
506
|
-
...base,
|
|
507
|
-
...override,
|
|
508
|
-
frequency,
|
|
509
|
-
power
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
function resolveOrbitOverride(base, override) {
|
|
513
|
-
if (override === null) {
|
|
514
|
-
return void 0;
|
|
515
|
-
}
|
|
516
|
-
if (!override) {
|
|
517
|
-
return base;
|
|
518
|
-
}
|
|
519
|
-
const speed = override.speed ?? base?.speed;
|
|
520
|
-
if (speed === void 0) {
|
|
521
|
-
return void 0;
|
|
522
|
-
}
|
|
523
|
-
return {
|
|
524
|
-
...base,
|
|
525
|
-
...override,
|
|
526
|
-
speed
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
function assignIfDefined(target, key, value) {
|
|
530
|
-
if (value !== void 0) {
|
|
531
|
-
target[key] = value;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
function createBehaviors(config) {
|
|
535
|
-
if (!config) {
|
|
536
|
-
return void 0;
|
|
537
|
-
}
|
|
538
|
-
const behaviors = [];
|
|
539
|
-
if (config.colorOverLife) {
|
|
540
|
-
behaviors.push(
|
|
541
|
-
new ColorOverLife(
|
|
542
|
-
new Gradient(
|
|
543
|
-
config.colorOverLife.colors.map(
|
|
544
|
-
([color, stop]) => [toColorVector3(color), stop]
|
|
545
|
-
),
|
|
546
|
-
config.colorOverLife.alpha.map(
|
|
547
|
-
([value, stop]) => [value, stop]
|
|
548
|
-
)
|
|
549
|
-
)
|
|
550
|
-
)
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
if (config.sizeOverLife) {
|
|
554
|
-
behaviors.push(new SizeOverLife(createCurve(config.sizeOverLife)));
|
|
555
|
-
}
|
|
556
|
-
if (config.speedOverLife) {
|
|
557
|
-
behaviors.push(new SpeedOverLife(createCurve(config.speedOverLife)));
|
|
558
|
-
}
|
|
559
|
-
if (config.rotationOverLife !== void 0) {
|
|
560
|
-
behaviors.push(
|
|
561
|
-
new RotationOverLife(
|
|
562
|
-
createRangeValue(config.rotationOverLife, toRange(config.rotationOverLife))
|
|
563
|
-
)
|
|
564
|
-
);
|
|
565
|
-
}
|
|
566
|
-
if (config.forceOverLife) {
|
|
567
|
-
behaviors.push(
|
|
568
|
-
new ForceOverLife(
|
|
569
|
-
createRangeValue(config.forceOverLife.x ?? 0, toRange(config.forceOverLife.x ?? 0)),
|
|
570
|
-
createRangeValue(config.forceOverLife.y ?? 0, toRange(config.forceOverLife.y ?? 0)),
|
|
571
|
-
createRangeValue(config.forceOverLife.z ?? 0, toRange(config.forceOverLife.z ?? 0))
|
|
572
|
-
)
|
|
573
|
-
);
|
|
574
|
-
}
|
|
575
|
-
if (config.noise) {
|
|
576
|
-
behaviors.push(
|
|
577
|
-
new Noise(
|
|
578
|
-
createRangeValue(config.noise.frequency, toRange(config.noise.frequency)),
|
|
579
|
-
createRangeValue(config.noise.power, toRange(config.noise.power)),
|
|
580
|
-
createRangeValue(
|
|
581
|
-
config.noise.positionAmount ?? 0,
|
|
582
|
-
toRange(config.noise.positionAmount ?? 0)
|
|
583
|
-
),
|
|
584
|
-
createRangeValue(
|
|
585
|
-
config.noise.rotationAmount ?? 0,
|
|
586
|
-
toRange(config.noise.rotationAmount ?? 0)
|
|
587
|
-
)
|
|
588
|
-
)
|
|
589
|
-
);
|
|
590
|
-
}
|
|
591
|
-
if (config.orbitOverLife) {
|
|
592
|
-
const axis = config.orbitOverLife.axis ?? [0, 1, 0];
|
|
593
|
-
behaviors.push(
|
|
594
|
-
new OrbitOverLife(
|
|
595
|
-
createRangeValue(
|
|
596
|
-
config.orbitOverLife.speed,
|
|
597
|
-
toRange(config.orbitOverLife.speed)
|
|
598
|
-
),
|
|
599
|
-
new Vector3(axis[0], axis[1], axis[2])
|
|
600
|
-
)
|
|
601
|
-
);
|
|
602
|
-
}
|
|
603
|
-
return behaviors.length > 0 ? behaviors : void 0;
|
|
604
|
-
}
|
|
605
|
-
function createEmitterShape(shape) {
|
|
606
|
-
if (!shape || shape.type === "point") {
|
|
607
|
-
return new PointEmitter();
|
|
608
|
-
}
|
|
609
|
-
if (shape.type === "cone") {
|
|
610
|
-
return new ConeEmitter({
|
|
611
|
-
radius: shape.radius,
|
|
612
|
-
thickness: shape.thickness,
|
|
613
|
-
angle: shape.angle,
|
|
614
|
-
speed: shape.speed !== void 0 ? createRangeValue(shape.speed, toRange(shape.speed)) : void 0
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
return new SphereEmitter({
|
|
618
|
-
radius: shape.radius,
|
|
619
|
-
thickness: shape.thickness,
|
|
620
|
-
speed: shape.speed !== void 0 ? createRangeValue(shape.speed, toRange(shape.speed)) : void 0
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
function createCurve(points) {
|
|
624
|
-
return new PiecewiseBezier([[new Bezier(...points), 0]]);
|
|
625
|
-
}
|
|
626
|
-
function toColorVector3(color) {
|
|
627
|
-
const parsed = new Color(color);
|
|
628
|
-
return new Vector3(parsed.r, parsed.g, parsed.b);
|
|
629
|
-
}
|
|
630
|
-
function toRange(value) {
|
|
631
|
-
if (Array.isArray(value)) {
|
|
632
|
-
return [value[0] ?? 0, value[1] ?? value[0] ?? 0];
|
|
633
|
-
}
|
|
634
|
-
return [value, value];
|
|
635
|
-
}
|
|
636
|
-
function mixColors(base, overlay, amount) {
|
|
637
|
-
const color = new Color(base);
|
|
638
|
-
color.lerp(new Color(overlay), clamp(amount, 0, 1));
|
|
639
|
-
return `#${color.getHexString()}`;
|
|
640
|
-
}
|
|
641
|
-
function clamp(value, min, max) {
|
|
642
|
-
return Math.min(Math.max(value, min), max);
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
// src/lib/behaviors/particle-emitter/presets/electricity/arc.ts
|
|
646
|
-
var electricityArcPreset = defineSemanticParticlePreset({
|
|
647
|
-
family: "electricity",
|
|
648
|
-
variant: "arc",
|
|
649
|
-
description: "directed snapping bridge of charge",
|
|
650
|
-
axes: {
|
|
651
|
-
"continuity vs discontinuity": "semi-continuous",
|
|
652
|
-
"branching tendency": "medium",
|
|
653
|
-
"snap/crackle quality": "high",
|
|
654
|
-
"seeking behavior": "medium",
|
|
655
|
-
"charge buildup": "medium",
|
|
656
|
-
"rhythmic pulsing": "low"
|
|
657
|
-
},
|
|
658
|
-
system: {
|
|
659
|
-
defaults: {
|
|
660
|
-
duration: 0.7,
|
|
661
|
-
looping: true,
|
|
662
|
-
color: "#60a5fa",
|
|
663
|
-
life: [0.12, 0.26],
|
|
664
|
-
size: [0.06, 0.14],
|
|
665
|
-
speed: [2.4, 4],
|
|
666
|
-
rotation: [-0.3, 0.3],
|
|
667
|
-
opacity: 0.96,
|
|
668
|
-
renderMode: RenderMode2.StretchedBillBoard
|
|
669
|
-
},
|
|
670
|
-
emission: { type: "rate", rate: 28 },
|
|
671
|
-
shape: {
|
|
672
|
-
type: "cone",
|
|
673
|
-
radius: 0.06,
|
|
674
|
-
thickness: 1,
|
|
675
|
-
angle: 0.05,
|
|
676
|
-
speed: [1.2, 2.4]
|
|
677
|
-
},
|
|
678
|
-
behaviors: {
|
|
679
|
-
colorOverLife: {
|
|
680
|
-
colors: [
|
|
681
|
-
["#ffffff", 0],
|
|
682
|
-
["#7dd3fc", 0.3],
|
|
683
|
-
["#2563eb", 1]
|
|
684
|
-
],
|
|
685
|
-
alpha: [
|
|
686
|
-
[0.2, 0],
|
|
687
|
-
[1, 0.05],
|
|
688
|
-
[0.46, 0.5],
|
|
689
|
-
[0, 1]
|
|
690
|
-
]
|
|
691
|
-
},
|
|
692
|
-
sizeOverLife: [0.7, 0.96, 0.82, 0.26],
|
|
693
|
-
speedOverLife: [1.08, 0.94, 0.7, 0.38],
|
|
694
|
-
noise: {
|
|
695
|
-
frequency: [2.4, 4.8],
|
|
696
|
-
power: [0.05, 0.12],
|
|
697
|
-
positionAmount: [0.14, 0.28],
|
|
698
|
-
rotationAmount: [0.04, 0.12]
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
rendererEmitterSettings: {
|
|
702
|
-
speedFactor: 0.62,
|
|
703
|
-
lengthFactor: 1.16
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
function arc(options = {}) {
|
|
708
|
-
return createSemanticParticleEffect(electricityArcPreset, options);
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
// src/lib/behaviors/particle-emitter/presets/electricity/pulse.ts
|
|
712
|
-
var electricityPulsePreset = defineSemanticParticlePreset({
|
|
713
|
-
family: "electricity",
|
|
714
|
-
variant: "pulse",
|
|
715
|
-
description: "rhythmic swelling packet of charge",
|
|
716
|
-
axes: {
|
|
717
|
-
"continuity vs discontinuity": "discrete rhythmic",
|
|
718
|
-
"branching tendency": "low",
|
|
719
|
-
"snap/crackle quality": "medium",
|
|
720
|
-
"seeking behavior": "low",
|
|
721
|
-
"charge buildup": "medium",
|
|
722
|
-
"rhythmic pulsing": "high"
|
|
723
|
-
},
|
|
724
|
-
system: {
|
|
725
|
-
defaults: {
|
|
726
|
-
duration: 0.28,
|
|
727
|
-
color: "#a5f3fc",
|
|
728
|
-
life: [0.14, 0.3],
|
|
729
|
-
size: [0.18, 0.34],
|
|
730
|
-
speed: [0.18, 0.42],
|
|
731
|
-
opacity: 0.88
|
|
732
|
-
},
|
|
733
|
-
emission: { type: "burst", count: 10 },
|
|
734
|
-
shape: {
|
|
735
|
-
type: "sphere",
|
|
736
|
-
radius: 0.04,
|
|
737
|
-
thickness: 0.5,
|
|
738
|
-
speed: [0.02, 0.08]
|
|
739
|
-
},
|
|
740
|
-
behaviors: {
|
|
741
|
-
colorOverLife: {
|
|
742
|
-
colors: [
|
|
743
|
-
["#ffffff", 0],
|
|
744
|
-
["#a5f3fc", 0.4],
|
|
745
|
-
["#0891b2", 1]
|
|
746
|
-
],
|
|
747
|
-
alpha: [
|
|
748
|
-
[0.14, 0],
|
|
749
|
-
[0.92, 0.08],
|
|
750
|
-
[0.42, 0.54],
|
|
751
|
-
[0, 1]
|
|
752
|
-
]
|
|
753
|
-
},
|
|
754
|
-
sizeOverLife: [0.2, 0.92, 1.26, 0.18]
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
function pulse(options = {}) {
|
|
759
|
-
return createSemanticParticleEffect(electricityPulsePreset, options);
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
// src/lib/behaviors/particle-emitter/presets/electricity/spark.ts
|
|
763
|
-
import { RenderMode as RenderMode3 } from "three.quarks";
|
|
764
|
-
var electricitySparkPreset = defineSemanticParticlePreset({
|
|
765
|
-
family: "electricity",
|
|
766
|
-
variant: "spark",
|
|
767
|
-
description: "tiny discontinuous discharge",
|
|
768
|
-
axes: {
|
|
769
|
-
"continuity vs discontinuity": "highly discontinuous",
|
|
770
|
-
"branching tendency": "low",
|
|
771
|
-
"snap/crackle quality": "high",
|
|
772
|
-
"seeking behavior": "low",
|
|
773
|
-
"charge buildup": "low",
|
|
774
|
-
"rhythmic pulsing": "low"
|
|
775
|
-
},
|
|
776
|
-
system: {
|
|
777
|
-
defaults: {
|
|
778
|
-
duration: 0.2,
|
|
779
|
-
color: "#7dd3fc",
|
|
780
|
-
life: [0.08, 0.18],
|
|
781
|
-
size: [0.08, 0.16],
|
|
782
|
-
speed: [2.2, 4.2],
|
|
783
|
-
rotation: [-Math.PI, Math.PI],
|
|
784
|
-
opacity: 0.92,
|
|
785
|
-
renderMode: RenderMode3.StretchedBillBoard
|
|
786
|
-
},
|
|
787
|
-
emission: { type: "burst", count: 12 },
|
|
788
|
-
shape: {
|
|
789
|
-
type: "sphere",
|
|
790
|
-
radius: 0.06,
|
|
791
|
-
thickness: 0.95,
|
|
792
|
-
speed: [0.8, 1.6]
|
|
793
|
-
},
|
|
794
|
-
behaviors: {
|
|
795
|
-
colorOverLife: {
|
|
796
|
-
colors: [
|
|
797
|
-
["#ffffff", 0],
|
|
798
|
-
["#bae6fd", 0.3],
|
|
799
|
-
["#38bdf8", 1]
|
|
800
|
-
],
|
|
801
|
-
alpha: [
|
|
802
|
-
[0.22, 0],
|
|
803
|
-
[1, 0.06],
|
|
804
|
-
[0.48, 0.4],
|
|
805
|
-
[0, 1]
|
|
806
|
-
]
|
|
807
|
-
},
|
|
808
|
-
sizeOverLife: [0.44, 0.98, 0.7, 0.04],
|
|
809
|
-
speedOverLife: [1.24, 0.9, 0.36, 0.04]
|
|
810
|
-
},
|
|
811
|
-
rendererEmitterSettings: {
|
|
812
|
-
speedFactor: 0.46,
|
|
813
|
-
lengthFactor: 1.02
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
function spark(options = {}) {
|
|
818
|
-
return createSemanticParticleEffect(electricitySparkPreset, options);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
// src/lib/behaviors/particle-emitter/presets/electricity/storm.ts
|
|
822
|
-
import { RenderMode as RenderMode4 } from "three.quarks";
|
|
823
|
-
var electricityStormPreset = defineSemanticParticlePreset({
|
|
824
|
-
family: "electricity",
|
|
825
|
-
variant: "storm",
|
|
826
|
-
description: "restless volume of crackling atmospheric charge",
|
|
827
|
-
axes: {
|
|
828
|
-
"continuity vs discontinuity": "mixed",
|
|
829
|
-
"branching tendency": "high",
|
|
830
|
-
"snap/crackle quality": "high",
|
|
831
|
-
"seeking behavior": "medium-high",
|
|
832
|
-
"charge buildup": "high",
|
|
833
|
-
"rhythmic pulsing": "medium"
|
|
834
|
-
},
|
|
835
|
-
system: {
|
|
836
|
-
defaults: {
|
|
837
|
-
duration: 1.2,
|
|
838
|
-
looping: true,
|
|
839
|
-
color: "#38bdf8",
|
|
840
|
-
life: [0.32, 0.82],
|
|
841
|
-
size: [0.08, 0.2],
|
|
842
|
-
speed: [2.2, 4.8],
|
|
843
|
-
rotation: [-Math.PI, Math.PI],
|
|
844
|
-
opacity: 0.94,
|
|
845
|
-
renderMode: RenderMode4.StretchedBillBoard
|
|
846
|
-
},
|
|
847
|
-
emission: { type: "rate", rate: 34 },
|
|
848
|
-
shape: {
|
|
849
|
-
type: "sphere",
|
|
850
|
-
radius: 0.16,
|
|
851
|
-
thickness: 0.98,
|
|
852
|
-
speed: [1, 2]
|
|
853
|
-
},
|
|
854
|
-
behaviors: {
|
|
855
|
-
colorOverLife: {
|
|
856
|
-
colors: [
|
|
857
|
-
["#ffffff", 0],
|
|
858
|
-
["#67e8f9", 0.25],
|
|
859
|
-
["#2563eb", 1]
|
|
860
|
-
],
|
|
861
|
-
alpha: [
|
|
862
|
-
[0.18, 0],
|
|
863
|
-
[0.98, 0.06],
|
|
864
|
-
[0.5, 0.5],
|
|
865
|
-
[0, 1]
|
|
866
|
-
]
|
|
867
|
-
},
|
|
868
|
-
sizeOverLife: [0.62, 0.96, 0.84, 0.26],
|
|
869
|
-
speedOverLife: [1.18, 0.94, 0.66, 0.32],
|
|
870
|
-
noise: {
|
|
871
|
-
frequency: [4.8, 8.4],
|
|
872
|
-
power: [0.08, 0.18],
|
|
873
|
-
positionAmount: [0.18, 0.38],
|
|
874
|
-
rotationAmount: [0.08, 0.18]
|
|
875
|
-
}
|
|
876
|
-
},
|
|
877
|
-
rendererEmitterSettings: {
|
|
878
|
-
speedFactor: 0.66,
|
|
879
|
-
lengthFactor: 1.18
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
});
|
|
883
|
-
function storm(options = {}) {
|
|
884
|
-
return createSemanticParticleEffect(electricityStormPreset, options);
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
// src/lib/behaviors/particle-emitter/presets/electricity/surge.ts
|
|
888
|
-
import { RenderMode as RenderMode5 } from "three.quarks";
|
|
889
|
-
var electricitySurgePreset = defineSemanticParticlePreset({
|
|
890
|
-
family: "electricity",
|
|
891
|
-
variant: "surge",
|
|
892
|
-
description: "charge-rich spike that overwhelms the space",
|
|
893
|
-
axes: {
|
|
894
|
-
"continuity vs discontinuity": "bursting",
|
|
895
|
-
"branching tendency": "medium",
|
|
896
|
-
"snap/crackle quality": "high",
|
|
897
|
-
"seeking behavior": "medium",
|
|
898
|
-
"charge buildup": "high",
|
|
899
|
-
"rhythmic pulsing": "medium"
|
|
900
|
-
},
|
|
901
|
-
system: {
|
|
902
|
-
defaults: {
|
|
903
|
-
duration: 0.34,
|
|
904
|
-
color: "#38bdf8",
|
|
905
|
-
life: [0.18, 0.36],
|
|
906
|
-
size: [0.12, 0.26],
|
|
907
|
-
speed: [2.8, 5.2],
|
|
908
|
-
rotation: [-Math.PI, Math.PI],
|
|
909
|
-
opacity: 0.98,
|
|
910
|
-
renderMode: RenderMode5.StretchedBillBoard
|
|
911
|
-
},
|
|
912
|
-
emission: { type: "burst", count: 24 },
|
|
913
|
-
shape: {
|
|
914
|
-
type: "sphere",
|
|
915
|
-
radius: 0.08,
|
|
916
|
-
thickness: 0.98,
|
|
917
|
-
speed: [1.1, 2.2]
|
|
918
|
-
},
|
|
919
|
-
behaviors: {
|
|
920
|
-
colorOverLife: {
|
|
921
|
-
colors: [
|
|
922
|
-
["#ffffff", 0],
|
|
923
|
-
["#67e8f9", 0.22],
|
|
924
|
-
["#0ea5e9", 1]
|
|
925
|
-
],
|
|
926
|
-
alpha: [
|
|
927
|
-
[0.22, 0],
|
|
928
|
-
[1, 0.04],
|
|
929
|
-
[0.52, 0.44],
|
|
930
|
-
[0, 1]
|
|
931
|
-
]
|
|
932
|
-
},
|
|
933
|
-
sizeOverLife: [0.32, 0.9, 0.84, 0.08],
|
|
934
|
-
speedOverLife: [1.22, 0.88, 0.42, 0.06],
|
|
935
|
-
noise: {
|
|
936
|
-
frequency: [4.5, 8],
|
|
937
|
-
power: [0.08, 0.18],
|
|
938
|
-
positionAmount: [0.22, 0.42],
|
|
939
|
-
rotationAmount: [0.08, 0.16]
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
rendererEmitterSettings: {
|
|
943
|
-
speedFactor: 0.68,
|
|
944
|
-
lengthFactor: 1.2
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
});
|
|
948
|
-
function surge(options = {}) {
|
|
949
|
-
return createSemanticParticleEffect(electricitySurgePreset, options);
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
// src/lib/behaviors/particle-emitter/presets/electricity/index.ts
|
|
953
|
-
var electricityPresets = {
|
|
954
|
-
spark,
|
|
955
|
-
arc,
|
|
956
|
-
surge,
|
|
957
|
-
pulse,
|
|
958
|
-
storm
|
|
959
|
-
};
|
|
960
|
-
|
|
961
|
-
// src/lib/behaviors/particle-emitter/presets/fire/blaze.ts
|
|
962
|
-
import { RenderMode as RenderMode6 } from "three.quarks";
|
|
963
|
-
var fireBlazePreset = defineSemanticParticlePreset({
|
|
964
|
-
family: "fire",
|
|
965
|
-
variant: "blaze",
|
|
966
|
-
description: "sustained, strong open burning",
|
|
967
|
-
axes: {
|
|
968
|
-
"heat feel": "intense",
|
|
969
|
-
"hunger/spread tendency": "high",
|
|
970
|
-
"smoke affinity": "medium",
|
|
971
|
-
turbulence: "high",
|
|
972
|
-
residuality: "medium"
|
|
973
|
-
},
|
|
974
|
-
system: {
|
|
975
|
-
defaults: {
|
|
976
|
-
duration: 1.8,
|
|
977
|
-
looping: true,
|
|
978
|
-
color: "#f97316",
|
|
979
|
-
life: [0.55, 1.1],
|
|
980
|
-
size: [0.32, 0.62],
|
|
981
|
-
speed: [0.55, 1.4],
|
|
982
|
-
rotation: [-0.24, 0.24],
|
|
983
|
-
opacity: 0.96,
|
|
984
|
-
renderMode: RenderMode6.VerticalBillBoard
|
|
985
|
-
},
|
|
986
|
-
emission: { type: "rate", rate: 42 },
|
|
987
|
-
shape: {
|
|
988
|
-
type: "cone",
|
|
989
|
-
radius: 0.18,
|
|
990
|
-
thickness: 1,
|
|
991
|
-
angle: 0.28,
|
|
992
|
-
speed: [0.35, 0.95]
|
|
993
|
-
},
|
|
994
|
-
behaviors: {
|
|
995
|
-
colorOverLife: {
|
|
996
|
-
colors: [
|
|
997
|
-
["#ffffff", 0],
|
|
998
|
-
["#fde68a", 0.18],
|
|
999
|
-
["#fb923c", 0.5],
|
|
1000
|
-
["#ef4444", 1]
|
|
1001
|
-
],
|
|
1002
|
-
alpha: [
|
|
1003
|
-
[0.18, 0],
|
|
1004
|
-
[1, 0.08],
|
|
1005
|
-
[0.56, 0.54],
|
|
1006
|
-
[0, 1]
|
|
1007
|
-
]
|
|
1008
|
-
},
|
|
1009
|
-
sizeOverLife: [0.45, 0.92, 1.14, 0.22],
|
|
1010
|
-
speedOverLife: [1.08, 0.96, 0.62, 0.16],
|
|
1011
|
-
forceOverLife: {
|
|
1012
|
-
y: [0.38, 0.72]
|
|
1013
|
-
},
|
|
1014
|
-
noise: {
|
|
1015
|
-
frequency: [4.5, 6.5],
|
|
1016
|
-
power: [0.1, 0.18],
|
|
1017
|
-
positionAmount: [0.32, 0.55],
|
|
1018
|
-
rotationAmount: [0.18, 0.3]
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
});
|
|
1023
|
-
function blaze(options = {}) {
|
|
1024
|
-
return createSemanticParticleEffect(fireBlazePreset, options);
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
// src/lib/behaviors/particle-emitter/presets/fire/ember.ts
|
|
1028
|
-
var fireEmberPreset = defineSemanticParticlePreset({
|
|
1029
|
-
family: "fire",
|
|
1030
|
-
variant: "ember",
|
|
1031
|
-
description: "lingering, warm, residual, drifting",
|
|
1032
|
-
axes: {
|
|
1033
|
-
"heat feel": "warm",
|
|
1034
|
-
"hunger/spread tendency": "low",
|
|
1035
|
-
"smoke affinity": "medium",
|
|
1036
|
-
turbulence: "low",
|
|
1037
|
-
residuality: "high"
|
|
1038
|
-
},
|
|
1039
|
-
system: {
|
|
1040
|
-
defaults: {
|
|
1041
|
-
duration: 2.2,
|
|
1042
|
-
looping: true,
|
|
1043
|
-
color: "#fb923c",
|
|
1044
|
-
life: [1.1, 2.2],
|
|
1045
|
-
size: [0.05, 0.14],
|
|
1046
|
-
speed: [0.08, 0.32],
|
|
1047
|
-
rotation: [-0.45, 0.45],
|
|
1048
|
-
opacity: 0.9
|
|
1049
|
-
},
|
|
1050
|
-
emission: { type: "rate", rate: 8 },
|
|
1051
|
-
shape: {
|
|
1052
|
-
type: "cone",
|
|
1053
|
-
radius: 0.12,
|
|
1054
|
-
thickness: 1,
|
|
1055
|
-
angle: 0.22,
|
|
1056
|
-
speed: [0.08, 0.26]
|
|
1057
|
-
},
|
|
1058
|
-
behaviors: {
|
|
1059
|
-
colorOverLife: {
|
|
1060
|
-
colors: [
|
|
1061
|
-
["#fff7d1", 0],
|
|
1062
|
-
["#fb923c", 0.35],
|
|
1063
|
-
["#b45309", 1]
|
|
1064
|
-
],
|
|
1065
|
-
alpha: [
|
|
1066
|
-
[0.12, 0],
|
|
1067
|
-
[0.9, 0.12],
|
|
1068
|
-
[0.42, 0.7],
|
|
1069
|
-
[0, 1]
|
|
1070
|
-
]
|
|
1071
|
-
},
|
|
1072
|
-
sizeOverLife: [0.42, 0.9, 0.72, 0.18],
|
|
1073
|
-
forceOverLife: {
|
|
1074
|
-
y: [0.18, 0.42]
|
|
1075
|
-
},
|
|
1076
|
-
noise: {
|
|
1077
|
-
frequency: [1.2, 2.6],
|
|
1078
|
-
power: [0.02, 0.08],
|
|
1079
|
-
positionAmount: [0.06, 0.14],
|
|
1080
|
-
rotationAmount: [0.04, 0.1]
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
});
|
|
1085
|
-
function ember(options = {}) {
|
|
1086
|
-
return createSemanticParticleEffect(fireEmberPreset, options);
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
// src/lib/behaviors/particle-emitter/presets/fire/flamelet.ts
|
|
1090
|
-
import { RenderMode as RenderMode7 } from "three.quarks";
|
|
1091
|
-
var fireFlameletPreset = defineSemanticParticlePreset({
|
|
1092
|
-
family: "fire",
|
|
1093
|
-
variant: "flamelet",
|
|
1094
|
-
description: "small coherent tongue of flame",
|
|
1095
|
-
axes: {
|
|
1096
|
-
"heat feel": "hot",
|
|
1097
|
-
"hunger/spread tendency": "medium",
|
|
1098
|
-
"smoke affinity": "low",
|
|
1099
|
-
turbulence: "medium",
|
|
1100
|
-
residuality: "low"
|
|
1101
|
-
},
|
|
1102
|
-
system: {
|
|
1103
|
-
defaults: {
|
|
1104
|
-
duration: 1.2,
|
|
1105
|
-
looping: true,
|
|
1106
|
-
color: "#fb923c",
|
|
1107
|
-
life: [0.48, 0.9],
|
|
1108
|
-
size: [0.2, 0.38],
|
|
1109
|
-
speed: [0.35, 0.9],
|
|
1110
|
-
rotation: [-0.18, 0.18],
|
|
1111
|
-
opacity: 0.94,
|
|
1112
|
-
renderMode: RenderMode7.VerticalBillBoard
|
|
1113
|
-
},
|
|
1114
|
-
emission: { type: "rate", rate: 22 },
|
|
1115
|
-
shape: {
|
|
1116
|
-
type: "cone",
|
|
1117
|
-
radius: 0.1,
|
|
1118
|
-
thickness: 1,
|
|
1119
|
-
angle: 0.18,
|
|
1120
|
-
speed: [0.3, 0.72]
|
|
1121
|
-
},
|
|
1122
|
-
behaviors: {
|
|
1123
|
-
colorOverLife: {
|
|
1124
|
-
colors: [
|
|
1125
|
-
["#fff7d1", 0],
|
|
1126
|
-
["#fbbf24", 0.24],
|
|
1127
|
-
["#fb923c", 0.62],
|
|
1128
|
-
["#ef4444", 1]
|
|
1129
|
-
],
|
|
1130
|
-
alpha: [
|
|
1131
|
-
[0.16, 0],
|
|
1132
|
-
[0.94, 0.1],
|
|
1133
|
-
[0.48, 0.58],
|
|
1134
|
-
[0, 1]
|
|
1135
|
-
]
|
|
1136
|
-
},
|
|
1137
|
-
sizeOverLife: [0.44, 0.92, 1.08, 0.16],
|
|
1138
|
-
speedOverLife: [1.08, 0.95, 0.62, 0.18],
|
|
1139
|
-
forceOverLife: {
|
|
1140
|
-
y: [0.3, 0.55]
|
|
1141
|
-
},
|
|
1142
|
-
noise: {
|
|
1143
|
-
frequency: [3, 5],
|
|
1144
|
-
power: [0.08, 0.14],
|
|
1145
|
-
positionAmount: [0.24, 0.42],
|
|
1146
|
-
rotationAmount: [0.16, 0.24]
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
});
|
|
1151
|
-
function flamelet(options = {}) {
|
|
1152
|
-
return createSemanticParticleEffect(fireFlameletPreset, options);
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
// src/lib/behaviors/particle-emitter/presets/fire/smolder.ts
|
|
1156
|
-
var fireSmolderPreset = defineSemanticParticlePreset({
|
|
1157
|
-
family: "fire",
|
|
1158
|
-
variant: "smolder",
|
|
1159
|
-
description: "low-oxygen, persistent, smoky heat",
|
|
1160
|
-
axes: {
|
|
1161
|
-
"heat feel": "buried-hot",
|
|
1162
|
-
"hunger/spread tendency": "low",
|
|
1163
|
-
"smoke affinity": "high",
|
|
1164
|
-
turbulence: "low",
|
|
1165
|
-
residuality: "high"
|
|
1166
|
-
},
|
|
1167
|
-
system: {
|
|
1168
|
-
defaults: {
|
|
1169
|
-
duration: 2.6,
|
|
1170
|
-
looping: true,
|
|
1171
|
-
color: "#c2410c",
|
|
1172
|
-
life: [1.4, 2.8],
|
|
1173
|
-
size: [0.28, 0.58],
|
|
1174
|
-
speed: [0.06, 0.22],
|
|
1175
|
-
rotation: [-0.35, 0.35],
|
|
1176
|
-
opacity: 0.76
|
|
1177
|
-
},
|
|
1178
|
-
emission: { type: "rate", rate: 14 },
|
|
1179
|
-
shape: {
|
|
1180
|
-
type: "cone",
|
|
1181
|
-
radius: 0.16,
|
|
1182
|
-
thickness: 1,
|
|
1183
|
-
angle: 0.12,
|
|
1184
|
-
speed: [0.04, 0.16]
|
|
1185
|
-
},
|
|
1186
|
-
behaviors: {
|
|
1187
|
-
colorOverLife: {
|
|
1188
|
-
colors: [
|
|
1189
|
-
["#fed7aa", 0],
|
|
1190
|
-
["#c2410c", 0.28],
|
|
1191
|
-
["#525252", 1]
|
|
1192
|
-
],
|
|
1193
|
-
alpha: [
|
|
1194
|
-
[0.14, 0],
|
|
1195
|
-
[0.76, 0.12],
|
|
1196
|
-
[0.4, 0.68],
|
|
1197
|
-
[0, 1]
|
|
1198
|
-
]
|
|
1199
|
-
},
|
|
1200
|
-
sizeOverLife: [0.34, 0.86, 1.08, 0.46],
|
|
1201
|
-
forceOverLife: {
|
|
1202
|
-
y: [0.08, 0.2]
|
|
1203
|
-
},
|
|
1204
|
-
noise: {
|
|
1205
|
-
frequency: [1.6, 3.1],
|
|
1206
|
-
power: [0.04, 0.12],
|
|
1207
|
-
positionAmount: [0.12, 0.26],
|
|
1208
|
-
rotationAmount: [0.06, 0.14]
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
});
|
|
1213
|
-
function smolder(options = {}) {
|
|
1214
|
-
return createSemanticParticleEffect(fireSmolderPreset, options);
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
// src/lib/behaviors/particle-emitter/presets/fire/spark.ts
|
|
1218
|
-
import { RenderMode as RenderMode8 } from "three.quarks";
|
|
1219
|
-
var fireSparkPreset = defineSemanticParticlePreset({
|
|
1220
|
-
family: "fire",
|
|
1221
|
-
variant: "spark",
|
|
1222
|
-
description: "tiny, sudden, energetic, fleeting",
|
|
1223
|
-
axes: {
|
|
1224
|
-
"heat feel": "sharp-hot",
|
|
1225
|
-
"hunger/spread tendency": "low",
|
|
1226
|
-
"smoke affinity": "low",
|
|
1227
|
-
turbulence: "high",
|
|
1228
|
-
residuality: "low"
|
|
1229
|
-
},
|
|
1230
|
-
system: {
|
|
1231
|
-
defaults: {
|
|
1232
|
-
duration: 0.24,
|
|
1233
|
-
color: "#ffd166",
|
|
1234
|
-
life: [0.12, 0.24],
|
|
1235
|
-
size: [0.08, 0.16],
|
|
1236
|
-
speed: [1.8, 4.6],
|
|
1237
|
-
rotation: [-Math.PI, Math.PI],
|
|
1238
|
-
renderMode: RenderMode8.StretchedBillBoard
|
|
1239
|
-
},
|
|
1240
|
-
emission: { type: "burst", count: 10 },
|
|
1241
|
-
shape: {
|
|
1242
|
-
type: "sphere",
|
|
1243
|
-
radius: 0.05,
|
|
1244
|
-
thickness: 0.92,
|
|
1245
|
-
speed: [0.45, 1.2]
|
|
1246
|
-
},
|
|
1247
|
-
behaviors: {
|
|
1248
|
-
colorOverLife: {
|
|
1249
|
-
colors: [
|
|
1250
|
-
["#ffffff", 0],
|
|
1251
|
-
["#fde68a", 0.2],
|
|
1252
|
-
["#fb923c", 0.62],
|
|
1253
|
-
["#ef4444", 1]
|
|
1254
|
-
],
|
|
1255
|
-
alpha: [
|
|
1256
|
-
[0.18, 0],
|
|
1257
|
-
[1, 0.08],
|
|
1258
|
-
[0.52, 0.5],
|
|
1259
|
-
[0, 1]
|
|
1260
|
-
]
|
|
1261
|
-
},
|
|
1262
|
-
sizeOverLife: [0.48, 1.08, 0.88, 0.06],
|
|
1263
|
-
speedOverLife: [1.18, 0.88, 0.42, 0.04]
|
|
1264
|
-
},
|
|
1265
|
-
rendererEmitterSettings: {
|
|
1266
|
-
speedFactor: 0.55,
|
|
1267
|
-
lengthFactor: 1.08
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
});
|
|
1271
|
-
function spark2(options = {}) {
|
|
1272
|
-
return createSemanticParticleEffect(fireSparkPreset, options);
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
// src/lib/behaviors/particle-emitter/presets/fire/index.ts
|
|
1276
|
-
var firePresets = {
|
|
1277
|
-
spark: spark2,
|
|
1278
|
-
ember,
|
|
1279
|
-
flamelet,
|
|
1280
|
-
blaze,
|
|
1281
|
-
smolder
|
|
1282
|
-
};
|
|
1283
|
-
|
|
1284
|
-
// src/lib/behaviors/particle-emitter/presets/gas/haze.ts
|
|
1285
|
-
var gasHazePreset = defineSemanticParticlePreset({
|
|
1286
|
-
family: "gas",
|
|
1287
|
-
variant: "haze",
|
|
1288
|
-
description: "broad, thin atmospheric contamination",
|
|
1289
|
-
axes: {
|
|
1290
|
-
"opacity feel": "low",
|
|
1291
|
-
toxicity: "low-medium",
|
|
1292
|
-
buoyancy: "neutral",
|
|
1293
|
-
"spread tendency": "high",
|
|
1294
|
-
thickness: "thin",
|
|
1295
|
-
"staining / contaminating character": "low"
|
|
1296
|
-
},
|
|
1297
|
-
system: {
|
|
1298
|
-
defaults: {
|
|
1299
|
-
duration: 4.4,
|
|
1300
|
-
looping: true,
|
|
1301
|
-
color: "#cbd5e1",
|
|
1302
|
-
life: [3.4, 5.4],
|
|
1303
|
-
size: [0.9, 1.7],
|
|
1304
|
-
speed: [0.02, 0.08],
|
|
1305
|
-
rotation: [-Math.PI, Math.PI],
|
|
1306
|
-
opacity: 0.18
|
|
1307
|
-
},
|
|
1308
|
-
emission: { type: "rate", rate: 10 },
|
|
1309
|
-
shape: {
|
|
1310
|
-
type: "cone",
|
|
1311
|
-
radius: 0.64,
|
|
1312
|
-
thickness: 1,
|
|
1313
|
-
angle: 0.5,
|
|
1314
|
-
speed: [0.01, 0.04]
|
|
1315
|
-
},
|
|
1316
|
-
behaviors: {
|
|
1317
|
-
colorOverLife: {
|
|
1318
|
-
colors: [
|
|
1319
|
-
["#f8fafc", 0],
|
|
1320
|
-
["#cbd5e1", 0.4],
|
|
1321
|
-
["#94a3b8", 1]
|
|
1322
|
-
],
|
|
1323
|
-
alpha: [
|
|
1324
|
-
[0.04, 0],
|
|
1325
|
-
[0.2, 0.24],
|
|
1326
|
-
[0.08, 0.88],
|
|
1327
|
-
[0, 1]
|
|
1328
|
-
]
|
|
1329
|
-
},
|
|
1330
|
-
sizeOverLife: [0.88, 1.08, 1.28, 1.42],
|
|
1331
|
-
noise: {
|
|
1332
|
-
frequency: [0.6, 1.4],
|
|
1333
|
-
power: [0.02, 0.06],
|
|
1334
|
-
positionAmount: [0.08, 0.16],
|
|
1335
|
-
rotationAmount: [0.06, 0.1]
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
});
|
|
1340
|
-
function haze(options = {}) {
|
|
1341
|
-
return createSemanticParticleEffect(gasHazePreset, options);
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
// src/lib/behaviors/particle-emitter/presets/gas/miasma.ts
|
|
1345
|
-
var gasMiasmaPreset = defineSemanticParticlePreset({
|
|
1346
|
-
family: "gas",
|
|
1347
|
-
variant: "miasma",
|
|
1348
|
-
description: "thick, toxic, contaminating exhalation",
|
|
1349
|
-
axes: {
|
|
1350
|
-
"opacity feel": "medium",
|
|
1351
|
-
toxicity: "high",
|
|
1352
|
-
buoyancy: "low-medium",
|
|
1353
|
-
"spread tendency": "high",
|
|
1354
|
-
thickness: "sticky",
|
|
1355
|
-
"staining / contaminating character": "high"
|
|
1356
|
-
},
|
|
1357
|
-
system: {
|
|
1358
|
-
defaults: {
|
|
1359
|
-
duration: 3.8,
|
|
1360
|
-
looping: true,
|
|
1361
|
-
color: "#84cc16",
|
|
1362
|
-
life: [2.8, 4.6],
|
|
1363
|
-
size: [0.52, 1.08],
|
|
1364
|
-
speed: [0.03, 0.16],
|
|
1365
|
-
rotation: [-Math.PI, Math.PI],
|
|
1366
|
-
opacity: 0.5
|
|
1367
|
-
},
|
|
1368
|
-
emission: { type: "rate", rate: 16 },
|
|
1369
|
-
shape: {
|
|
1370
|
-
type: "cone",
|
|
1371
|
-
radius: 0.3,
|
|
1372
|
-
thickness: 1,
|
|
1373
|
-
angle: 0.3,
|
|
1374
|
-
speed: [0.02, 0.08]
|
|
1375
|
-
},
|
|
1376
|
-
behaviors: {
|
|
1377
|
-
colorOverLife: {
|
|
1378
|
-
colors: [
|
|
1379
|
-
["#ecfccb", 0],
|
|
1380
|
-
["#84cc16", 0.4],
|
|
1381
|
-
["#3f6212", 1]
|
|
1382
|
-
],
|
|
1383
|
-
alpha: [
|
|
1384
|
-
[0.08, 0],
|
|
1385
|
-
[0.58, 0.14],
|
|
1386
|
-
[0.24, 0.8],
|
|
1387
|
-
[0, 1]
|
|
1388
|
-
]
|
|
1389
|
-
},
|
|
1390
|
-
sizeOverLife: [0.4, 0.92, 1.3, 1.9],
|
|
1391
|
-
noise: {
|
|
1392
|
-
frequency: [1.8, 3.8],
|
|
1393
|
-
power: [0.08, 0.18],
|
|
1394
|
-
positionAmount: [0.16, 0.34],
|
|
1395
|
-
rotationAmount: [0.08, 0.18]
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
});
|
|
1400
|
-
function miasma(options = {}) {
|
|
1401
|
-
return createSemanticParticleEffect(gasMiasmaPreset, options);
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
// src/lib/behaviors/particle-emitter/presets/gas/plume.ts
|
|
1405
|
-
var gasPlumePreset = defineSemanticParticlePreset({
|
|
1406
|
-
family: "gas",
|
|
1407
|
-
variant: "plume",
|
|
1408
|
-
description: "columnar rising release with strong lift",
|
|
1409
|
-
axes: {
|
|
1410
|
-
"opacity feel": "medium",
|
|
1411
|
-
toxicity: "medium",
|
|
1412
|
-
buoyancy: "very-high",
|
|
1413
|
-
"spread tendency": "medium",
|
|
1414
|
-
thickness: "medium",
|
|
1415
|
-
"staining / contaminating character": "medium"
|
|
1416
|
-
},
|
|
1417
|
-
system: {
|
|
1418
|
-
defaults: {
|
|
1419
|
-
duration: 2.8,
|
|
1420
|
-
looping: true,
|
|
1421
|
-
color: "#94a3b8",
|
|
1422
|
-
life: [1.8, 3.2],
|
|
1423
|
-
size: [0.32, 0.72],
|
|
1424
|
-
speed: [0.16, 0.52],
|
|
1425
|
-
rotation: [-Math.PI, Math.PI],
|
|
1426
|
-
opacity: 0.48
|
|
1427
|
-
},
|
|
1428
|
-
emission: { type: "rate", rate: 22 },
|
|
1429
|
-
shape: {
|
|
1430
|
-
type: "cone",
|
|
1431
|
-
radius: 0.18,
|
|
1432
|
-
thickness: 1,
|
|
1433
|
-
angle: 0.18,
|
|
1434
|
-
speed: [0.08, 0.24]
|
|
1435
|
-
},
|
|
1436
|
-
behaviors: {
|
|
1437
|
-
colorOverLife: {
|
|
1438
|
-
colors: [
|
|
1439
|
-
["#e2e8f0", 0],
|
|
1440
|
-
["#94a3b8", 0.36],
|
|
1441
|
-
["#475569", 1]
|
|
1442
|
-
],
|
|
1443
|
-
alpha: [
|
|
1444
|
-
[0.06, 0],
|
|
1445
|
-
[0.54, 0.14],
|
|
1446
|
-
[0.2, 0.84],
|
|
1447
|
-
[0, 1]
|
|
1448
|
-
]
|
|
1449
|
-
},
|
|
1450
|
-
sizeOverLife: [0.42, 0.92, 1.36, 1.84],
|
|
1451
|
-
forceOverLife: {
|
|
1452
|
-
y: [0.28, 0.6]
|
|
1453
|
-
},
|
|
1454
|
-
noise: {
|
|
1455
|
-
frequency: [1.6, 3.4],
|
|
1456
|
-
power: [0.08, 0.14],
|
|
1457
|
-
positionAmount: [0.14, 0.28],
|
|
1458
|
-
rotationAmount: [0.08, 0.16]
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
});
|
|
1463
|
-
function plume(options = {}) {
|
|
1464
|
-
return createSemanticParticleEffect(gasPlumePreset, options);
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
// src/lib/behaviors/particle-emitter/presets/gas/smoke.ts
|
|
1468
|
-
var gasSmokePreset = defineSemanticParticlePreset({
|
|
1469
|
-
family: "gas",
|
|
1470
|
-
variant: "smoke",
|
|
1471
|
-
description: "opaque, buoyant, lingering combustion residue",
|
|
1472
|
-
axes: {
|
|
1473
|
-
"opacity feel": "medium-high",
|
|
1474
|
-
toxicity: "medium",
|
|
1475
|
-
buoyancy: "high",
|
|
1476
|
-
"spread tendency": "medium",
|
|
1477
|
-
thickness: "medium",
|
|
1478
|
-
"staining / contaminating character": "medium"
|
|
1479
|
-
},
|
|
1480
|
-
system: {
|
|
1481
|
-
defaults: {
|
|
1482
|
-
duration: 3.2,
|
|
1483
|
-
looping: true,
|
|
1484
|
-
color: "#737373",
|
|
1485
|
-
life: [2.4, 4.2],
|
|
1486
|
-
size: [0.45, 0.92],
|
|
1487
|
-
speed: [0.08, 0.3],
|
|
1488
|
-
rotation: [-Math.PI, Math.PI],
|
|
1489
|
-
opacity: 0.58
|
|
1490
|
-
},
|
|
1491
|
-
emission: { type: "rate", rate: 14 },
|
|
1492
|
-
shape: {
|
|
1493
|
-
type: "cone",
|
|
1494
|
-
radius: 0.24,
|
|
1495
|
-
thickness: 1,
|
|
1496
|
-
angle: 0.28,
|
|
1497
|
-
speed: [0.04, 0.14]
|
|
1498
|
-
},
|
|
1499
|
-
behaviors: {
|
|
1500
|
-
colorOverLife: {
|
|
1501
|
-
colors: [
|
|
1502
|
-
["#d4d4d8", 0],
|
|
1503
|
-
["#737373", 0.4],
|
|
1504
|
-
["#404040", 1]
|
|
1505
|
-
],
|
|
1506
|
-
alpha: [
|
|
1507
|
-
[0.08, 0],
|
|
1508
|
-
[0.68, 0.14],
|
|
1509
|
-
[0.24, 0.84],
|
|
1510
|
-
[0, 1]
|
|
1511
|
-
]
|
|
1512
|
-
},
|
|
1513
|
-
sizeOverLife: [0.38, 0.88, 1.4, 2.08],
|
|
1514
|
-
forceOverLife: {
|
|
1515
|
-
y: [0.12, 0.28]
|
|
1516
|
-
},
|
|
1517
|
-
noise: {
|
|
1518
|
-
frequency: [1.2, 2.8],
|
|
1519
|
-
power: [0.08, 0.16],
|
|
1520
|
-
positionAmount: [0.12, 0.26],
|
|
1521
|
-
rotationAmount: [0.08, 0.18]
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
});
|
|
1526
|
-
function smoke(options = {}) {
|
|
1527
|
-
return createSemanticParticleEffect(gasSmokePreset, options);
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
// src/lib/behaviors/particle-emitter/presets/gas/vapor.ts
|
|
1531
|
-
var gasVaporPreset = defineSemanticParticlePreset({
|
|
1532
|
-
family: "gas",
|
|
1533
|
-
variant: "vapor",
|
|
1534
|
-
description: "visible gaseous release with light buoyancy",
|
|
1535
|
-
axes: {
|
|
1536
|
-
"opacity feel": "light",
|
|
1537
|
-
toxicity: "neutral",
|
|
1538
|
-
buoyancy: "high",
|
|
1539
|
-
"spread tendency": "medium",
|
|
1540
|
-
thickness: "thin",
|
|
1541
|
-
"staining / contaminating character": "low"
|
|
1542
|
-
},
|
|
1543
|
-
system: {
|
|
1544
|
-
defaults: {
|
|
1545
|
-
duration: 3,
|
|
1546
|
-
looping: true,
|
|
1547
|
-
color: "#e2e8f0",
|
|
1548
|
-
life: [2.2, 3.6],
|
|
1549
|
-
size: [0.38, 0.78],
|
|
1550
|
-
speed: [0.04, 0.18],
|
|
1551
|
-
rotation: [-Math.PI, Math.PI],
|
|
1552
|
-
opacity: 0.28
|
|
1553
|
-
},
|
|
1554
|
-
emission: { type: "rate", rate: 18 },
|
|
1555
|
-
shape: {
|
|
1556
|
-
type: "cone",
|
|
1557
|
-
radius: 0.28,
|
|
1558
|
-
thickness: 1,
|
|
1559
|
-
angle: 0.36,
|
|
1560
|
-
speed: [0.02, 0.08]
|
|
1561
|
-
},
|
|
1562
|
-
behaviors: {
|
|
1563
|
-
colorOverLife: {
|
|
1564
|
-
colors: [
|
|
1565
|
-
["#f8fafc", 0],
|
|
1566
|
-
["#e2e8f0", 0.36],
|
|
1567
|
-
["#cbd5e1", 1]
|
|
1568
|
-
],
|
|
1569
|
-
alpha: [
|
|
1570
|
-
[0.06, 0],
|
|
1571
|
-
[0.34, 0.22],
|
|
1572
|
-
[0.12, 0.84],
|
|
1573
|
-
[0, 1]
|
|
1574
|
-
]
|
|
1575
|
-
},
|
|
1576
|
-
sizeOverLife: [0.42, 0.9, 1.38, 1.98],
|
|
1577
|
-
forceOverLife: {
|
|
1578
|
-
y: [0.06, 0.18]
|
|
1579
|
-
},
|
|
1580
|
-
noise: {
|
|
1581
|
-
frequency: [1, 2],
|
|
1582
|
-
power: [0.04, 0.08],
|
|
1583
|
-
positionAmount: [0.1, 0.2],
|
|
1584
|
-
rotationAmount: [0.08, 0.14]
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
});
|
|
1589
|
-
function vapor(options = {}) {
|
|
1590
|
-
return createSemanticParticleEffect(gasVaporPreset, options);
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
// src/lib/behaviors/particle-emitter/presets/gas/index.ts
|
|
1594
|
-
var gasPresets = {
|
|
1595
|
-
vapor,
|
|
1596
|
-
smoke,
|
|
1597
|
-
haze,
|
|
1598
|
-
plume,
|
|
1599
|
-
miasma
|
|
1600
|
-
};
|
|
1601
|
-
|
|
1602
|
-
// src/lib/behaviors/particle-emitter/presets/magic/arcane.ts
|
|
1603
|
-
function arcane(options = {}) {
|
|
1604
|
-
return createMagicModifier("arcane", options);
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
// src/lib/behaviors/particle-emitter/presets/magic/corrupted.ts
|
|
1608
|
-
function corrupted(options = {}) {
|
|
1609
|
-
return createMagicModifier("corrupted", options);
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
// src/lib/behaviors/particle-emitter/presets/magic/holy.ts
|
|
1613
|
-
function holy(options = {}) {
|
|
1614
|
-
return createMagicModifier("holy", options);
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
// src/lib/behaviors/particle-emitter/presets/magic/nature.ts
|
|
1618
|
-
function nature(options = {}) {
|
|
1619
|
-
return createMagicModifier("nature", options);
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
// src/lib/behaviors/particle-emitter/presets/magic/psychic.ts
|
|
1623
|
-
function psychic(options = {}) {
|
|
1624
|
-
return createMagicModifier("psychic", options);
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
// src/lib/behaviors/particle-emitter/presets/magic/void.ts
|
|
1628
|
-
function voidMagic(options = {}) {
|
|
1629
|
-
return createMagicModifier("void", options);
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
// src/lib/behaviors/particle-emitter/presets/magic/index.ts
|
|
1633
|
-
var magicPresets = {
|
|
1634
|
-
arcane,
|
|
1635
|
-
holy,
|
|
1636
|
-
corrupted,
|
|
1637
|
-
nature,
|
|
1638
|
-
void: voidMagic,
|
|
1639
|
-
psychic
|
|
1640
|
-
};
|
|
1641
|
-
|
|
1642
|
-
// src/lib/behaviors/particle-emitter/presets/water/drizzle.ts
|
|
1643
|
-
import { RenderMode as RenderMode9 } from "three.quarks";
|
|
1644
|
-
var waterDrizzlePreset = defineSemanticParticlePreset({
|
|
1645
|
-
family: "water",
|
|
1646
|
-
variant: "drizzle",
|
|
1647
|
-
description: "soft, continuous, light fall",
|
|
1648
|
-
axes: {
|
|
1649
|
-
pressure: "low",
|
|
1650
|
-
"surface tension feel": "light",
|
|
1651
|
-
aeration: "low",
|
|
1652
|
-
coherence: "discrete",
|
|
1653
|
-
"gravitational obedience": "very-high"
|
|
1654
|
-
},
|
|
1655
|
-
system: {
|
|
1656
|
-
defaults: {
|
|
1657
|
-
duration: 1.4,
|
|
1658
|
-
looping: true,
|
|
1659
|
-
color: "#e0f2fe",
|
|
1660
|
-
life: [0.6, 1.05],
|
|
1661
|
-
size: [0.05, 0.1],
|
|
1662
|
-
speed: [2.8, 4.4],
|
|
1663
|
-
opacity: 0.62,
|
|
1664
|
-
renderMode: RenderMode9.StretchedBillBoard
|
|
1665
|
-
},
|
|
1666
|
-
emission: { type: "rate", rate: 26 },
|
|
1667
|
-
shape: {
|
|
1668
|
-
type: "cone",
|
|
1669
|
-
radius: 0.46,
|
|
1670
|
-
thickness: 1,
|
|
1671
|
-
angle: 0.04,
|
|
1672
|
-
speed: [1.8, 2.6]
|
|
1673
|
-
},
|
|
1674
|
-
behaviors: {
|
|
1675
|
-
colorOverLife: {
|
|
1676
|
-
colors: [
|
|
1677
|
-
["#f8fafc", 0],
|
|
1678
|
-
["#e0f2fe", 0.45],
|
|
1679
|
-
["#7dd3fc", 1]
|
|
1680
|
-
],
|
|
1681
|
-
alpha: [
|
|
1682
|
-
[0.12, 0],
|
|
1683
|
-
[0.78, 0.08],
|
|
1684
|
-
[0.52, 0.58],
|
|
1685
|
-
[0, 1]
|
|
1686
|
-
]
|
|
1687
|
-
},
|
|
1688
|
-
speedOverLife: [1.02, 1, 0.94, 0.88],
|
|
1689
|
-
forceOverLife: {
|
|
1690
|
-
y: [-8.2, -6.4]
|
|
1691
|
-
}
|
|
1692
|
-
},
|
|
1693
|
-
rendererEmitterSettings: {
|
|
1694
|
-
speedFactor: 0.42,
|
|
1695
|
-
lengthFactor: 1.24
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
});
|
|
1699
|
-
function drizzle(options = {}) {
|
|
1700
|
-
return createSemanticParticleEffect(waterDrizzlePreset, options);
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
// src/lib/behaviors/particle-emitter/presets/water/mist.ts
|
|
1704
|
-
var waterMistPreset = defineSemanticParticlePreset({
|
|
1705
|
-
family: "water",
|
|
1706
|
-
variant: "mist",
|
|
1707
|
-
description: "diffuse suspended moisture",
|
|
1708
|
-
axes: {
|
|
1709
|
-
pressure: "low",
|
|
1710
|
-
"surface tension feel": "soft",
|
|
1711
|
-
aeration: "low",
|
|
1712
|
-
coherence: "diffuse",
|
|
1713
|
-
"gravitational obedience": "low"
|
|
1714
|
-
},
|
|
1715
|
-
system: {
|
|
1716
|
-
defaults: {
|
|
1717
|
-
duration: 3.2,
|
|
1718
|
-
looping: true,
|
|
1719
|
-
color: "#dbeafe",
|
|
1720
|
-
life: [2.4, 3.8],
|
|
1721
|
-
size: [0.4, 0.82],
|
|
1722
|
-
speed: [0.05, 0.2],
|
|
1723
|
-
rotation: [-Math.PI, Math.PI],
|
|
1724
|
-
opacity: 0.36
|
|
1725
|
-
},
|
|
1726
|
-
emission: { type: "rate", rate: 16 },
|
|
1727
|
-
shape: {
|
|
1728
|
-
type: "cone",
|
|
1729
|
-
radius: 0.32,
|
|
1730
|
-
thickness: 1,
|
|
1731
|
-
angle: 0.42,
|
|
1732
|
-
speed: [0.02, 0.08]
|
|
1733
|
-
},
|
|
1734
|
-
behaviors: {
|
|
1735
|
-
colorOverLife: {
|
|
1736
|
-
colors: [
|
|
1737
|
-
["#f8fafc", 0],
|
|
1738
|
-
["#dbeafe", 0.35],
|
|
1739
|
-
["#bfdbfe", 1]
|
|
1740
|
-
],
|
|
1741
|
-
alpha: [
|
|
1742
|
-
[0.08, 0],
|
|
1743
|
-
[0.44, 0.2],
|
|
1744
|
-
[0.18, 0.82],
|
|
1745
|
-
[0, 1]
|
|
1746
|
-
]
|
|
1747
|
-
},
|
|
1748
|
-
sizeOverLife: [0.38, 0.86, 1.42, 2.02],
|
|
1749
|
-
forceOverLife: {
|
|
1750
|
-
y: [0.02, 0.12]
|
|
1751
|
-
},
|
|
1752
|
-
noise: {
|
|
1753
|
-
frequency: [0.8, 1.8],
|
|
1754
|
-
power: [0.04, 0.1],
|
|
1755
|
-
positionAmount: [0.1, 0.18],
|
|
1756
|
-
rotationAmount: [0.08, 0.14]
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
}
|
|
1760
|
-
});
|
|
1761
|
-
function mist(options = {}) {
|
|
1762
|
-
return createSemanticParticleEffect(waterMistPreset, options);
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
// src/lib/behaviors/particle-emitter/presets/water/splash.ts
|
|
1766
|
-
import { RenderMode as RenderMode10 } from "three.quarks";
|
|
1767
|
-
var waterSplashPreset = defineSemanticParticlePreset({
|
|
1768
|
-
family: "water",
|
|
1769
|
-
variant: "splash",
|
|
1770
|
-
description: "sudden impact-driven burst",
|
|
1771
|
-
axes: {
|
|
1772
|
-
pressure: "impact-driven",
|
|
1773
|
-
"surface tension feel": "beaded",
|
|
1774
|
-
aeration: "medium",
|
|
1775
|
-
coherence: "shattering",
|
|
1776
|
-
"gravitational obedience": "high"
|
|
1777
|
-
},
|
|
1778
|
-
system: {
|
|
1779
|
-
defaults: {
|
|
1780
|
-
duration: 0.34,
|
|
1781
|
-
color: "#7dd3fc",
|
|
1782
|
-
life: [0.26, 0.55],
|
|
1783
|
-
size: [0.1, 0.22],
|
|
1784
|
-
speed: [1.4, 3.1],
|
|
1785
|
-
rotation: [-Math.PI, Math.PI],
|
|
1786
|
-
opacity: 0.82,
|
|
1787
|
-
renderMode: RenderMode10.StretchedBillBoard
|
|
1788
|
-
},
|
|
1789
|
-
emission: { type: "burst", count: 18 },
|
|
1790
|
-
shape: {
|
|
1791
|
-
type: "sphere",
|
|
1792
|
-
radius: 0.08,
|
|
1793
|
-
thickness: 0.96,
|
|
1794
|
-
speed: [0.7, 1.4]
|
|
1795
|
-
},
|
|
1796
|
-
behaviors: {
|
|
1797
|
-
colorOverLife: {
|
|
1798
|
-
colors: [
|
|
1799
|
-
["#ffffff", 0],
|
|
1800
|
-
["#bae6fd", 0.4],
|
|
1801
|
-
["#38bdf8", 1]
|
|
1802
|
-
],
|
|
1803
|
-
alpha: [
|
|
1804
|
-
[0.18, 0],
|
|
1805
|
-
[0.88, 0.08],
|
|
1806
|
-
[0.42, 0.54],
|
|
1807
|
-
[0, 1]
|
|
1808
|
-
]
|
|
1809
|
-
},
|
|
1810
|
-
sizeOverLife: [0.32, 0.86, 0.92, 0.08],
|
|
1811
|
-
speedOverLife: [1.12, 0.88, 0.46, 0.08],
|
|
1812
|
-
forceOverLife: {
|
|
1813
|
-
y: [-4.4, -2.6]
|
|
1814
|
-
}
|
|
1815
|
-
},
|
|
1816
|
-
rendererEmitterSettings: {
|
|
1817
|
-
speedFactor: 0.36,
|
|
1818
|
-
lengthFactor: 0.88
|
|
1819
|
-
}
|
|
1820
|
-
}
|
|
1821
|
-
});
|
|
1822
|
-
function splash(options = {}) {
|
|
1823
|
-
return createSemanticParticleEffect(waterSplashPreset, options);
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
// src/lib/behaviors/particle-emitter/presets/water/spray.ts
|
|
1827
|
-
import { RenderMode as RenderMode11 } from "three.quarks";
|
|
1828
|
-
var waterSprayPreset = defineSemanticParticlePreset({
|
|
1829
|
-
family: "water",
|
|
1830
|
-
variant: "spray",
|
|
1831
|
-
description: "fine ejected droplets",
|
|
1832
|
-
axes: {
|
|
1833
|
-
pressure: "medium-high",
|
|
1834
|
-
"surface tension feel": "light",
|
|
1835
|
-
aeration: "medium",
|
|
1836
|
-
coherence: "broken",
|
|
1837
|
-
"gravitational obedience": "high"
|
|
1838
|
-
},
|
|
1839
|
-
system: {
|
|
1840
|
-
defaults: {
|
|
1841
|
-
duration: 1,
|
|
1842
|
-
looping: true,
|
|
1843
|
-
color: "#93c5fd",
|
|
1844
|
-
life: [0.45, 0.9],
|
|
1845
|
-
size: [0.08, 0.16],
|
|
1846
|
-
speed: [1.1, 2.3],
|
|
1847
|
-
rotation: [-Math.PI, Math.PI],
|
|
1848
|
-
opacity: 0.72,
|
|
1849
|
-
renderMode: RenderMode11.StretchedBillBoard
|
|
1850
|
-
},
|
|
1851
|
-
emission: { type: "rate", rate: 38 },
|
|
1852
|
-
shape: {
|
|
1853
|
-
type: "cone",
|
|
1854
|
-
radius: 0.12,
|
|
1855
|
-
thickness: 1,
|
|
1856
|
-
angle: 0.24,
|
|
1857
|
-
speed: [0.85, 1.8]
|
|
1858
|
-
},
|
|
1859
|
-
behaviors: {
|
|
1860
|
-
colorOverLife: {
|
|
1861
|
-
colors: [
|
|
1862
|
-
["#eff6ff", 0],
|
|
1863
|
-
["#93c5fd", 0.45],
|
|
1864
|
-
["#60a5fa", 1]
|
|
1865
|
-
],
|
|
1866
|
-
alpha: [
|
|
1867
|
-
[0.16, 0],
|
|
1868
|
-
[0.82, 0.08],
|
|
1869
|
-
[0.52, 0.58],
|
|
1870
|
-
[0, 1]
|
|
1871
|
-
]
|
|
1872
|
-
},
|
|
1873
|
-
sizeOverLife: [0.72, 0.96, 0.82, 0.28],
|
|
1874
|
-
speedOverLife: [1.04, 0.92, 0.68, 0.38],
|
|
1875
|
-
forceOverLife: {
|
|
1876
|
-
y: [-5.8, -3.8]
|
|
1877
|
-
},
|
|
1878
|
-
noise: {
|
|
1879
|
-
frequency: [1.2, 2.2],
|
|
1880
|
-
power: [0.04, 0.08],
|
|
1881
|
-
positionAmount: [0.08, 0.16],
|
|
1882
|
-
rotationAmount: [0.04, 0.08]
|
|
1883
|
-
}
|
|
1884
|
-
},
|
|
1885
|
-
rendererEmitterSettings: {
|
|
1886
|
-
speedFactor: 0.5,
|
|
1887
|
-
lengthFactor: 0.95
|
|
1888
|
-
}
|
|
1889
|
-
}
|
|
1890
|
-
});
|
|
1891
|
-
function spray(options = {}) {
|
|
1892
|
-
return createSemanticParticleEffect(waterSprayPreset, options);
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
// src/lib/behaviors/particle-emitter/presets/water/torrent.ts
|
|
1896
|
-
import { RenderMode as RenderMode12 } from "three.quarks";
|
|
1897
|
-
var waterTorrentPreset = defineSemanticParticlePreset({
|
|
1898
|
-
family: "water",
|
|
1899
|
-
variant: "torrent",
|
|
1900
|
-
description: "strong, forceful, dense flow",
|
|
1901
|
-
axes: {
|
|
1902
|
-
pressure: "high",
|
|
1903
|
-
"surface tension feel": "driven",
|
|
1904
|
-
aeration: "medium",
|
|
1905
|
-
coherence: "strong",
|
|
1906
|
-
"gravitational obedience": "high"
|
|
1907
|
-
},
|
|
1908
|
-
system: {
|
|
1909
|
-
defaults: {
|
|
1910
|
-
duration: 1,
|
|
1911
|
-
looping: true,
|
|
1912
|
-
color: "#38bdf8",
|
|
1913
|
-
life: [0.35, 0.75],
|
|
1914
|
-
size: [0.1, 0.22],
|
|
1915
|
-
speed: [2.6, 4.9],
|
|
1916
|
-
rotation: [-0.3, 0.3],
|
|
1917
|
-
opacity: 0.84,
|
|
1918
|
-
renderMode: RenderMode12.StretchedBillBoard
|
|
1919
|
-
},
|
|
1920
|
-
emission: { type: "rate", rate: 60 },
|
|
1921
|
-
shape: {
|
|
1922
|
-
type: "cone",
|
|
1923
|
-
radius: 0.18,
|
|
1924
|
-
thickness: 1,
|
|
1925
|
-
angle: 0.12,
|
|
1926
|
-
speed: [1.8, 3.1]
|
|
1927
|
-
},
|
|
1928
|
-
behaviors: {
|
|
1929
|
-
colorOverLife: {
|
|
1930
|
-
colors: [
|
|
1931
|
-
["#f0f9ff", 0],
|
|
1932
|
-
["#7dd3fc", 0.35],
|
|
1933
|
-
["#0ea5e9", 1]
|
|
1934
|
-
],
|
|
1935
|
-
alpha: [
|
|
1936
|
-
[0.18, 0],
|
|
1937
|
-
[0.92, 0.08],
|
|
1938
|
-
[0.56, 0.52],
|
|
1939
|
-
[0, 1]
|
|
1940
|
-
]
|
|
1941
|
-
},
|
|
1942
|
-
sizeOverLife: [0.72, 0.94, 0.84, 0.28],
|
|
1943
|
-
speedOverLife: [1.04, 0.92, 0.68, 0.34],
|
|
1944
|
-
forceOverLife: {
|
|
1945
|
-
y: [-6.8, -4.8]
|
|
1946
|
-
},
|
|
1947
|
-
noise: {
|
|
1948
|
-
frequency: [1.4, 2.6],
|
|
1949
|
-
power: [0.04, 0.09],
|
|
1950
|
-
positionAmount: [0.08, 0.14],
|
|
1951
|
-
rotationAmount: [0.06, 0.1]
|
|
1952
|
-
}
|
|
1953
|
-
},
|
|
1954
|
-
rendererEmitterSettings: {
|
|
1955
|
-
speedFactor: 0.56,
|
|
1956
|
-
lengthFactor: 1.08
|
|
1957
|
-
}
|
|
1958
|
-
}
|
|
1959
|
-
});
|
|
1960
|
-
function torrent(options = {}) {
|
|
1961
|
-
return createSemanticParticleEffect(waterTorrentPreset, options);
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
// src/lib/behaviors/particle-emitter/presets/water/index.ts
|
|
1965
|
-
var waterPresets = {
|
|
1966
|
-
mist,
|
|
1967
|
-
spray,
|
|
1968
|
-
splash,
|
|
1969
|
-
drizzle,
|
|
1970
|
-
torrent
|
|
1971
|
-
};
|
|
1972
|
-
|
|
1973
|
-
export {
|
|
1974
|
-
particleEffect,
|
|
1975
|
-
createRangeValue,
|
|
1976
|
-
toColorVector,
|
|
1977
|
-
createParticleMaterial,
|
|
1978
|
-
createTextureSystemOptions,
|
|
1979
|
-
electricityPresets,
|
|
1980
|
-
firePresets,
|
|
1981
|
-
gasPresets,
|
|
1982
|
-
magicPresets,
|
|
1983
|
-
waterPresets
|
|
1984
|
-
};
|
|
1985
|
-
//# sourceMappingURL=chunk-GYURWCIQ.js.map
|