@newkrok/three-particles 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Istvan Krisztian Somoracz
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Istvan Krisztian Somoracz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,42 +1,63 @@
1
- # THREE Particles
2
- [![Run Tests](https://github.com/NewKrok/three-particles/actions/workflows/test.yml/badge.svg)](https://github.com/NewKrok/three-particles/actions/workflows/test.yml)
3
- [![NPM Version](https://img.shields.io/npm/v/@newkrok/three-particles.svg)](https://www.npmjs.com/package/@newkrok/three-particles)
4
- [![NPM Downloads](https://img.shields.io/npm/dw/@newkrok/three-particles.svg)](https://www.npmjs.com/package/@newkrok/three-particles)
5
- [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@newkrok/three-particles)](https://bundlephobia.com/package/@newkrok/three-particles)
6
-
7
- Particle system for ThreeJS.
8
-
9
- # THREE Particles Editor
10
-
11
- You can create your own particle effects with its editor: [https://github.com/NewKrok/three-particles-editor](https://github.com/NewKrok/three-particles-editor)
12
-
13
- # Video
14
-
15
- - Projectiles: [https://youtu.be/Q352JuxON04](https://youtu.be/Q352JuxON04)
16
- - First preview: [https://youtu.be/dtN_bndvoGU](https://youtu.be/dtN_bndvoGU)
17
-
18
- # Live Demo
19
-
20
- [https://newkrok.com/three-particles-editor/index.html](https://newkrok.com/three-particles-editor/index.html)
21
-
22
- # Documentation
23
-
24
- Automatically generated TypeDoc: [https://newkrok.github.io/three-particles/](https://newkrok.github.io/three-particles/)
25
-
26
- # Install
27
-
28
- NPM package: [https://www.npmjs.com/package/@newkrok/three-particles](https://www.npmjs.com/package/@newkrok/three-particles)
29
-
30
- Install with npm:
31
- ```bash
32
- npm i @newkrok/three-particles
33
- ```
34
-
35
- Add as a `package.json` dependency:
36
- ```json
37
- "dependencies": {
38
- ...
39
- "@newkrok/three-particles": "2.0.0"
40
- ...
41
- }
42
- ```
1
+ # THREE Particles
2
+ [![Run Tests](https://github.com/NewKrok/three-particles/actions/workflows/test.yml/badge.svg)](https://github.com/NewKrok/three-particles/actions/workflows/test.yml)
3
+ [![NPM Version](https://img.shields.io/npm/v/@newkrok/three-particles.svg)](https://www.npmjs.com/package/@newkrok/three-particles)
4
+ [![NPM Downloads](https://img.shields.io/npm/dw/@newkrok/three-particles.svg)](https://www.npmjs.com/package/@newkrok/three-particles)
5
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@newkrok/three-particles)](https://bundlephobia.com/package/@newkrok/three-particles)
6
+
7
+ Particle system for ThreeJS.
8
+
9
+ # Features
10
+
11
+ * Easy integration with Three.js.
12
+ * Visual editor for creating and fine-tuning effects: [THREE Particles Editor](https://github.com/NewKrok/three-particles-editor)
13
+ * Highly customizable particle properties (position, velocity, size, color, alpha, rotation, etc.).
14
+ * Support for various emitter shapes and parameters.
15
+ * TypeDoc API documentation available.
16
+
17
+ # Live Demo & Examples
18
+
19
+ * **Editor & Live Demo:** [https://newkrok.com/three-particles-editor/index.html](https://newkrok.com/three-particles-editor/index.html)
20
+ * **CodePen Basic Example:** [https://codepen.io/NewKrok/pen/GgRzEmP](https://codepen.io/NewKrok/pen/GgRzEmP)
21
+ * **Video - Projectiles:** [https://youtu.be/Q352JuxON04](https://youtu.be/Q352JuxON04)
22
+ * **Video - First Preview:** [https://youtu.be/dtN_bndvoGU](https://youtu.be/dtN_bndvoGU)
23
+
24
+ # Installation
25
+
26
+ ## NPM
27
+
28
+ ```bash
29
+ npm install @newkrok/three-particles
30
+ ```
31
+
32
+ ## CDN (Browser)
33
+
34
+ Include the script directly in your HTML:
35
+
36
+ ```html
37
+ <!-- Please verify this path points to the correct UMD/IIFE bundle -->
38
+ <script src="https://cdn.jsdelivr.net/npm/@newkrok/three-particles@latest/dist/three-particles.min.js"></script>
39
+ <!-- or -->
40
+ <script src="https://unpkg.com/@newkrok/three-particles@latest/dist/three-particles.min.js"></script>
41
+ ```
42
+
43
+ # Usage
44
+
45
+ Here's a basic example of how to load and use a particle system:
46
+
47
+ ```javascript
48
+ // Create a particle system
49
+ const effect = {
50
+ // Your effect configuration here
51
+ // It can be empty to use default settings
52
+ };
53
+ const { instance } = createParticleSystem(effect);
54
+ scene.add(instance);
55
+
56
+ // Update the particle system in your animation loop
57
+ // Pass the current time, delta time, and elapsed time
58
+ updateParticleSystems({now, delta, elapsed});
59
+ ```
60
+
61
+ # Documentation
62
+
63
+ Automatically generated TypeDoc: [https://newkrok.github.io/three-particles/](https://newkrok.github.io/three-particles/)
@@ -1 +1 @@
1
- [{"label":"three-particles.min.js","isAsset":true,"statSize":83241,"groups":[{"label":"dist/js/effects/three-particles","path":"./dist/js/effects/three-particles","statSize":70922,"groups":[{"id":684,"label":"index.js + 14 modules (concatenated)","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)","statSize":70922,"parsedSize":0,"gzipSize":0,"concatenated":true,"groups":[{"label":"dist/js/effects/three-particles","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles","statSize":51216,"groups":[{"id":null,"label":"index.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/index.js","statSize":264,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles-bezier.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-bezier.js","statSize":2350,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles-curves.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-curves.js","statSize":2628,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles-modifiers.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-modifiers.js","statSize":4748,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles-utils.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-utils.js","statSize":7394,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles.js","statSize":31035,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"shaders","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/shaders","statSize":2797,"groups":[{"id":null,"label":"particle-system-fragment-shader.glsl.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/shaders/particle-system-fragment-shader.glsl.js","statSize":1939,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"particle-system-vertex-shader.glsl.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/shaders/particle-system-vertex-shader.glsl.js","statSize":858,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"node_modules","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules","statSize":19664,"groups":[{"label":"@newkrok/three-utils/src/js/newkrok/three-utils","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils","statSize":5203,"groups":[{"id":null,"label":"index.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/index.js","statSize":349,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"callback-utils.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/callback-utils.js","statSize":1350,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"object-utils.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/object-utils.js","statSize":2458,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"time-utils.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/time-utils.js","statSize":1046,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"three/examples/jsm/misc","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/three/examples/jsm/misc","statSize":1540,"groups":[{"id":null,"label":"Gyroscope.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/three/examples/jsm/misc/Gyroscope.js","statSize":1540,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"three-noise/build","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/three-noise/build","statSize":12921,"groups":[{"id":null,"label":"three-noise.module.js","path":"./dist/js/effects/three-particles/index.js + 14 modules (concatenated)/node_modules/three-noise/build/three-noise.module.js","statSize":12921,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}]}],"parsedSize":0,"gzipSize":0},{"label":"node_modules/easing-functions","path":"./node_modules/easing-functions","statSize":12319,"groups":[{"id":300,"label":"index.js","path":"./node_modules/easing-functions/index.js","statSize":12319}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}]
1
+ [{"label":"three-particles.min.js","isAsset":true,"statSize":82300,"groups":[{"label":"dist","path":"./dist","statSize":72435,"groups":[{"id":69,"label":"index.js + 14 modules (concatenated)","path":"./dist/index.js + 14 modules (concatenated)","statSize":72435,"parsedSize":0,"gzipSize":0,"concatenated":true,"groups":[{"label":"dist","path":"./dist/index.js + 14 modules (concatenated)/dist","statSize":52729,"groups":[{"id":null,"label":"index.js","path":"./dist/index.js + 14 modules (concatenated)/dist/index.js","statSize":426,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"js/effects/three-particles","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles","statSize":52303,"groups":[{"id":null,"label":"three-particles-bezier.js","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-bezier.js","statSize":2350,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles-curves.js","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-curves.js","statSize":2628,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles-modifiers.js","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-modifiers.js","statSize":4748,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles-utils.js","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles-utils.js","statSize":8634,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"three-particles.js","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/three-particles.js","statSize":31146,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"shaders","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/shaders","statSize":2797,"groups":[{"id":null,"label":"particle-system-fragment-shader.glsl.js","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/shaders/particle-system-fragment-shader.glsl.js","statSize":1939,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"particle-system-vertex-shader.glsl.js","path":"./dist/index.js + 14 modules (concatenated)/dist/js/effects/three-particles/shaders/particle-system-vertex-shader.glsl.js","statSize":858,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"node_modules","path":"./dist/index.js + 14 modules (concatenated)/node_modules","statSize":19664,"groups":[{"label":"@newkrok/three-utils/src/js/newkrok/three-utils","path":"./dist/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils","statSize":5203,"groups":[{"id":null,"label":"index.js","path":"./dist/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/index.js","statSize":349,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"callback-utils.js","path":"./dist/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/callback-utils.js","statSize":1350,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"object-utils.js","path":"./dist/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/object-utils.js","statSize":2458,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"id":null,"label":"time-utils.js","path":"./dist/index.js + 14 modules (concatenated)/node_modules/@newkrok/three-utils/src/js/newkrok/three-utils/time-utils.js","statSize":1046,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"three/examples/jsm/misc","path":"./dist/index.js + 14 modules (concatenated)/node_modules/three/examples/jsm/misc","statSize":1540,"groups":[{"id":null,"label":"Gyroscope.js","path":"./dist/index.js + 14 modules (concatenated)/node_modules/three/examples/jsm/misc/Gyroscope.js","statSize":1540,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true},{"label":"three-noise/build","path":"./dist/index.js + 14 modules (concatenated)/node_modules/three-noise/build","statSize":12921,"groups":[{"id":null,"label":"three-noise.module.js","path":"./dist/index.js + 14 modules (concatenated)/node_modules/three-noise/build/three-noise.module.js","statSize":12921,"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}],"parsedSize":0,"gzipSize":0,"inaccurateSizes":true}]}],"parsedSize":0,"gzipSize":0},{"label":"node_modules/easing-functions","path":"./node_modules/easing-functions","statSize":9865,"groups":[{"id":300,"label":"index.js","path":"./node_modules/easing-functions/index.js","statSize":9865}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}]
@@ -1 +1 @@
1
- {"version":3,"file":"three-particles-bezier.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-bezier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAcxD,eAAO,MAAM,yBAAyB,qBAClB,MAAM,gBACV,KAAK,CAAC,WAAW,CAAC,kBAgDjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,qBAAsB,MAAM,SAYjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,cAAqB,CAAC"}
1
+ {"version":3,"file":"three-particles-bezier.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-bezier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAcxD,eAAO,MAAM,yBAAyB,GACpC,kBAAkB,MAAM,EACxB,cAAc,KAAK,CAAC,WAAW,CAAC,kBAgDjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,kBAAkB,MAAM,SAYjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,cAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"three-particles-curves.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-curves.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,0BAAkB,eAAe;IAC/B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;IACrC,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,iBAAiB,sBAAsB;IACvC,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,aAAa,kBAAkB;CAChC;AAoCD,eAAO,MAAM,gBAAgB,oBACV,eAAe,GAAG,aAAa,KAC/C,aAGuC,CAAC"}
1
+ {"version":3,"file":"three-particles-curves.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-curves.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,0BAAkB,eAAe;IAC/B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;IACrC,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,iBAAiB,sBAAsB;IACvC,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,aAAa,kBAAkB;CAChC;AAoCD,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,eAAe,GAAG,aAAa,KAC/C,aAGuC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"three-particles-modifiers.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAKzE,eAAO,MAAM,cAAc,qGAOxB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,8BAA8B,CAAC;IACjD,UAAU,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACzC,0BAA0B,EAAE,MAAM,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB,SA8IA,CAAC"}
1
+ {"version":3,"file":"three-particles-modifiers.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAKzE,eAAO,MAAM,cAAc,GAAI,kGAO5B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,8BAA8B,CAAC;IACjD,UAAU,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACzC,0BAA0B,EAAE,MAAM,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB,SA8IA,CAAC"}
@@ -25,6 +25,11 @@ export declare const calculateRandomPositionAndVelocityOnRectangle: (position: T
25
25
  rotation: Point3D;
26
26
  scale: Point3D;
27
27
  }) => void;
28
+ /**
29
+ * Creates a default white circle texture using CanvasTexture.
30
+ * @returns {THREE.CanvasTexture | null} The generated texture or null if context fails.
31
+ */
32
+ export declare const createDefaultParticleTexture: () => THREE.CanvasTexture | null;
28
33
  export declare const isLifeTimeCurve: (value: Constant | RandomBetweenTwoConstants | LifetimeCurve) => value is LifetimeCurve;
29
34
  export declare const getCurveFunctionFromConfig: (particleSystemId: number, lifeTimeCurve: LifetimeCurve) => import("./types.js").CurveFunction;
30
35
  export declare const calculateValue: (particleSystemId: number, value: Constant | RandomBetweenTwoConstants | LifetimeCurve, time?: number) => number;
@@ -1 +1 @@
1
- {"version":3,"file":"three-particles-utils.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAiB,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,0CAA0C,aAC3C,KAAK,CAAC,OAAO,cACX,KAAK,CAAC,UAAU,YAClB,KAAK,CAAC,OAAO,SAChB,MAAM,qCAKV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,SAiC5D,CAAC;AAEF,eAAO,MAAM,wCAAwC,aACzC,KAAK,CAAC,OAAO,cACX,KAAK,CAAC,UAAU,YAClB,KAAK,CAAC,OAAO,SAChB,MAAM,4CAMV;IACD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,SAgCF,CAAC;AAEF,eAAO,MAAM,uCAAuC,aACxC,KAAK,CAAC,OAAO,cACX,KAAK,CAAC,UAAU,YAClB,KAAK,CAAC,OAAO,SAChB,MAAM,uBACQ;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,SA0C5D,CAAC;AAEF,eAAO,MAAM,0CAA0C,aAC3C,KAAK,CAAC,OAAO,cACX,KAAK,CAAC,UAAU,YAClB,KAAK,CAAC,OAAO,SAChB,MAAM,qCAKV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,SA2B5D,CAAC;AAEF,eAAO,MAAM,6CAA6C,aAC9C,KAAK,CAAC,OAAO,cACX,KAAK,CAAC,UAAU,YAClB,KAAK,CAAC,OAAO,SAChB,MAAM,uBACQ;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,SAiB3D,CAAC;AAEF,eAAO,MAAM,eAAe,UACnB,QAAQ,GAAG,yBAAyB,GAAG,aAAa,KAC1D,KAAK,IAAI,aAEX,CAAC;AAEF,eAAO,MAAM,0BAA0B,qBACnB,MAAM,iBACT,aAAa,uCAc7B,CAAC;AAEF,eAAO,MAAM,cAAc,qBACP,MAAM,SACjB,QAAQ,GAAG,yBAAyB,GAAG,aAAa,SACrD,MAAM,KACX,MAiBF,CAAC"}
1
+ {"version":3,"file":"three-particles-utils.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAiB,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,0CAA0C,GACrD,UAAU,KAAK,CAAC,OAAO,EACvB,YAAY,KAAK,CAAC,UAAU,EAC5B,UAAU,KAAK,CAAC,OAAO,EACvB,OAAO,MAAM,EACb,mCAIG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,SAiC5D,CAAC;AAEF,eAAO,MAAM,wCAAwC,GACnD,UAAU,KAAK,CAAC,OAAO,EACvB,YAAY,KAAK,CAAC,UAAU,EAC5B,UAAU,KAAK,CAAC,OAAO,EACvB,OAAO,MAAM,EACb,0CAKG;IACD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,SAgCF,CAAC;AAEF,eAAO,MAAM,uCAAuC,GAClD,UAAU,KAAK,CAAC,OAAO,EACvB,YAAY,KAAK,CAAC,UAAU,EAC5B,UAAU,KAAK,CAAC,OAAO,EACvB,OAAO,MAAM,EACb,qBAAqB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,SA0C5D,CAAC;AAEF,eAAO,MAAM,0CAA0C,GACrD,UAAU,KAAK,CAAC,OAAO,EACvB,YAAY,KAAK,CAAC,UAAU,EAC5B,UAAU,KAAK,CAAC,OAAO,EACvB,OAAO,MAAM,EACb,mCAIG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,SA2B5D,CAAC;AAEF,eAAO,MAAM,6CAA6C,GACxD,UAAU,KAAK,CAAC,OAAO,EACvB,YAAY,KAAK,CAAC,UAAU,EAC5B,UAAU,KAAK,CAAC,OAAO,EACvB,OAAO,MAAM,EACb,qBAAqB;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,SAiB3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAO,KAAK,CAAC,aAAa,GAAG,IA8BrE,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,QAAQ,GAAG,yBAAyB,GAAG,aAAa,KAC1D,KAAK,IAAI,aAEX,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,kBAAkB,MAAM,EACxB,eAAe,aAAa,uCAc7B,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,kBAAkB,MAAM,EACxB,OAAO,QAAQ,GAAG,yBAAyB,GAAG,aAAa,EAC3D,OAAM,MAAU,KACf,MAiBF,CAAC"}
@@ -117,6 +117,40 @@ export const calculateRandomPositionAndVelocityOnRectangle = (position, quaterni
117
117
  velocity.set(0, 0, speed);
118
118
  velocity.applyQuaternion(quaternion);
119
119
  };
120
+ /**
121
+ * Creates a default white circle texture using CanvasTexture.
122
+ * @returns {THREE.CanvasTexture | null} The generated texture or null if context fails.
123
+ */
124
+ export const createDefaultParticleTexture = () => {
125
+ try {
126
+ const canvas = document.createElement('canvas');
127
+ const size = 64;
128
+ canvas.width = size;
129
+ canvas.height = size;
130
+ const context = canvas.getContext('2d');
131
+ if (context) {
132
+ const centerX = size / 2;
133
+ const centerY = size / 2;
134
+ const radius = size / 2 - 2; // Small padding
135
+ context.beginPath();
136
+ context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
137
+ context.fillStyle = 'white';
138
+ context.fill();
139
+ const texture = new THREE.CanvasTexture(canvas);
140
+ texture.needsUpdate = true;
141
+ return texture;
142
+ }
143
+ else {
144
+ console.warn('Could not get 2D context to generate default particle texture.');
145
+ return null;
146
+ }
147
+ }
148
+ catch (error) {
149
+ // Handle potential errors (e.g., document not available in non-browser env)
150
+ console.warn('Error creating default particle texture:', error);
151
+ return null;
152
+ }
153
+ };
120
154
  export const isLifeTimeCurve = (value) => {
121
155
  return typeof value !== 'number' && 'type' in value;
122
156
  };
@@ -1 +1 @@
1
- {"version":3,"file":"three-particles.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,SAAS,EAIT,cAAc,EACd,oBAAoB,EAKrB,MAAM,YAAY,CAAC;AAEpB,cAAc,YAAY,CAAC;AAK3B,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF,eAAO,MAAM,8BAA8B,WACiB,CAAC;AAwP7D,eAAO,MAAM,oBAAoB,YACvB,oBAAoB,gBACd,MAAM,KACnB,cAkjBF,CAAC;AAEF,eAAO,MAAM,qBAAqB,4BAA6B,SAAS,SAmPvE,CAAC"}
1
+ {"version":3,"file":"three-particles.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles.ts"],"names":[],"mappings":"AA2BA,OAAO,EAEL,SAAS,EAIT,cAAc,EACd,oBAAoB,EAKrB,MAAM,YAAY,CAAC;AAEpB,cAAc,YAAY,CAAC;AAK3B,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF,eAAO,MAAM,8BAA8B,WACiB,CAAC;AAwP7D,eAAO,MAAM,oBAAoB,GAC/B,SAAQ,oBAAqD,EAC7D,cAAc,MAAM,KACnB,cAojBF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,yBAAyB,SAAS,SAmPvE,CAAC"}
@@ -6,7 +6,7 @@ import ParticleSystemFragmentShader from './shaders/particle-system-fragment-sha
6
6
  import ParticleSystemVertexShader from './shaders/particle-system-vertex-shader.glsl.js';
7
7
  import { removeBezierCurveFunction } from './three-particles-bezier.js';
8
8
  import { applyModifiers } from './three-particles-modifiers.js';
9
- import { calculateRandomPositionAndVelocityOnBox, calculateRandomPositionAndVelocityOnCircle, calculateRandomPositionAndVelocityOnCone, calculateRandomPositionAndVelocityOnRectangle, calculateRandomPositionAndVelocityOnSphere, calculateValue, getCurveFunctionFromConfig, isLifeTimeCurve, } from './three-particles-utils.js';
9
+ import { calculateRandomPositionAndVelocityOnBox, calculateRandomPositionAndVelocityOnCircle, calculateRandomPositionAndVelocityOnCone, calculateRandomPositionAndVelocityOnRectangle, calculateRandomPositionAndVelocityOnSphere, calculateValue, getCurveFunctionFromConfig, isLifeTimeCurve, createDefaultParticleTexture, } from './three-particles-utils.js';
10
10
  export * from './types.js';
11
11
  let _particleSystemId = 0;
12
12
  let createdParticleSystems = [];
@@ -214,7 +214,8 @@ export const createParticleSystem = (config = DEFAULT_PARTICLE_SYSTEM_CONFIG, ex
214
214
  isEnabled: true,
215
215
  };
216
216
  const normalizedConfig = ObjectUtils.patchObject(DEFAULT_PARTICLE_SYSTEM_CONFIG, config);
217
- const { transform, duration, looping, startDelay, startLifetime, startSpeed, startSize, startRotation, startColor, startOpacity, gravity, simulationSpace, maxParticles, emission, shape, map, renderer, noise, velocityOverLifetime, onUpdate, onComplete, textureSheetAnimation, } = normalizedConfig;
217
+ let particleMap = normalizedConfig.map || createDefaultParticleTexture();
218
+ const { transform, duration, looping, startDelay, startLifetime, startSpeed, startSize, startRotation, startColor, startOpacity, gravity, simulationSpace, maxParticles, emission, shape, renderer, noise, velocityOverLifetime, onUpdate, onComplete, textureSheetAnimation, } = normalizedConfig;
218
219
  if (typeof renderer?.blending === 'string')
219
220
  renderer.blending = blendingMap[renderer.blending];
220
221
  const startPositions = Array.from({ length: maxParticles }, () => new THREE.Vector3());
@@ -301,7 +302,7 @@ export const createParticleSystem = (config = DEFAULT_PARTICLE_SYSTEM_CONFIG, ex
301
302
  value: 0.0,
302
303
  },
303
304
  map: {
304
- value: map,
305
+ value: particleMap,
305
306
  },
306
307
  tiles: {
307
308
  value: textureSheetAnimation.tiles,
@@ -1 +1 @@
1
- import*as t from"THREE";var e={300:t=>{var e=t.exports={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},Out:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},InOut:function(t){var e,r=.1,i=.4;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=i*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-e.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*e.Bounce.In(2*t):.5*e.Bounce.Out(2*t-1)+.5}}}}},r={};function i(t){var n=r[t];if(void 0!==n)return n.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,i),a.exports}i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};i.d(n,{pB:()=>z,U_:()=>N,rU:()=>v,M4:()=>h,$H:()=>f,hp:()=>g,l$:()=>y,Y$:()=>b,Tt:()=>s,eL:()=>k,Hc:()=>l,Ao:()=>m,iy:()=>I,Px:()=>F,rJ:()=>x,Pj:()=>c,YR:()=>W});const a=[],o=(t,e)=>{let r=1;for(let i=1;i<=e;i++)r*=(t+1-i)/i;return r},s=(t,e)=>{const r=a.find((t=>t.bezierPoints===e));if(r)return r.referencedBy.includes(t)||r.referencedBy.push(t),r.curveFunction;const i={referencedBy:[t],bezierPoints:e,curveFunction:t=>{if(t<0)return e[0].y;if(t>1)return e[e.length-1].y;let r=0,i=e.length-1;e.find(((e,n)=>{const a=t<(e.percentage??0);return a?i=n:void 0!==e.percentage&&(r=n),a}));const n=i-r,a=(t-(e[r].percentage??0))/((e[i].percentage??1)-(e[r].percentage??0));let s=0;for(let t=0;t<=n;t++){const i=e[r+t];s+=o(n,t)*Math.pow(1-a,n-t)*Math.pow(a,t)*i.y}return s}};return a.push(i),i.curveFunction},c=t=>{for(;;){const e=a.findIndex((e=>e.referencedBy.includes(t)));if(-1===e)break;const r=a[e];r.referencedBy=r.referencedBy.filter((e=>e!==t)),0===r.referencedBy.length&&a.splice(e,1)}},l=()=>a.length;var u=i(300);const d={LINEAR:u.Linear.None,QUADRATIC_IN:u.Quadratic.In,QUADRATIC_OUT:u.Quadratic.Out,QUADRATIC_IN_OUT:u.Quadratic.InOut,CUBIC_IN:u.Cubic.In,CUBIC_OUT:u.Cubic.Out,CUBIC_IN_OUT:u.Cubic.InOut,QUARTIC_IN:u.Quartic.In,QUARTIC_OUT:u.Quartic.Out,QUARTIC_IN_OUT:u.Quartic.InOut,QUINTIC_IN:u.Quintic.In,QUINTIC_OUT:u.Quintic.Out,QUINTIC_IN_OUT:u.Quintic.InOut,SINUSOIDAL_IN:u.Sinusoidal.In,SINUSOIDAL_OUT:u.Sinusoidal.Out,SINUSOIDAL_IN_OUT:u.Sinusoidal.InOut,EXPONENTIAL_IN:u.Exponential.In,EXPONENTIAL_OUT:u.Exponential.Out,EXPONENTIAL_IN_OUT:u.Exponential.InOut,CIRCULAR_IN:u.Circular.In,CIRCULAR_OUT:u.Circular.Out,CIRCULAR_IN_OUT:u.Circular.InOut,ELASTIC_IN:u.Elastic.In,ELASTIC_OUT:u.Elastic.Out,ELASTIC_IN_OUT:u.Elastic.InOut,BACK_IN:u.Back.In,BACK_OUT:u.Back.Out,BACK_IN_OUT:u.Back.InOut,BOUNCE_IN:u.Bounce.In,BOUNCE_OUT:u.Bounce.Out,BOUNCE_IN_OUT:u.Bounce.InOut},m=t=>"function"==typeof t?t:d[t];const p=(t=>{var e={};return i.d(e,t),e})({AdditiveBlending:()=>t.AdditiveBlending,BufferAttribute:()=>t.BufferAttribute,BufferGeometry:()=>t.BufferGeometry,Euler:()=>t.Euler,MathUtils:()=>t.MathUtils,MultiplyBlending:()=>t.MultiplyBlending,NoBlending:()=>t.NoBlending,NormalBlending:()=>t.NormalBlending,Object3D:()=>t.Object3D,Points:()=>t.Points,Quaternion:()=>t.Quaternion,ShaderMaterial:()=>t.ShaderMaterial,SubtractiveBlending:()=>t.SubtractiveBlending,Vector2:()=>t.Vector2,Vector3:()=>t.Vector3}),y=(t,e,r,i,{radius:n,radiusThickness:a,arc:o})=>{const s=Math.random()*(o/360),c=Math.random(),l=Math.random(),u=2*Math.PI*s,d=Math.acos(2*c-1),m=Math.sin(d),p=m*Math.cos(u),y=m*Math.sin(u),f=Math.cos(d),v=1-a;t.x=n*v*p+n*a*l*p,t.y=n*v*y+n*a*l*y,t.z=n*v*f+n*a*l*f,t.applyQuaternion(e);const h=1/t.length();r.set(t.x*h*i,t.y*h*i,t.z*h*i),r.applyQuaternion(e)},f=(t,e,r,i,{radius:n,radiusThickness:a,arc:o,angle:s=90})=>{const c=2*Math.PI*Math.random()*(o/360),l=Math.random(),u=Math.cos(c),d=Math.sin(c),m=1-a;t.x=n*m*u+n*a*l*u,t.y=n*m*d+n*a*l*d,t.z=0,t.applyQuaternion(e);const y=t.length(),f=Math.abs(y/n*p.MathUtils.degToRad(s)),v=Math.sin(f),h=1/y;r.set(t.x*v*h*i,t.y*v*h*i,Math.cos(f)*i),r.applyQuaternion(e)},v=(t,e,r,i,{scale:n,emitFrom:a})=>{const o=n;switch(a){case"VOLUME":t.x=Math.random()*o.x-o.x/2,t.y=Math.random()*o.y-o.y/2,t.z=Math.random()*o.z-o.z/2;break;case"SHELL":const e=Math.floor(6*Math.random()),r=e%3,i=[];i[r]=e>2?1:0,i[(r+1)%3]=Math.random(),i[(r+2)%3]=Math.random(),t.x=i[0]*o.x-o.x/2,t.y=i[1]*o.y-o.y/2,t.z=i[2]*o.z-o.z/2;break;case"EDGE":const n=Math.floor(6*Math.random()),a=n%3,s=Math.floor(4*Math.random()),c=[];c[a]=n>2?1:0,c[(a+1)%3]=s<2?Math.random():s-2,c[(a+2)%3]=s<2?s:Math.random(),t.x=c[0]*o.x-o.x/2,t.y=c[1]*o.y-o.y/2,t.z=c[2]*o.z-o.z/2}t.applyQuaternion(e),r.set(0,0,i),r.applyQuaternion(e)},h=(t,e,r,i,{radius:n,radiusThickness:a,arc:o})=>{const s=2*Math.PI*Math.random()*(o/360),c=Math.random(),l=Math.cos(s),u=Math.sin(s),d=1-a;t.x=n*d*l+n*a*c*l,t.y=n*d*u+n*a*c*u,t.z=0,t.applyQuaternion(e);const m=1/t.length();r.set(t.x*m*i,t.y*m*i,0),r.applyQuaternion(e)},g=(t,e,r,i,{rotation:n,scale:a})=>{const o=a,s=n,c=Math.random()*o.x-o.x/2,l=Math.random()*o.y-o.y/2,u=p.MathUtils.degToRad(s.x),d=p.MathUtils.degToRad(s.y);t.x=c*Math.cos(d),t.y=l*Math.cos(u),t.z=c*Math.sin(d)-l*Math.sin(u),t.applyQuaternion(e),r.set(0,0,i),r.applyQuaternion(e)},x=t=>"number"!=typeof t&&"type"in t,I=(t,e)=>{if("BEZIER"===e.type)return s(t,e.bezierPoints);if("EASING"===e.type)return e.curveFunction;throw new Error(`Unsupported value type: ${e}`)},b=(t,e,r=0)=>{if("number"==typeof e)return e;if("min"in e&&"max"in e)return e.min===e.max?e.min??0:p.MathUtils.randFloat(e.min??0,e.max??1);const i=e;return I(t,i)(r)*(i.scale??1)},M=new p.Vector3(0,0,0),O=new p.Euler,z=({delta:t,generalData:e,normalizedConfig:r,attributes:i,particleLifetimePercentage:n,particleIndex:a})=>{const{particleSystemId:o,startValues:s,lifetimeValues:c,linearVelocityData:l,orbitalVelocityData:u,noise:d}=e,m=3*a,p=i.position.array;if(l){const{speed:e,valueModifiers:r}=l[a],o=r.x?r.x(n):e.x,s=r.y?r.y(n):e.y,c=r.z?r.z(n):e.z;p[m]+=o*t,p[m+1]+=s*t,p[m+2]+=c*t,i.position.needsUpdate=!0}if(u){const{speed:e,positionOffset:r,valueModifiers:o}=u[a];p[m]-=r.x,p[m+1]-=r.y,p[m+2]-=r.z;const s=o.x?o.x(n):e.x,c=o.y?o.y(n):e.y,l=o.z?o.z(n):e.z;O.set(s*t,l*t,c*t),r.applyEuler(O),p[m]+=r.x,p[m+1]+=r.y,p[m+2]+=r.z,i.position.needsUpdate=!0}if(r.sizeOverLifetime.isActive){const t=b(o,r.sizeOverLifetime.lifetimeCurve,n);i.size.array[a]=s.startSize[a]*t,i.size.needsUpdate=!0}if(r.opacityOverLifetime.isActive){const t=b(o,r.opacityOverLifetime.lifetimeCurve,n);i.colorA.array[a]=s.startOpacity[a]*t,i.colorA.needsUpdate=!0}if(c.rotationOverLifetime&&(i.rotation.array[a]+=c.rotationOverLifetime[a]*t*.02,i.rotation.needsUpdate=!0),d.isActive){const{sampler:t,strength:e,offsets:r,positionAmount:o,rotationAmount:s,sizeAmount:c}=d;let l;const u=10*(n+(r?r[a]:0))*e,y=.15*e;M.set(u,0,0),l=t.get3(M),p[m]+=l*y*o,0!==s&&(i.rotation.array[a]+=l*y*s,i.rotation.needsUpdate=!0),0!==c&&(i.size.array[a]+=l*y*c,i.size.needsUpdate=!0),M.set(u,u,0),l=t.get3(M),p[m+1]+=l*y*o,M.set(u,u,u),l=t.get3(M),p[m+2]+=l*y*o,i.position.needsUpdate=!0}};const w=(t,e,r={skippedProperties:[],applyToFirstObject:!1})=>{const i={};return Object.keys(t).forEach((n=>{r.skippedProperties&&r.skippedProperties.includes(n)||("object"==typeof t[n]&&t[n]&&e[n]&&!Array.isArray(t[n])?i[n]=w(t[n],e[n],r):(i[n]=0===e[n]?0:!1!==e[n]&&(e[n]||t[n]),r.applyToFirstObject&&(t[n]=i[n])))})),i},P=new p.Vector3,A=new p.Quaternion,S=new p.Vector3,_=new p.Vector3,C=new p.Quaternion,L=new p.Vector3;class V extends p.Object3D{constructor(){super()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null!==this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(_,C,L),this.matrix.decompose(P,A,S),this.matrixWorld.compose(_,A,L)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e=0,r=this.children.length;e<r;e++)this.children[e].updateMatrixWorld(t)}}var T=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];class E{constructor(t){const e=[new p.Vector3(1,1,0),new p.Vector3(-1,1,0),new p.Vector3(1,-1,0),new p.Vector3(-1,-1,0),new p.Vector3(1,0,1),new p.Vector3(-1,0,1),new p.Vector3(1,0,-1),new p.Vector3(-1,0,-1),new p.Vector3(0,1,1),new p.Vector3(0,-1,1),new p.Vector3(0,1,-1),new p.Vector3(0,-1,-1)];var r=new Array(512),i=new Array(512);t||(t=1),t*=65536,(t=Math.floor(t))<256&&(t|=t<<8);for(var n=0;n<256;n++){var a;a=1&n?T[n]^255&t:T[n]^t>>8&255,r[n]=r[n+256]=a,i[n]=i[n+256]=e[a%12]}this._seed=t,this._offsetMatrix=[new p.Vector3(0,0,0),new p.Vector3(0,0,1),new p.Vector3(0,1,0),new p.Vector3(0,1,1),new p.Vector3(1,0,0),new p.Vector3(1,0,1),new p.Vector3(1,1,0),new p.Vector3(1,1,1)],this.shaderChunk={defines:"",header:'#define GLSLIFY 1\n// From https://github.com/hughsk/glsl-noise/blob/master/periodic/2d.glsl\n\n//\n// GLSL textureless classic 2D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-08-22\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\n\nvec4 permute(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }\n\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec2 fade(vec2 t) { return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); }\n\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\n// Classic Perlin noise, periodic variant\nfloat perlin(vec2 P) {\n\n vec2 rep = vec2(255.0, 255.0);\n\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0;\n vec4 gy = abs(gx) - 0.5;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x, gy.x);\n vec2 g10 = vec2(gx.y, gy.y);\n vec2 g01 = vec2(gx.z, gy.z);\n vec2 g11 = vec2(gx.w, gy.w);\n\n vec4 norm = taylorInvSqrt(\n vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return map(2.3 * n_xy, -1.0, 1.0, 0.0, 1.0);\n}\n\nfloat fbm(vec2 pos, vec4 props) {\n float persistance = props.x;\n float lacunarity = props.y;\n float redistribution = props.z;\n int octaves = int(props.w);\n\n float result = 0.0;\n float amplitude = 1.0;\n float frequency = 1.0;\n float maximum = amplitude;\n\n for (int i = 0; i < 2; i++) {\n\n vec2 p = pos.xy * frequency;\n\n float noiseVal = perlin(p);\n result += noiseVal * amplitude;\n\n frequency *= lacunarity;\n amplitude *= persistance;\n maximum += amplitude;\n }\n\n float redistributed = pow(result, redistribution);\n return redistributed / maximum;\n}\n',main:"",uniforms:[{three_noise_seed:this._seed}]},this.perm=r,this.gradP=i}_fade(t){return t*t*t*(t*(6*t-15)+10)}_lerp(t,e,r){return(1-r)*t+r*e}_gradient(t){return t instanceof p.Vector3?t.x+this.perm[t.y+this.perm[t.z]]:t.x+this.perm[t.y]}static map(t,e,r,i,n){return(t-e)*(n-i)/(r-e)+i}get2(t){void 0!==t.z&&(t=new p.Vector2(t.x,t.y));const e=new p.Vector2(Math.floor(t.x),Math.floor(t.y));t.sub(e),e.x&=255,e.y&=255;const r=[];for(let i=0;i<4;i++){const n=this._offsetMatrix[2*i],a=new p.Vector2(n.x,n.y),o=this.gradP[this._gradient((new p.Vector2).addVectors(e,a))],s=new p.Vector2(o.x,o.y),c=(new p.Vector2).subVectors(t,a);r.push(s.dot(c))}const i=this._fade(t.x),n=this._fade(t.y);return this._lerp(this._lerp(r[0],r[2],i),this._lerp(r[1],r[3],i),n)}get3(t){if(void 0===t.z)throw"Input to Perlin::get3() must be of type THREE.Vector3";const e=new p.Vector3(Math.floor(t.x),Math.floor(t.y),Math.floor(t.z));t.sub(e),e.x&=255,e.y&=255,e.z&=255;const r=[];for(let i=0;i<8;i++){const n=this._offsetMatrix[i],a=this.gradP[this._gradient((new p.Vector3).addVectors(e,n))],o=(new p.Vector3).subVectors(t,n);r.push(a.dot(o))}const i=this._fade(t.x),n=this._fade(t.y),a=this._fade(t.z);return this._lerp(this._lerp(this._lerp(r[0],r[4],i),this._lerp(r[1],r[5],i),a),this._lerp(this._lerp(r[2],r[6],i),this._lerp(r[3],r[7],i),a),n)}}class U{constructor(t){const{seed:e,scale:r,persistance:i,lacunarity:n,octaves:a,redistribution:o}=t;this._noise=new E(e),this._scale=r||1,this._persistance=i||.5,this._lacunarity=n||2,this._octaves=a||6,this._redistribution=o||1}get2(t){let e=0,r=1,i=1,n=r,a=this._noise.get2.bind(this._noise);for(let o=0;o<this._octaves;o++){e+=a(new p.Vector2(t.x*this._scale*i,t.y*this._scale*i))*r,i*=this._lacunarity,r*=this._persistance,n+=r}return Math.pow(e,this._redistribution)/n}get3(t){let e=0,r=1,i=1,n=r,a=this._noise.get3.bind(this._noise);for(let o=0;o<this._octaves;o++){e+=a(new p.Vector3(t.x*this._scale*i,t.y*this._scale*i,t.z*this._scale*i))*r,i*=this._lacunarity,r*=this._persistance,n+=r}return Math.pow(e,this._redistribution)/n}}let B=0,R=[];const N={"THREE.NoBlending":p.NoBlending,"THREE.NormalBlending":p.NormalBlending,"THREE.AdditiveBlending":p.AdditiveBlending,"THREE.SubtractiveBlending":p.SubtractiveBlending,"THREE.MultiplyBlending":p.MultiplyBlending},F=()=>JSON.parse(JSON.stringify(Q)),Q={transform:{position:new p.Vector3,rotation:new p.Vector3,scale:new p.Vector3(1,1,1)},duration:5,looping:!0,startDelay:0,startLifetime:5,startSpeed:1,startSize:1,startOpacity:1,startRotation:0,startColor:{min:{r:1,g:1,b:1},max:{r:1,g:1,b:1}},gravity:0,simulationSpace:"LOCAL",maxParticles:100,emission:{rateOverTime:10,rateOverDistance:0},shape:{shape:"SPHERE",sphere:{radius:1,radiusThickness:1,arc:360},cone:{angle:25,radius:1,radiusThickness:1,arc:360},circle:{radius:1,radiusThickness:1,arc:360},rectangle:{rotation:{x:0,y:0},scale:{x:1,y:1}},box:{scale:{x:1,y:1,z:1},emitFrom:"VOLUME"}},map:void 0,renderer:{blending:p.NormalBlending,discardBackgroundColor:!1,backgroundColorTolerance:1,backgroundColor:{r:1,g:1,b:1},transparent:!0,depthTest:!0,depthWrite:!1},velocityOverLifetime:{isActive:!1,linear:{x:0,y:0,z:0},orbital:{x:0,y:0,z:0}},sizeOverLifetime:{isActive:!1,lifetimeCurve:{type:"BEZIER",scale:1,bezierPoints:[{x:0,y:0,percentage:0},{x:1,y:1,percentage:1}]}},opacityOverLifetime:{isActive:!1,lifetimeCurve:{type:"BEZIER",scale:1,bezierPoints:[{x:0,y:0,percentage:0},{x:1,y:1,percentage:1}]}},rotationOverLifetime:{isActive:!1,min:0,max:0},noise:{isActive:!1,useRandomOffset:!1,strength:1,frequency:.5,octaves:1,positionAmount:1,rotationAmount:0,sizeAmount:0},textureSheetAnimation:{tiles:new p.Vector2(1,1),timeMode:"LIFETIME",fps:30,startFrame:0}},D=(t,{shape:e,sphere:r,cone:i,circle:n,rectangle:a,box:o},s,c,l)=>{const u=b(t.particleSystemId,s,t.normalizedLifetimePercentage);switch(e){case"SPHERE":y(c,t.wrapperQuaternion,l,u,r);break;case"CONE":f(c,t.wrapperQuaternion,l,u,i);break;case"CIRCLE":h(c,t.wrapperQuaternion,l,u,n);break;case"RECTANGLE":g(c,t.wrapperQuaternion,l,u,a);break;case"BOX":v(c,t.wrapperQuaternion,l,u,o)}},k=(t=Q,e)=>{const r=e||Date.now(),i={particleSystemId:B++,normalizedLifetimePercentage:0,distanceFromLastEmitByDistance:0,lastWorldPosition:new p.Vector3(-99999),currentWorldPosition:new p.Vector3(-99999),worldPositionChange:new p.Vector3,worldQuaternion:new p.Quaternion,wrapperQuaternion:new p.Quaternion,lastWorldQuaternion:new p.Quaternion(-99999),worldEuler:new p.Euler,gravityVelocity:new p.Vector3(0,0,0),startValues:{},linearVelocityData:void 0,orbitalVelocityData:void 0,lifetimeValues:{},creationTimes:[],noise:{isActive:!1,strength:0,positionAmount:0,rotationAmount:0,sizeAmount:0},isEnabled:!0},n=w(Q,t),{transform:a,duration:o,looping:s,startDelay:l,startLifetime:u,startSpeed:d,startSize:m,startRotation:y,startColor:f,startOpacity:v,gravity:h,simulationSpace:g,maxParticles:M,emission:O,shape:P,map:A,renderer:S,noise:_,velocityOverLifetime:C,onUpdate:L,onComplete:T,textureSheetAnimation:E}=n;"string"==typeof S?.blending&&(S.blending=N[S.blending]);const F=Array.from({length:M},(()=>new p.Vector3)),k=Array.from({length:M},(()=>new p.Vector3));i.creationTimes=Array.from({length:M},(()=>0)),C.isActive&&(i.linearVelocityData=Array.from({length:M},(()=>({speed:new p.Vector3(C.linear.x?b(i.particleSystemId,C.linear.x,0):0,C.linear.y?b(i.particleSystemId,C.linear.y,0):0,C.linear.z?b(i.particleSystemId,C.linear.z,0):0),valueModifiers:{x:x(C.linear.x||0)?I(i.particleSystemId,C.linear.x):void 0,y:x(C.linear.y||0)?I(i.particleSystemId,C.linear.y):void 0,z:x(C.linear.z||0)?I(i.particleSystemId,C.linear.z):void 0}}))),i.orbitalVelocityData=Array.from({length:M},(()=>({speed:new p.Vector3(C.orbital.x?b(i.particleSystemId,C.orbital.x,0):0,C.orbital.y?b(i.particleSystemId,C.orbital.y,0):0,C.orbital.z?b(i.particleSystemId,C.orbital.z,0):0),valueModifiers:{x:x(C.orbital.x||0)?I(i.particleSystemId,C.orbital.x):void 0,y:x(C.orbital.y||0)?I(i.particleSystemId,C.orbital.y):void 0,z:x(C.orbital.z||0)?I(i.particleSystemId,C.orbital.z):void 0},positionOffset:new p.Vector3}))));["startSize","startOpacity"].forEach((t=>{i.startValues[t]=Array.from({length:M},(()=>b(i.particleSystemId,n[t],0)))}));["rotationOverLifetime"].forEach((t=>{const e=n[t];e.isActive&&(i.lifetimeValues[t]=Array.from({length:M},(()=>p.MathUtils.randFloat(e.min,e.max))))})),i.noise={isActive:_.isActive,strength:_.strength,positionAmount:_.positionAmount,rotationAmount:_.rotationAmount,sizeAmount:_.sizeAmount,sampler:_.isActive?new U({seed:Math.random(),scale:_.frequency,octaves:_.octaves}):void 0,offsets:_.useRandomOffset?Array.from({length:M},(()=>100*Math.random())):void 0};const W=new p.ShaderMaterial({uniforms:{elapsed:{value:0},map:{value:A},tiles:{value:E.tiles},fps:{value:E.fps},useFPSForFrameIndex:{value:"FPS"===E.timeMode},backgroundColor:{value:S.backgroundColor},discardBackgroundColor:{value:S.discardBackgroundColor},backgroundColorTolerance:{value:S.backgroundColorTolerance}},vertexShader:"\n attribute float size;\n attribute float colorR;\n attribute float colorG;\n attribute float colorB;\n attribute float colorA;\n attribute float lifetime;\n attribute float startLifetime;\n attribute float rotation;\n attribute float startFrame;\n\n varying mat4 vPosition;\n varying vec4 vColor;\n varying float vLifetime;\n varying float vStartLifetime;\n varying float vRotation;\n varying float vStartFrame;\n\n void main()\n {\n vColor = vec4(colorR, colorG, colorB, colorA);\n vLifetime = lifetime;\n vStartLifetime = startLifetime;\n vRotation = rotation;\n vStartFrame = startFrame;\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = size * (100.0 / length(mvPosition.xyz));\n gl_Position = projectionMatrix * mvPosition;\n }\n",fragmentShader:"\n uniform sampler2D map;\n uniform float elapsed;\n uniform float fps;\n uniform bool useFPSForFrameIndex;\n uniform vec2 tiles;\n uniform bool discardBackgroundColor;\n uniform vec3 backgroundColor;\n uniform float backgroundColorTolerance;\n\n varying vec4 vColor;\n varying float vLifetime;\n varying float vStartLifetime;\n varying float vRotation;\n varying float vStartFrame;\n\n void main()\n {\n gl_FragColor = vColor;\n float mid = 0.5;\n\n float frameIndex = round(vStartFrame) + (\n useFPSForFrameIndex == true\n ? fps == 0.0\n ? 0.0\n : max((vLifetime / 1000.0) * fps, 0.0)\n : max(min(floor(min(vLifetime / vStartLifetime, 1.0) * (tiles.x * tiles.y)), tiles.x * tiles.y - 1.0), 0.0)\n );\n \n float spriteXIndex = floor(mod(frameIndex, tiles.x));\n float spriteYIndex = floor(mod(frameIndex / tiles.x, tiles.y));\n\n vec2 frameUV = vec2(\n gl_PointCoord.x / tiles.x + spriteXIndex / tiles.x,\n gl_PointCoord.y / tiles.y + spriteYIndex / tiles.y);\n\n vec2 center = vec2(0.5, 0.5);\n vec2 centeredPoint = gl_PointCoord - center;\n\n mat2 rotation = mat2(\n cos(vRotation), sin(vRotation),\n -sin(vRotation), cos(vRotation)\n );\n\n centeredPoint = rotation * centeredPoint;\n vec2 centeredMiddlePoint = vec2(\n centeredPoint.x + center.x,\n centeredPoint.y + center.y\n );\n\n float dist = distance(centeredMiddlePoint, center);\n if (dist > 0.5) discard;\n\n vec2 uvPoint = vec2(\n centeredMiddlePoint.x / tiles.x + spriteXIndex / tiles.x,\n centeredMiddlePoint.y / tiles.y + spriteYIndex / tiles.y\n );\n\n vec4 rotatedTexture = texture2D(map, uvPoint);\n\n gl_FragColor = gl_FragColor * rotatedTexture;\n\n if (discardBackgroundColor && abs(length(rotatedTexture.rgb - backgroundColor.rgb)) < backgroundColorTolerance ) discard;\n }\n",transparent:S.transparent,blending:S.blending,depthTest:S.depthTest,depthWrite:S.depthWrite}),G=new p.BufferGeometry;for(let t=0;t<M;t++)D(i,P,d,F[t],k[t]);G.setFromPoints(Array.from({length:M},((t,e)=>F[e].clone())));const H=(t,e)=>{(({geometry:t,propertyName:e,maxParticles:r,factory:i})=>{t.setAttribute(e,new p.BufferAttribute(new Float32Array(Array.from({length:r},"function"==typeof i?i:()=>i)),1))})({geometry:G,propertyName:t,maxParticles:M,factory:e})};H("isActive",0),H("lifetime",0),H("startLifetime",(()=>1e3*b(i.particleSystemId,u,0))),H("startFrame",(()=>E.startFrame?b(i.particleSystemId,E.startFrame,0):0)),H("opacity",(()=>b(i.particleSystemId,v,0))),H("rotation",(()=>b(i.particleSystemId,y,0))),H("size",((t,e)=>i.startValues.startSize[e])),H("rotation",0);const j=Math.random();H("colorR",(()=>f.min.r+j*(f.max.r-f.min.r))),H("colorG",(()=>f.min.g+j*(f.max.g-f.min.g))),H("colorB",(()=>f.min.b+j*(f.max.b-f.min.b))),H("colorA",0);let q=new p.Points(G,W);q.position.copy(a.position),q.rotation.x=p.MathUtils.degToRad(a.rotation.x),q.rotation.y=p.MathUtils.degToRad(a.rotation.y),q.rotation.z=p.MathUtils.degToRad(a.rotation.z),q.scale.copy(a.scale);const Y=r+1e3*b(i.particleSystemId,l);let X;"WORLD"===n.simulationSpace&&(X=new V,X.add(q)),R.push({particleSystem:q,wrapper:X,generalData:i,onUpdate:L,onComplete:T,creationTime:Y,lastEmissionTime:Y,duration:o,looping:s,simulationSpace:g,gravity:h,emission:O,normalizedConfig:n,iterationCount:0,velocities:k,deactivateParticle:t=>{G.attributes.isActive.array[t]=0,G.attributes.colorA.array[t]=0,G.attributes.colorA.needsUpdate=!0},activateParticle:({particleIndex:t,activationTime:e,position:r})=>{G.attributes.isActive.array[t]=1,i.creationTimes[t]=e,i.noise.offsets&&(i.noise.offsets[t]=100*Math.random());const a=Math.random();G.attributes.colorR.array[t]=f.min.r+a*(f.max.r-f.min.r),G.attributes.colorR.needsUpdate=!0,G.attributes.colorG.array[t]=f.min.g+a*(f.max.g-f.min.g),G.attributes.colorG.needsUpdate=!0,G.attributes.colorB.array[t]=f.min.b+a*(f.max.b-f.min.b),G.attributes.colorB.needsUpdate=!0,G.attributes.startFrame.array[t]=E.startFrame?b(i.particleSystemId,E.startFrame,0):0,G.attributes.startFrame.needsUpdate=!0,G.attributes.startLifetime.array[t]=1e3*b(i.particleSystemId,u,i.normalizedLifetimePercentage),G.attributes.startLifetime.needsUpdate=!0,i.startValues.startSize[t]=b(i.particleSystemId,m,i.normalizedLifetimePercentage),G.attributes.size.array[t]=i.startValues.startSize[t],G.attributes.size.needsUpdate=!0,i.startValues.startOpacity[t]=b(i.particleSystemId,v,i.normalizedLifetimePercentage),G.attributes.colorA.array[t]=i.startValues.startOpacity[t],G.attributes.colorA.needsUpdate=!0,G.attributes.rotation.array[t]=b(i.particleSystemId,y,i.normalizedLifetimePercentage),G.attributes.rotation.needsUpdate=!0,n.rotationOverLifetime.isActive&&(i.lifetimeValues.rotationOverLifetime[t]=p.MathUtils.randFloat(n.rotationOverLifetime.min,n.rotationOverLifetime.max)),D(i,P,d,F[t],k[t]);const o=Math.floor(3*t);G.attributes.position.array[o]=r.x+F[t].x,G.attributes.position.array[o+1]=r.y+F[t].y,G.attributes.position.array[o+2]=r.z+F[t].z,G.attributes.position.needsUpdate=!0,i.linearVelocityData&&i.linearVelocityData[t].speed.set(n.velocityOverLifetime.linear.x?b(i.particleSystemId,n.velocityOverLifetime.linear.x,0):0,n.velocityOverLifetime.linear.y?b(i.particleSystemId,n.velocityOverLifetime.linear.y,0):0,n.velocityOverLifetime.linear.z?b(i.particleSystemId,n.velocityOverLifetime.linear.z,0):0),i.orbitalVelocityData&&(i.orbitalVelocityData[t].speed.set(n.velocityOverLifetime.orbital.x?b(i.particleSystemId,n.velocityOverLifetime.orbital.x,0):0,n.velocityOverLifetime.orbital.y?b(i.particleSystemId,n.velocityOverLifetime.orbital.y,0):0,n.velocityOverLifetime.orbital.z?b(i.particleSystemId,n.velocityOverLifetime.orbital.z,0):0),i.orbitalVelocityData[t].positionOffset.set(F[t].x,F[t].y,F[t].z)),G.attributes.lifetime.array[t]=0,G.attributes.lifetime.needsUpdate=!0,z({delta:0,generalData:i,normalizedConfig:n,attributes:q.geometry.attributes,particleLifetimePercentage:0,particleIndex:t})}});return{instance:X||q,resumeEmitter:()=>i.isEnabled=!0,pauseEmitter:()=>i.isEnabled=!1,dispose:()=>(t=>{R=R.filter((({particleSystem:e,wrapper:r,generalData:{particleSystemId:i}})=>e!==t&&r!==t||(c(i),e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach((t=>t.dispose())):e.material.dispose(),e.parent&&e.parent.remove(e),!1)))})(q)}},W=({now:t,delta:e,elapsed:r})=>{R.forEach((i=>{const{onUpdate:n,generalData:a,onComplete:o,particleSystem:s,wrapper:c,creationTime:l,lastEmissionTime:u,duration:d,looping:m,emission:y,normalizedConfig:f,iterationCount:v,velocities:h,deactivateParticle:g,activateParticle:x,simulationSpace:I,gravity:M}=i,O=t-l,w=O%(1e3*d);a.normalizedLifetimePercentage=Math.max(Math.min(w/(1e3*d),1),0);const{lastWorldPosition:P,currentWorldPosition:A,worldPositionChange:S,lastWorldQuaternion:_,worldQuaternion:C,worldEuler:L,gravityVelocity:V,isEnabled:T}=a;c?.parent&&a.wrapperQuaternion.copy(c.parent.quaternion);const E={...P};if(Array.isArray(s.material)?s.material.forEach((t=>{t instanceof p.ShaderMaterial&&(t.uniforms.elapsed.value=r)})):s.material instanceof p.ShaderMaterial&&(s.material.uniforms.elapsed.value=r),s.getWorldPosition(A),-99999!==P.x&&S.set(A.x-P.x,A.y-P.y,A.z-P.z),a.distanceFromLastEmitByDistance+=S.length(),s.getWorldPosition(P),s.getWorldQuaternion(C),-99999!==_.x&&_.x===C.x&&_.y===C.y&&_.z===C.z||(L.setFromQuaternion(C),_.copy(C),V.set(P.x,P.y+M,P.z),s.worldToLocal(V)),a.creationTimes.forEach(((r,i)=>{if(s.geometry.attributes.isActive.array[i]){const n=t-r;if(n>s.geometry.attributes.startLifetime.array[i])g(i);else{const t=h[i];if(t.x-=V.x*e,t.y-=V.y*e,t.z-=V.z*e,0!==M||0!==t.x||0!==t.y||0!==t.z||0!==S.x||0!==S.y||0!==S.z){const r=3*i,n=s.geometry.attributes.position.array;"WORLD"===I&&(n[r]-=S.x,n[r+1]-=S.y,n[r+2]-=S.z),n[r]+=t.x*e,n[r+1]+=t.y*e,n[r+2]+=t.z*e,s.geometry.attributes.position.needsUpdate=!0}s.geometry.attributes.lifetime.array[i]=n,s.geometry.attributes.lifetime.needsUpdate=!0;const r=n/s.geometry.attributes.startLifetime.array[i];z({delta:e,generalData:a,normalizedConfig:f,attributes:s.geometry.attributes,particleLifetimePercentage:r,particleIndex:i})}}})),T&&(m||O<1e3*d)){const o=t-u,c=y.rateOverTime?Math.floor(b(a.particleSystemId,y.rateOverTime,a.normalizedLifetimePercentage)*(o/1e3)):0,l=y.rateOverDistance?b(a.particleSystemId,y.rateOverDistance,a.normalizedLifetimePercentage):0,d=l>0&&a.distanceFromLastEmitByDistance>0?Math.floor(a.distanceFromLastEmitByDistance/(1/l)):0,m=d>0?{x:(A.x-E.x)/d,y:(A.y-E.y)/d,z:(A.z-E.z)/d}:null,p=c+d;if(l>0&&d>=1&&(a.distanceFromLastEmitByDistance=0),p>0){let e=0;for(let r=0;r<p;r++){let r=-1;if(s.geometry.attributes.isActive.array.find(((t,e)=>!t&&(r=e,!0))),-1!==r&&r<s.geometry.attributes.isActive.array.length){let n={x:0,y:0,z:0};m&&e<d&&(n={x:m.x*e,y:m.y*e,z:m.z*e},e++),x({particleIndex:r,activationTime:t,position:n}),i.lastEmissionTime=t}}}n&&n({particleSystem:s,delta:e,elapsed:r,lifetime:O,normalizedLifetime:w,iterationCount:v+1})}else o&&o({particleSystem:s})}))};var G=n.pB,H=n.U_,j=n.rU,q=n.M4,Y=n.$H,X=n.hp,$=n.l$,J=n.Y$,K=n.Tt,Z=n.eL,tt=n.Hc,et=n.Ao,rt=n.iy,it=n.Px,nt=n.rJ,at=n.Pj,ot=n.YR;export{G as applyModifiers,H as blendingMap,j as calculateRandomPositionAndVelocityOnBox,q as calculateRandomPositionAndVelocityOnCircle,Y as calculateRandomPositionAndVelocityOnCone,X as calculateRandomPositionAndVelocityOnRectangle,$ as calculateRandomPositionAndVelocityOnSphere,J as calculateValue,K as createBezierCurveFunction,Z as createParticleSystem,tt as getBezierCacheSize,et as getCurveFunction,rt as getCurveFunctionFromConfig,it as getDefaultParticleSystemConfig,nt as isLifeTimeCurve,at as removeBezierCurveFunction,ot as updateParticleSystems};
1
+ import*as t from"THREE";var e={300:t=>{const e=t=>t,r={In:t=>t*t,Out:t=>t*(2-t),InOut(t){let e=2*t;return e<1?.5*e*e:(e-=1,-.5*(e*(e-2)-1))}},i={In:t=>t*t*t,Out:t=>--t*t*t+1,InOut(t){let e=2*t;return e<1?.5*e*e*e:(e-=2,.5*(e*e*e+2))}},a={In:t=>t*t*t*t,Out:t=>1- --t*t*t*t,InOut(t){let e=2*t;return e<1?.5*e*e*e*e:(e-=2,-.5*(e*e*e*e-2))}},n={In:t=>t*t*t*t*t,Out:t=>--t*t*t*t*t+1,InOut(t){let e=2*t;return e<1?.5*e*e*e*e*e:(e-=2,.5*(e*e*e*e*e+2))}},o={In:t=>1-Math.cos(t*Math.PI/2),Out:t=>Math.sin(t*Math.PI/2),InOut:t=>.5*(1-Math.cos(Math.PI*t))},s={In:t=>0===t?0:1024**(t-1),Out:t=>1===t?1:1-2**(-10*t),InOut(t){if(0===t)return 0;if(1===t)return 1;const e=2*t;return e<1?.5*1024**(e-1):.5*(2-2**(-10*(e-1)))}},l={In:t=>1-Math.sqrt(1-t*t),Out:t=>Math.sqrt(1- --t*t),InOut(t){let e=2*t;return e<1?-.5*(Math.sqrt(1-e*e)-1):(e-=2,.5*(Math.sqrt(1-e*e)+1))}},c={In(t){let e=.1;let r;return 0===t?0:1===t?1:(e<1?(e=1,r=.1):r=.4*Math.asin(1/e)/(2*Math.PI),-e*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/.4))},Out(t){let e=.1;let r;return 0===t?0:1===t?1:(e<1?(e=1,r=.1):r=.4*Math.asin(1/e)/(2*Math.PI),e*2**(-10*t)*Math.sin((t-r)*(2*Math.PI)/.4)+1)},InOut(t){let e=.1;const r=.4;let i;if(0===t)return 0;if(1===t)return 1;e<1?(e=1,i=.1):i=r*Math.asin(1/e)/(2*Math.PI);const a=2*t;if(a<1){const t=a-1;return e*2**(10*t)*Math.sin((t-i)*(2*Math.PI)/r)*-.5}const n=a-1;return e*2**(-10*n)*Math.sin((n-i)*(2*Math.PI)/r)*.5+1}},d={In(t){const e=1.70158;return t*t*((e+1)*t-e)},Out(t){const e=1.70158;return--t*t*((e+1)*t+e)+1},InOut(t){const e=2.5949095;let r=2*t;return r<1?r*r*((e+1)*r-e)*.5:(r-=2,.5*(r*r*((e+1)*r+e)+2))}},u={In:t=>1-u.Out(1-t),Out(t){if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){const e=t-1.5/2.75;return 7.5625*e*e+.75}if(t<2.5/2.75){const e=t-2.25/2.75;return 7.5625*e*e+.9375}const e=t-2.625/2.75;return 7.5625*e*e+.984375},InOut:t=>t<.5?.5*u.In(2*t):.5*u.Out(2*t-1)+.5},m={Quadratic:r,Cubic:i,Quartic:a,Quintic:n,Sinusoidal:o,Exponential:s,Circular:l,Elastic:c,Back:d,Bounce:u},y=(t,e,r)=>Object.defineProperty(t,e,{value:r});for(const t of Object.keys(m)){const e=m[t],r=t.toLowerCase();y(m,r,e);for(const i of Object.keys(e)){const a=e[i],n=i.toLowerCase();y(m,`${t}.${i}`,a),y(m,`${r}.${n}`,a),y(e,n,a)}}m.Linear=e,y(m,"linear",e),t.exports=m,"undefined"!=typeof window&&(window.Easing=m)}},r={};function i(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,i),n.exports}i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};i.d(a,{pB:()=>P,U_:()=>F,rU:()=>v,M4:()=>h,$H:()=>f,hp:()=>g,l$:()=>p,Y$:()=>O,Tt:()=>s,JP:()=>x,eL:()=>W,Hc:()=>c,Ao:()=>m,iy:()=>I,Px:()=>Q,rJ:()=>b,Pj:()=>l,YR:()=>j});const n=[],o=(t,e)=>{let r=1;for(let i=1;i<=e;i++)r*=(t+1-i)/i;return r},s=(t,e)=>{const r=n.find((t=>t.bezierPoints===e));if(r)return r.referencedBy.includes(t)||r.referencedBy.push(t),r.curveFunction;const i={referencedBy:[t],bezierPoints:e,curveFunction:t=>{if(t<0)return e[0].y;if(t>1)return e[e.length-1].y;let r=0,i=e.length-1;e.find(((e,a)=>{const n=t<(e.percentage??0);return n?i=a:void 0!==e.percentage&&(r=a),n}));const a=i-r,n=(t-(e[r].percentage??0))/((e[i].percentage??1)-(e[r].percentage??0));let s=0;for(let t=0;t<=a;t++){const i=e[r+t];s+=o(a,t)*Math.pow(1-n,a-t)*Math.pow(n,t)*i.y}return s}};return n.push(i),i.curveFunction},l=t=>{for(;;){const e=n.findIndex((e=>e.referencedBy.includes(t)));if(-1===e)break;const r=n[e];r.referencedBy=r.referencedBy.filter((e=>e!==t)),0===r.referencedBy.length&&n.splice(e,1)}},c=()=>n.length;var d=i(300);const u={LINEAR:d.Linear.None,QUADRATIC_IN:d.Quadratic.In,QUADRATIC_OUT:d.Quadratic.Out,QUADRATIC_IN_OUT:d.Quadratic.InOut,CUBIC_IN:d.Cubic.In,CUBIC_OUT:d.Cubic.Out,CUBIC_IN_OUT:d.Cubic.InOut,QUARTIC_IN:d.Quartic.In,QUARTIC_OUT:d.Quartic.Out,QUARTIC_IN_OUT:d.Quartic.InOut,QUINTIC_IN:d.Quintic.In,QUINTIC_OUT:d.Quintic.Out,QUINTIC_IN_OUT:d.Quintic.InOut,SINUSOIDAL_IN:d.Sinusoidal.In,SINUSOIDAL_OUT:d.Sinusoidal.Out,SINUSOIDAL_IN_OUT:d.Sinusoidal.InOut,EXPONENTIAL_IN:d.Exponential.In,EXPONENTIAL_OUT:d.Exponential.Out,EXPONENTIAL_IN_OUT:d.Exponential.InOut,CIRCULAR_IN:d.Circular.In,CIRCULAR_OUT:d.Circular.Out,CIRCULAR_IN_OUT:d.Circular.InOut,ELASTIC_IN:d.Elastic.In,ELASTIC_OUT:d.Elastic.Out,ELASTIC_IN_OUT:d.Elastic.InOut,BACK_IN:d.Back.In,BACK_OUT:d.Back.Out,BACK_IN_OUT:d.Back.InOut,BOUNCE_IN:d.Bounce.In,BOUNCE_OUT:d.Bounce.Out,BOUNCE_IN_OUT:d.Bounce.InOut},m=t=>"function"==typeof t?t:u[t];const y=(t=>{var e={};return i.d(e,t),e})({AdditiveBlending:()=>t.AdditiveBlending,BufferAttribute:()=>t.BufferAttribute,BufferGeometry:()=>t.BufferGeometry,CanvasTexture:()=>t.CanvasTexture,Euler:()=>t.Euler,MathUtils:()=>t.MathUtils,MultiplyBlending:()=>t.MultiplyBlending,NoBlending:()=>t.NoBlending,NormalBlending:()=>t.NormalBlending,Object3D:()=>t.Object3D,Points:()=>t.Points,Quaternion:()=>t.Quaternion,ShaderMaterial:()=>t.ShaderMaterial,SubtractiveBlending:()=>t.SubtractiveBlending,Vector2:()=>t.Vector2,Vector3:()=>t.Vector3}),p=(t,e,r,i,{radius:a,radiusThickness:n,arc:o})=>{const s=Math.random()*(o/360),l=Math.random(),c=Math.random(),d=2*Math.PI*s,u=Math.acos(2*l-1),m=Math.sin(u),y=m*Math.cos(d),p=m*Math.sin(d),f=Math.cos(u),v=1-n;t.x=a*v*y+a*n*c*y,t.y=a*v*p+a*n*c*p,t.z=a*v*f+a*n*c*f,t.applyQuaternion(e);const h=1/t.length();r.set(t.x*h*i,t.y*h*i,t.z*h*i),r.applyQuaternion(e)},f=(t,e,r,i,{radius:a,radiusThickness:n,arc:o,angle:s=90})=>{const l=2*Math.PI*Math.random()*(o/360),c=Math.random(),d=Math.cos(l),u=Math.sin(l),m=1-n;t.x=a*m*d+a*n*c*d,t.y=a*m*u+a*n*c*u,t.z=0,t.applyQuaternion(e);const p=t.length(),f=Math.abs(p/a*y.MathUtils.degToRad(s)),v=Math.sin(f),h=1/p;r.set(t.x*v*h*i,t.y*v*h*i,Math.cos(f)*i),r.applyQuaternion(e)},v=(t,e,r,i,{scale:a,emitFrom:n})=>{const o=a;switch(n){case"VOLUME":t.x=Math.random()*o.x-o.x/2,t.y=Math.random()*o.y-o.y/2,t.z=Math.random()*o.z-o.z/2;break;case"SHELL":const e=Math.floor(6*Math.random()),r=e%3,i=[];i[r]=e>2?1:0,i[(r+1)%3]=Math.random(),i[(r+2)%3]=Math.random(),t.x=i[0]*o.x-o.x/2,t.y=i[1]*o.y-o.y/2,t.z=i[2]*o.z-o.z/2;break;case"EDGE":const a=Math.floor(6*Math.random()),n=a%3,s=Math.floor(4*Math.random()),l=[];l[n]=a>2?1:0,l[(n+1)%3]=s<2?Math.random():s-2,l[(n+2)%3]=s<2?s:Math.random(),t.x=l[0]*o.x-o.x/2,t.y=l[1]*o.y-o.y/2,t.z=l[2]*o.z-o.z/2}t.applyQuaternion(e),r.set(0,0,i),r.applyQuaternion(e)},h=(t,e,r,i,{radius:a,radiusThickness:n,arc:o})=>{const s=2*Math.PI*Math.random()*(o/360),l=Math.random(),c=Math.cos(s),d=Math.sin(s),u=1-n;t.x=a*u*c+a*n*l*c,t.y=a*u*d+a*n*l*d,t.z=0,t.applyQuaternion(e);const m=1/t.length();r.set(t.x*m*i,t.y*m*i,0),r.applyQuaternion(e)},g=(t,e,r,i,{rotation:a,scale:n})=>{const o=n,s=a,l=Math.random()*o.x-o.x/2,c=Math.random()*o.y-o.y/2,d=y.MathUtils.degToRad(s.x),u=y.MathUtils.degToRad(s.y);t.x=l*Math.cos(u),t.y=c*Math.cos(d),t.z=l*Math.sin(u)-c*Math.sin(d),t.applyQuaternion(e),r.set(0,0,i),r.applyQuaternion(e)},x=()=>{try{const t=document.createElement("canvas"),e=64;t.width=e,t.height=e;const r=t.getContext("2d");if(r){const i=e/2,a=e/2,n=e/2-2;r.beginPath(),r.arc(i,a,n,0,2*Math.PI,!1),r.fillStyle="white",r.fill();const o=new y.CanvasTexture(t);return o.needsUpdate=!0,o}return null}catch(t){return null}},b=t=>"number"!=typeof t&&"type"in t,I=(t,e)=>{if("BEZIER"===e.type)return s(t,e.bezierPoints);if("EASING"===e.type)return e.curveFunction;throw new Error(`Unsupported value type: ${e}`)},O=(t,e,r=0)=>{if("number"==typeof e)return e;if("min"in e&&"max"in e)return e.min===e.max?e.min??0:y.MathUtils.randFloat(e.min??0,e.max??1);const i=e;return I(t,i)(r)*(i.scale??1)},M=new y.Vector3(0,0,0),z=new y.Euler,P=({delta:t,generalData:e,normalizedConfig:r,attributes:i,particleLifetimePercentage:a,particleIndex:n})=>{const{particleSystemId:o,startValues:s,lifetimeValues:l,linearVelocityData:c,orbitalVelocityData:d,noise:u}=e,m=3*n,y=i.position.array;if(c){const{speed:e,valueModifiers:r}=c[n],o=r.x?r.x(a):e.x,s=r.y?r.y(a):e.y,l=r.z?r.z(a):e.z;y[m]+=o*t,y[m+1]+=s*t,y[m+2]+=l*t,i.position.needsUpdate=!0}if(d){const{speed:e,positionOffset:r,valueModifiers:o}=d[n];y[m]-=r.x,y[m+1]-=r.y,y[m+2]-=r.z;const s=o.x?o.x(a):e.x,l=o.y?o.y(a):e.y,c=o.z?o.z(a):e.z;z.set(s*t,c*t,l*t),r.applyEuler(z),y[m]+=r.x,y[m+1]+=r.y,y[m+2]+=r.z,i.position.needsUpdate=!0}if(r.sizeOverLifetime.isActive){const t=O(o,r.sizeOverLifetime.lifetimeCurve,a);i.size.array[n]=s.startSize[n]*t,i.size.needsUpdate=!0}if(r.opacityOverLifetime.isActive){const t=O(o,r.opacityOverLifetime.lifetimeCurve,a);i.colorA.array[n]=s.startOpacity[n]*t,i.colorA.needsUpdate=!0}if(l.rotationOverLifetime&&(i.rotation.array[n]+=l.rotationOverLifetime[n]*t*.02,i.rotation.needsUpdate=!0),u.isActive){const{sampler:t,strength:e,offsets:r,positionAmount:o,rotationAmount:s,sizeAmount:l}=u;let c;const d=10*(a+(r?r[n]:0))*e,p=.15*e;M.set(d,0,0),c=t.get3(M),y[m]+=c*p*o,0!==s&&(i.rotation.array[n]+=c*p*s,i.rotation.needsUpdate=!0),0!==l&&(i.size.array[n]+=c*p*l,i.size.needsUpdate=!0),M.set(d,d,0),c=t.get3(M),y[m+1]+=c*p*o,M.set(d,d,d),c=t.get3(M),y[m+2]+=c*p*o,i.position.needsUpdate=!0}};const w=(t,e,r={skippedProperties:[],applyToFirstObject:!1})=>{const i={};return Object.keys(t).forEach((a=>{r.skippedProperties&&r.skippedProperties.includes(a)||("object"==typeof t[a]&&t[a]&&e[a]&&!Array.isArray(t[a])?i[a]=w(t[a],e[a],r):(i[a]=0===e[a]?0:!1!==e[a]&&(e[a]||t[a]),r.applyToFirstObject&&(t[a]=i[a])))})),i},A=new y.Vector3,S=new y.Quaternion,_=new y.Vector3,C=new y.Vector3,L=new y.Quaternion,V=new y.Vector3;class T extends y.Object3D{constructor(){super()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null!==this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(C,L,V),this.matrix.decompose(A,S,_),this.matrixWorld.compose(C,S,V)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e=0,r=this.children.length;e<r;e++)this.children[e].updateMatrixWorld(t)}}var E=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];class U{constructor(t){const e=[new y.Vector3(1,1,0),new y.Vector3(-1,1,0),new y.Vector3(1,-1,0),new y.Vector3(-1,-1,0),new y.Vector3(1,0,1),new y.Vector3(-1,0,1),new y.Vector3(1,0,-1),new y.Vector3(-1,0,-1),new y.Vector3(0,1,1),new y.Vector3(0,-1,1),new y.Vector3(0,1,-1),new y.Vector3(0,-1,-1)];var r=new Array(512),i=new Array(512);t||(t=1),t*=65536,(t=Math.floor(t))<256&&(t|=t<<8);for(var a=0;a<256;a++){var n;n=1&a?E[a]^255&t:E[a]^t>>8&255,r[a]=r[a+256]=n,i[a]=i[a+256]=e[n%12]}this._seed=t,this._offsetMatrix=[new y.Vector3(0,0,0),new y.Vector3(0,0,1),new y.Vector3(0,1,0),new y.Vector3(0,1,1),new y.Vector3(1,0,0),new y.Vector3(1,0,1),new y.Vector3(1,1,0),new y.Vector3(1,1,1)],this.shaderChunk={defines:"",header:'#define GLSLIFY 1\n// From https://github.com/hughsk/glsl-noise/blob/master/periodic/2d.glsl\n\n//\n// GLSL textureless classic 2D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-08-22\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\n\nvec4 permute(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }\n\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec2 fade(vec2 t) { return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); }\n\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\n// Classic Perlin noise, periodic variant\nfloat perlin(vec2 P) {\n\n vec2 rep = vec2(255.0, 255.0);\n\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0;\n vec4 gy = abs(gx) - 0.5;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x, gy.x);\n vec2 g10 = vec2(gx.y, gy.y);\n vec2 g01 = vec2(gx.z, gy.z);\n vec2 g11 = vec2(gx.w, gy.w);\n\n vec4 norm = taylorInvSqrt(\n vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return map(2.3 * n_xy, -1.0, 1.0, 0.0, 1.0);\n}\n\nfloat fbm(vec2 pos, vec4 props) {\n float persistance = props.x;\n float lacunarity = props.y;\n float redistribution = props.z;\n int octaves = int(props.w);\n\n float result = 0.0;\n float amplitude = 1.0;\n float frequency = 1.0;\n float maximum = amplitude;\n\n for (int i = 0; i < 2; i++) {\n\n vec2 p = pos.xy * frequency;\n\n float noiseVal = perlin(p);\n result += noiseVal * amplitude;\n\n frequency *= lacunarity;\n amplitude *= persistance;\n maximum += amplitude;\n }\n\n float redistributed = pow(result, redistribution);\n return redistributed / maximum;\n}\n',main:"",uniforms:[{three_noise_seed:this._seed}]},this.perm=r,this.gradP=i}_fade(t){return t*t*t*(t*(6*t-15)+10)}_lerp(t,e,r){return(1-r)*t+r*e}_gradient(t){return t instanceof y.Vector3?t.x+this.perm[t.y+this.perm[t.z]]:t.x+this.perm[t.y]}static map(t,e,r,i,a){return(t-e)*(a-i)/(r-e)+i}get2(t){void 0!==t.z&&(t=new y.Vector2(t.x,t.y));const e=new y.Vector2(Math.floor(t.x),Math.floor(t.y));t.sub(e),e.x&=255,e.y&=255;const r=[];for(let i=0;i<4;i++){const a=this._offsetMatrix[2*i],n=new y.Vector2(a.x,a.y),o=this.gradP[this._gradient((new y.Vector2).addVectors(e,n))],s=new y.Vector2(o.x,o.y),l=(new y.Vector2).subVectors(t,n);r.push(s.dot(l))}const i=this._fade(t.x),a=this._fade(t.y);return this._lerp(this._lerp(r[0],r[2],i),this._lerp(r[1],r[3],i),a)}get3(t){if(void 0===t.z)throw"Input to Perlin::get3() must be of type THREE.Vector3";const e=new y.Vector3(Math.floor(t.x),Math.floor(t.y),Math.floor(t.z));t.sub(e),e.x&=255,e.y&=255,e.z&=255;const r=[];for(let i=0;i<8;i++){const a=this._offsetMatrix[i],n=this.gradP[this._gradient((new y.Vector3).addVectors(e,a))],o=(new y.Vector3).subVectors(t,a);r.push(n.dot(o))}const i=this._fade(t.x),a=this._fade(t.y),n=this._fade(t.z);return this._lerp(this._lerp(this._lerp(r[0],r[4],i),this._lerp(r[1],r[5],i),n),this._lerp(this._lerp(r[2],r[6],i),this._lerp(r[3],r[7],i),n),a)}}class B{constructor(t){const{seed:e,scale:r,persistance:i,lacunarity:a,octaves:n,redistribution:o}=t;this._noise=new U(e),this._scale=r||1,this._persistance=i||.5,this._lacunarity=a||2,this._octaves=n||6,this._redistribution=o||1}get2(t){let e=0,r=1,i=1,a=r,n=this._noise.get2.bind(this._noise);for(let o=0;o<this._octaves;o++){e+=n(new y.Vector2(t.x*this._scale*i,t.y*this._scale*i))*r,i*=this._lacunarity,r*=this._persistance,a+=r}return Math.pow(e,this._redistribution)/a}get3(t){let e=0,r=1,i=1,a=r,n=this._noise.get3.bind(this._noise);for(let o=0;o<this._octaves;o++){e+=n(new y.Vector3(t.x*this._scale*i,t.y*this._scale*i,t.z*this._scale*i))*r,i*=this._lacunarity,r*=this._persistance,a+=r}return Math.pow(e,this._redistribution)/a}}let R=0,N=[];const F={"THREE.NoBlending":y.NoBlending,"THREE.NormalBlending":y.NormalBlending,"THREE.AdditiveBlending":y.AdditiveBlending,"THREE.SubtractiveBlending":y.SubtractiveBlending,"THREE.MultiplyBlending":y.MultiplyBlending},Q=()=>JSON.parse(JSON.stringify(D)),D={transform:{position:new y.Vector3,rotation:new y.Vector3,scale:new y.Vector3(1,1,1)},duration:5,looping:!0,startDelay:0,startLifetime:5,startSpeed:1,startSize:1,startOpacity:1,startRotation:0,startColor:{min:{r:1,g:1,b:1},max:{r:1,g:1,b:1}},gravity:0,simulationSpace:"LOCAL",maxParticles:100,emission:{rateOverTime:10,rateOverDistance:0},shape:{shape:"SPHERE",sphere:{radius:1,radiusThickness:1,arc:360},cone:{angle:25,radius:1,radiusThickness:1,arc:360},circle:{radius:1,radiusThickness:1,arc:360},rectangle:{rotation:{x:0,y:0},scale:{x:1,y:1}},box:{scale:{x:1,y:1,z:1},emitFrom:"VOLUME"}},map:void 0,renderer:{blending:y.NormalBlending,discardBackgroundColor:!1,backgroundColorTolerance:1,backgroundColor:{r:1,g:1,b:1},transparent:!0,depthTest:!0,depthWrite:!1},velocityOverLifetime:{isActive:!1,linear:{x:0,y:0,z:0},orbital:{x:0,y:0,z:0}},sizeOverLifetime:{isActive:!1,lifetimeCurve:{type:"BEZIER",scale:1,bezierPoints:[{x:0,y:0,percentage:0},{x:1,y:1,percentage:1}]}},opacityOverLifetime:{isActive:!1,lifetimeCurve:{type:"BEZIER",scale:1,bezierPoints:[{x:0,y:0,percentage:0},{x:1,y:1,percentage:1}]}},rotationOverLifetime:{isActive:!1,min:0,max:0},noise:{isActive:!1,useRandomOffset:!1,strength:1,frequency:.5,octaves:1,positionAmount:1,rotationAmount:0,sizeAmount:0},textureSheetAnimation:{tiles:new y.Vector2(1,1),timeMode:"LIFETIME",fps:30,startFrame:0}},k=(t,{shape:e,sphere:r,cone:i,circle:a,rectangle:n,box:o},s,l,c)=>{const d=O(t.particleSystemId,s,t.normalizedLifetimePercentage);switch(e){case"SPHERE":p(l,t.wrapperQuaternion,c,d,r);break;case"CONE":f(l,t.wrapperQuaternion,c,d,i);break;case"CIRCLE":h(l,t.wrapperQuaternion,c,d,a);break;case"RECTANGLE":g(l,t.wrapperQuaternion,c,d,n);break;case"BOX":v(l,t.wrapperQuaternion,c,d,o)}},W=(t=D,e)=>{const r=e||Date.now(),i={particleSystemId:R++,normalizedLifetimePercentage:0,distanceFromLastEmitByDistance:0,lastWorldPosition:new y.Vector3(-99999),currentWorldPosition:new y.Vector3(-99999),worldPositionChange:new y.Vector3,worldQuaternion:new y.Quaternion,wrapperQuaternion:new y.Quaternion,lastWorldQuaternion:new y.Quaternion(-99999),worldEuler:new y.Euler,gravityVelocity:new y.Vector3(0,0,0),startValues:{},linearVelocityData:void 0,orbitalVelocityData:void 0,lifetimeValues:{},creationTimes:[],noise:{isActive:!1,strength:0,positionAmount:0,rotationAmount:0,sizeAmount:0},isEnabled:!0},a=w(D,t);let n=a.map||x();const{transform:o,duration:s,looping:c,startDelay:d,startLifetime:u,startSpeed:m,startSize:p,startRotation:f,startColor:v,startOpacity:h,gravity:g,simulationSpace:M,maxParticles:z,emission:A,shape:S,renderer:_,noise:C,velocityOverLifetime:L,onUpdate:V,onComplete:E,textureSheetAnimation:U}=a;"string"==typeof _?.blending&&(_.blending=F[_.blending]);const Q=Array.from({length:z},(()=>new y.Vector3)),W=Array.from({length:z},(()=>new y.Vector3));i.creationTimes=Array.from({length:z},(()=>0)),L.isActive&&(i.linearVelocityData=Array.from({length:z},(()=>({speed:new y.Vector3(L.linear.x?O(i.particleSystemId,L.linear.x,0):0,L.linear.y?O(i.particleSystemId,L.linear.y,0):0,L.linear.z?O(i.particleSystemId,L.linear.z,0):0),valueModifiers:{x:b(L.linear.x||0)?I(i.particleSystemId,L.linear.x):void 0,y:b(L.linear.y||0)?I(i.particleSystemId,L.linear.y):void 0,z:b(L.linear.z||0)?I(i.particleSystemId,L.linear.z):void 0}}))),i.orbitalVelocityData=Array.from({length:z},(()=>({speed:new y.Vector3(L.orbital.x?O(i.particleSystemId,L.orbital.x,0):0,L.orbital.y?O(i.particleSystemId,L.orbital.y,0):0,L.orbital.z?O(i.particleSystemId,L.orbital.z,0):0),valueModifiers:{x:b(L.orbital.x||0)?I(i.particleSystemId,L.orbital.x):void 0,y:b(L.orbital.y||0)?I(i.particleSystemId,L.orbital.y):void 0,z:b(L.orbital.z||0)?I(i.particleSystemId,L.orbital.z):void 0},positionOffset:new y.Vector3}))));["startSize","startOpacity"].forEach((t=>{i.startValues[t]=Array.from({length:z},(()=>O(i.particleSystemId,a[t],0)))}));["rotationOverLifetime"].forEach((t=>{const e=a[t];e.isActive&&(i.lifetimeValues[t]=Array.from({length:z},(()=>y.MathUtils.randFloat(e.min,e.max))))})),i.noise={isActive:C.isActive,strength:C.strength,positionAmount:C.positionAmount,rotationAmount:C.rotationAmount,sizeAmount:C.sizeAmount,sampler:C.isActive?new B({seed:Math.random(),scale:C.frequency,octaves:C.octaves}):void 0,offsets:C.useRandomOffset?Array.from({length:z},(()=>100*Math.random())):void 0};const j=new y.ShaderMaterial({uniforms:{elapsed:{value:0},map:{value:n},tiles:{value:U.tiles},fps:{value:U.fps},useFPSForFrameIndex:{value:"FPS"===U.timeMode},backgroundColor:{value:_.backgroundColor},discardBackgroundColor:{value:_.discardBackgroundColor},backgroundColorTolerance:{value:_.backgroundColorTolerance}},vertexShader:"\n attribute float size;\n attribute float colorR;\n attribute float colorG;\n attribute float colorB;\n attribute float colorA;\n attribute float lifetime;\n attribute float startLifetime;\n attribute float rotation;\n attribute float startFrame;\n\n varying mat4 vPosition;\n varying vec4 vColor;\n varying float vLifetime;\n varying float vStartLifetime;\n varying float vRotation;\n varying float vStartFrame;\n\n void main()\n {\n vColor = vec4(colorR, colorG, colorB, colorA);\n vLifetime = lifetime;\n vStartLifetime = startLifetime;\n vRotation = rotation;\n vStartFrame = startFrame;\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = size * (100.0 / length(mvPosition.xyz));\n gl_Position = projectionMatrix * mvPosition;\n }\n",fragmentShader:"\n uniform sampler2D map;\n uniform float elapsed;\n uniform float fps;\n uniform bool useFPSForFrameIndex;\n uniform vec2 tiles;\n uniform bool discardBackgroundColor;\n uniform vec3 backgroundColor;\n uniform float backgroundColorTolerance;\n\n varying vec4 vColor;\n varying float vLifetime;\n varying float vStartLifetime;\n varying float vRotation;\n varying float vStartFrame;\n\n void main()\n {\n gl_FragColor = vColor;\n float mid = 0.5;\n\n float frameIndex = round(vStartFrame) + (\n useFPSForFrameIndex == true\n ? fps == 0.0\n ? 0.0\n : max((vLifetime / 1000.0) * fps, 0.0)\n : max(min(floor(min(vLifetime / vStartLifetime, 1.0) * (tiles.x * tiles.y)), tiles.x * tiles.y - 1.0), 0.0)\n );\n \n float spriteXIndex = floor(mod(frameIndex, tiles.x));\n float spriteYIndex = floor(mod(frameIndex / tiles.x, tiles.y));\n\n vec2 frameUV = vec2(\n gl_PointCoord.x / tiles.x + spriteXIndex / tiles.x,\n gl_PointCoord.y / tiles.y + spriteYIndex / tiles.y);\n\n vec2 center = vec2(0.5, 0.5);\n vec2 centeredPoint = gl_PointCoord - center;\n\n mat2 rotation = mat2(\n cos(vRotation), sin(vRotation),\n -sin(vRotation), cos(vRotation)\n );\n\n centeredPoint = rotation * centeredPoint;\n vec2 centeredMiddlePoint = vec2(\n centeredPoint.x + center.x,\n centeredPoint.y + center.y\n );\n\n float dist = distance(centeredMiddlePoint, center);\n if (dist > 0.5) discard;\n\n vec2 uvPoint = vec2(\n centeredMiddlePoint.x / tiles.x + spriteXIndex / tiles.x,\n centeredMiddlePoint.y / tiles.y + spriteYIndex / tiles.y\n );\n\n vec4 rotatedTexture = texture2D(map, uvPoint);\n\n gl_FragColor = gl_FragColor * rotatedTexture;\n\n if (discardBackgroundColor && abs(length(rotatedTexture.rgb - backgroundColor.rgb)) < backgroundColorTolerance ) discard;\n }\n",transparent:_.transparent,blending:_.blending,depthTest:_.depthTest,depthWrite:_.depthWrite}),G=new y.BufferGeometry;for(let t=0;t<z;t++)k(i,S,m,Q[t],W[t]);G.setFromPoints(Array.from({length:z},((t,e)=>Q[e].clone())));const H=(t,e)=>{(({geometry:t,propertyName:e,maxParticles:r,factory:i})=>{t.setAttribute(e,new y.BufferAttribute(new Float32Array(Array.from({length:r},"function"==typeof i?i:()=>i)),1))})({geometry:G,propertyName:t,maxParticles:z,factory:e})};H("isActive",0),H("lifetime",0),H("startLifetime",(()=>1e3*O(i.particleSystemId,u,0))),H("startFrame",(()=>U.startFrame?O(i.particleSystemId,U.startFrame,0):0)),H("opacity",(()=>O(i.particleSystemId,h,0))),H("rotation",(()=>O(i.particleSystemId,f,0))),H("size",((t,e)=>i.startValues.startSize[e])),H("rotation",0);const q=Math.random();H("colorR",(()=>v.min.r+q*(v.max.r-v.min.r))),H("colorG",(()=>v.min.g+q*(v.max.g-v.min.g))),H("colorB",(()=>v.min.b+q*(v.max.b-v.min.b))),H("colorA",0);let $=new y.Points(G,j);$.position.copy(o.position),$.rotation.x=y.MathUtils.degToRad(o.rotation.x),$.rotation.y=y.MathUtils.degToRad(o.rotation.y),$.rotation.z=y.MathUtils.degToRad(o.rotation.z),$.scale.copy(o.scale);const Y=r+1e3*O(i.particleSystemId,d);let X;"WORLD"===a.simulationSpace&&(X=new T,X.add($)),N.push({particleSystem:$,wrapper:X,generalData:i,onUpdate:V,onComplete:E,creationTime:Y,lastEmissionTime:Y,duration:s,looping:c,simulationSpace:M,gravity:g,emission:A,normalizedConfig:a,iterationCount:0,velocities:W,deactivateParticle:t=>{G.attributes.isActive.array[t]=0,G.attributes.colorA.array[t]=0,G.attributes.colorA.needsUpdate=!0},activateParticle:({particleIndex:t,activationTime:e,position:r})=>{G.attributes.isActive.array[t]=1,i.creationTimes[t]=e,i.noise.offsets&&(i.noise.offsets[t]=100*Math.random());const n=Math.random();G.attributes.colorR.array[t]=v.min.r+n*(v.max.r-v.min.r),G.attributes.colorR.needsUpdate=!0,G.attributes.colorG.array[t]=v.min.g+n*(v.max.g-v.min.g),G.attributes.colorG.needsUpdate=!0,G.attributes.colorB.array[t]=v.min.b+n*(v.max.b-v.min.b),G.attributes.colorB.needsUpdate=!0,G.attributes.startFrame.array[t]=U.startFrame?O(i.particleSystemId,U.startFrame,0):0,G.attributes.startFrame.needsUpdate=!0,G.attributes.startLifetime.array[t]=1e3*O(i.particleSystemId,u,i.normalizedLifetimePercentage),G.attributes.startLifetime.needsUpdate=!0,i.startValues.startSize[t]=O(i.particleSystemId,p,i.normalizedLifetimePercentage),G.attributes.size.array[t]=i.startValues.startSize[t],G.attributes.size.needsUpdate=!0,i.startValues.startOpacity[t]=O(i.particleSystemId,h,i.normalizedLifetimePercentage),G.attributes.colorA.array[t]=i.startValues.startOpacity[t],G.attributes.colorA.needsUpdate=!0,G.attributes.rotation.array[t]=O(i.particleSystemId,f,i.normalizedLifetimePercentage),G.attributes.rotation.needsUpdate=!0,a.rotationOverLifetime.isActive&&(i.lifetimeValues.rotationOverLifetime[t]=y.MathUtils.randFloat(a.rotationOverLifetime.min,a.rotationOverLifetime.max)),k(i,S,m,Q[t],W[t]);const o=Math.floor(3*t);G.attributes.position.array[o]=r.x+Q[t].x,G.attributes.position.array[o+1]=r.y+Q[t].y,G.attributes.position.array[o+2]=r.z+Q[t].z,G.attributes.position.needsUpdate=!0,i.linearVelocityData&&i.linearVelocityData[t].speed.set(a.velocityOverLifetime.linear.x?O(i.particleSystemId,a.velocityOverLifetime.linear.x,0):0,a.velocityOverLifetime.linear.y?O(i.particleSystemId,a.velocityOverLifetime.linear.y,0):0,a.velocityOverLifetime.linear.z?O(i.particleSystemId,a.velocityOverLifetime.linear.z,0):0),i.orbitalVelocityData&&(i.orbitalVelocityData[t].speed.set(a.velocityOverLifetime.orbital.x?O(i.particleSystemId,a.velocityOverLifetime.orbital.x,0):0,a.velocityOverLifetime.orbital.y?O(i.particleSystemId,a.velocityOverLifetime.orbital.y,0):0,a.velocityOverLifetime.orbital.z?O(i.particleSystemId,a.velocityOverLifetime.orbital.z,0):0),i.orbitalVelocityData[t].positionOffset.set(Q[t].x,Q[t].y,Q[t].z)),G.attributes.lifetime.array[t]=0,G.attributes.lifetime.needsUpdate=!0,P({delta:0,generalData:i,normalizedConfig:a,attributes:$.geometry.attributes,particleLifetimePercentage:0,particleIndex:t})}});return{instance:X||$,resumeEmitter:()=>i.isEnabled=!0,pauseEmitter:()=>i.isEnabled=!1,dispose:()=>(t=>{N=N.filter((({particleSystem:e,wrapper:r,generalData:{particleSystemId:i}})=>e!==t&&r!==t||(l(i),e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach((t=>t.dispose())):e.material.dispose(),e.parent&&e.parent.remove(e),!1)))})($)}},j=({now:t,delta:e,elapsed:r})=>{N.forEach((i=>{const{onUpdate:a,generalData:n,onComplete:o,particleSystem:s,wrapper:l,creationTime:c,lastEmissionTime:d,duration:u,looping:m,emission:p,normalizedConfig:f,iterationCount:v,velocities:h,deactivateParticle:g,activateParticle:x,simulationSpace:b,gravity:I}=i,M=t-c,z=M%(1e3*u);n.normalizedLifetimePercentage=Math.max(Math.min(z/(1e3*u),1),0);const{lastWorldPosition:w,currentWorldPosition:A,worldPositionChange:S,lastWorldQuaternion:_,worldQuaternion:C,worldEuler:L,gravityVelocity:V,isEnabled:T}=n;l?.parent&&n.wrapperQuaternion.copy(l.parent.quaternion);const E={...w};if(Array.isArray(s.material)?s.material.forEach((t=>{t instanceof y.ShaderMaterial&&(t.uniforms.elapsed.value=r)})):s.material instanceof y.ShaderMaterial&&(s.material.uniforms.elapsed.value=r),s.getWorldPosition(A),-99999!==w.x&&S.set(A.x-w.x,A.y-w.y,A.z-w.z),n.distanceFromLastEmitByDistance+=S.length(),s.getWorldPosition(w),s.getWorldQuaternion(C),-99999!==_.x&&_.x===C.x&&_.y===C.y&&_.z===C.z||(L.setFromQuaternion(C),_.copy(C),V.set(w.x,w.y+I,w.z),s.worldToLocal(V)),n.creationTimes.forEach(((r,i)=>{if(s.geometry.attributes.isActive.array[i]){const a=t-r;if(a>s.geometry.attributes.startLifetime.array[i])g(i);else{const t=h[i];if(t.x-=V.x*e,t.y-=V.y*e,t.z-=V.z*e,0!==I||0!==t.x||0!==t.y||0!==t.z||0!==S.x||0!==S.y||0!==S.z){const r=3*i,a=s.geometry.attributes.position.array;"WORLD"===b&&(a[r]-=S.x,a[r+1]-=S.y,a[r+2]-=S.z),a[r]+=t.x*e,a[r+1]+=t.y*e,a[r+2]+=t.z*e,s.geometry.attributes.position.needsUpdate=!0}s.geometry.attributes.lifetime.array[i]=a,s.geometry.attributes.lifetime.needsUpdate=!0;const r=a/s.geometry.attributes.startLifetime.array[i];P({delta:e,generalData:n,normalizedConfig:f,attributes:s.geometry.attributes,particleLifetimePercentage:r,particleIndex:i})}}})),T&&(m||M<1e3*u)){const o=t-d,l=p.rateOverTime?Math.floor(O(n.particleSystemId,p.rateOverTime,n.normalizedLifetimePercentage)*(o/1e3)):0,c=p.rateOverDistance?O(n.particleSystemId,p.rateOverDistance,n.normalizedLifetimePercentage):0,u=c>0&&n.distanceFromLastEmitByDistance>0?Math.floor(n.distanceFromLastEmitByDistance/(1/c)):0,m=u>0?{x:(A.x-E.x)/u,y:(A.y-E.y)/u,z:(A.z-E.z)/u}:null,y=l+u;if(c>0&&u>=1&&(n.distanceFromLastEmitByDistance=0),y>0){let e=0;for(let r=0;r<y;r++){let r=-1;if(s.geometry.attributes.isActive.array.find(((t,e)=>!t&&(r=e,!0))),-1!==r&&r<s.geometry.attributes.isActive.array.length){let a={x:0,y:0,z:0};m&&e<u&&(a={x:m.x*e,y:m.y*e,z:m.z*e},e++),x({particleIndex:r,activationTime:t,position:a}),i.lastEmissionTime=t}}}a&&a({particleSystem:s,delta:e,elapsed:r,lifetime:M,normalizedLifetime:z,iterationCount:v+1})}else o&&o({particleSystem:s})}))};var G=a.pB,H=a.U_,q=a.rU,$=a.M4,Y=a.$H,X=a.hp,J=a.l$,K=a.Y$,Z=a.Tt,tt=a.JP,et=a.eL,rt=a.Hc,it=a.Ao,at=a.iy,nt=a.Px,ot=a.rJ,st=a.Pj,lt=a.YR;export{G as applyModifiers,H as blendingMap,q as calculateRandomPositionAndVelocityOnBox,$ as calculateRandomPositionAndVelocityOnCircle,Y as calculateRandomPositionAndVelocityOnCone,X as calculateRandomPositionAndVelocityOnRectangle,J as calculateRandomPositionAndVelocityOnSphere,K as calculateValue,Z as createBezierCurveFunction,tt as createDefaultParticleTexture,et as createParticleSystem,rt as getBezierCacheSize,it as getCurveFunction,at as getCurveFunctionFromConfig,nt as getDefaultParticleSystemConfig,ot as isLifeTimeCurve,st as removeBezierCurveFunction,lt as updateParticleSystems};
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@newkrok/three-particles",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "description": "Three.js-based high-performance particle system library designed for creating visually stunning particle effects with ease. Perfect for game developers and 3D applications.",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
8
- "types": "dist/three-particles.d.ts",
8
+ "types": "./dist/index.d.ts",
9
9
  "files": [
10
10
  "dist/",
11
11
  "README.md",
@@ -44,15 +44,16 @@
44
44
  },
45
45
  "homepage": "https://github.com/NewKrok/three-particles#readme",
46
46
  "scripts": {
47
- "build": "rmdir /s /q dist && tsc && webpack --config webpack.config.js",
47
+ "build": "rimraf dist && tsc && webpack --config webpack.config.js",
48
48
  "prepublishOnly": "npm run build",
49
49
  "test": "jest",
50
50
  "test:watch": "jest --watch",
51
- "lint": "eslint src"
51
+ "lint": "eslint src",
52
+ "prepare": "husky"
52
53
  },
53
54
  "dependencies": {
54
55
  "@newkrok/three-utils": "^1.0.0",
55
- "easing-functions": "1.0.1",
56
+ "easing-functions": "1.3.0",
56
57
  "three-noise": "1.1.2"
57
58
  },
58
59
  "peerDependencies": {
@@ -61,6 +62,8 @@
61
62
  "devDependencies": {
62
63
  "@babel/preset-env": "^7.26.0",
63
64
  "@babel/preset-typescript": "^7.26.0",
65
+ "@commitlint/cli": "^19.8.0",
66
+ "@commitlint/config-conventional": "^19.8.0",
64
67
  "@types/jest": "^29.5.14",
65
68
  "@types/node": "^22.10.4",
66
69
  "@types/three": "^0.175.0",
@@ -71,17 +74,19 @@
71
74
  "eslint-config-prettier": "^10.0.1",
72
75
  "eslint-plugin-import": "^2.31.0",
73
76
  "eslint-plugin-prettier": "^5.2.3",
77
+ "husky": "^9.1.7",
74
78
  "jest": "^29.7.0",
75
79
  "madge": "^8.0.0",
76
80
  "prettier": "^3.4.2",
81
+ "rimraf": "^6.0.1",
77
82
  "terser-webpack-plugin": "^5.3.11",
78
83
  "ts-jest": "^29.2.5",
79
84
  "ts-loader": "^9.5.2",
80
85
  "ts-node": "^10.9.2",
81
- "typedoc": "^0.27.6",
86
+ "typedoc": "^0.28.1",
82
87
  "typescript": "^5.7.3",
83
88
  "webpack": "^5.97.1",
84
89
  "webpack-bundle-analyzer": "^4.10.2",
85
90
  "webpack-cli": "^6.0.1"
86
91
  }
87
- }
92
+ }