custom-pixi-particles 5.2.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +119 -82
  2. package/package.json +5 -5
  3. package/dist/index.d.ts +0 -11
  4. package/dist/index.js +0 -28
  5. package/dist/index.js.map +0 -1
  6. package/dist/lib/Model.d.ts +0 -32
  7. package/dist/lib/Model.js +0 -44
  8. package/dist/lib/Model.js.map +0 -1
  9. package/dist/lib/Particle.d.ts +0 -220
  10. package/dist/lib/Particle.js +0 -172
  11. package/dist/lib/Particle.js.map +0 -1
  12. package/dist/lib/ParticlePool.d.ts +0 -37
  13. package/dist/lib/ParticlePool.js +0 -56
  14. package/dist/lib/ParticlePool.js.map +0 -1
  15. package/dist/lib/behaviour/AngularVelocityBehaviour.d.ts +0 -57
  16. package/dist/lib/behaviour/AngularVelocityBehaviour.js +0 -87
  17. package/dist/lib/behaviour/AngularVelocityBehaviour.js.map +0 -1
  18. package/dist/lib/behaviour/Behaviour.d.ts +0 -33
  19. package/dist/lib/behaviour/Behaviour.js +0 -45
  20. package/dist/lib/behaviour/Behaviour.js.map +0 -1
  21. package/dist/lib/behaviour/BehaviourNames.d.ts +0 -11
  22. package/dist/lib/behaviour/BehaviourNames.js +0 -11
  23. package/dist/lib/behaviour/BehaviourNames.js.map +0 -1
  24. package/dist/lib/behaviour/ColorBehaviour.d.ts +0 -45
  25. package/dist/lib/behaviour/ColorBehaviour.js +0 -77
  26. package/dist/lib/behaviour/ColorBehaviour.js.map +0 -1
  27. package/dist/lib/behaviour/EmitDirectionBehaviour.d.ts +0 -46
  28. package/dist/lib/behaviour/EmitDirectionBehaviour.js +0 -64
  29. package/dist/lib/behaviour/EmitDirectionBehaviour.js.map +0 -1
  30. package/dist/lib/behaviour/EmitterBehaviours.d.ts +0 -63
  31. package/dist/lib/behaviour/EmitterBehaviours.js +0 -105
  32. package/dist/lib/behaviour/EmitterBehaviours.js.map +0 -1
  33. package/dist/lib/behaviour/LifeBehaviour.d.ts +0 -67
  34. package/dist/lib/behaviour/LifeBehaviour.js +0 -85
  35. package/dist/lib/behaviour/LifeBehaviour.js.map +0 -1
  36. package/dist/lib/behaviour/PositionBehaviour.d.ts +0 -177
  37. package/dist/lib/behaviour/PositionBehaviour.js +0 -534
  38. package/dist/lib/behaviour/PositionBehaviour.js.map +0 -1
  39. package/dist/lib/behaviour/RotationBehaviour.d.ts +0 -51
  40. package/dist/lib/behaviour/RotationBehaviour.js +0 -66
  41. package/dist/lib/behaviour/RotationBehaviour.js.map +0 -1
  42. package/dist/lib/behaviour/SizeBehaviour.d.ts +0 -31
  43. package/dist/lib/behaviour/SizeBehaviour.js +0 -71
  44. package/dist/lib/behaviour/SizeBehaviour.js.map +0 -1
  45. package/dist/lib/behaviour/TurbulenceBehaviour.d.ts +0 -72
  46. package/dist/lib/behaviour/TurbulenceBehaviour.js +0 -128
  47. package/dist/lib/behaviour/TurbulenceBehaviour.js.map +0 -1
  48. package/dist/lib/behaviour/index.d.ts +0 -12
  49. package/dist/lib/behaviour/index.js +0 -13
  50. package/dist/lib/behaviour/index.js.map +0 -1
  51. package/dist/lib/customPixiParticlesSettingsInterface.d.ts +0 -18
  52. package/dist/lib/customPixiParticlesSettingsInterface.js +0 -2
  53. package/dist/lib/customPixiParticlesSettingsInterface.js.map +0 -1
  54. package/dist/lib/emission/AbstractEmission.d.ts +0 -30
  55. package/dist/lib/emission/AbstractEmission.js +0 -39
  56. package/dist/lib/emission/AbstractEmission.js.map +0 -1
  57. package/dist/lib/emission/EmissionTypes.d.ts +0 -6
  58. package/dist/lib/emission/EmissionTypes.js +0 -6
  59. package/dist/lib/emission/EmissionTypes.js.map +0 -1
  60. package/dist/lib/emission/RandomEmission.d.ts +0 -44
  61. package/dist/lib/emission/RandomEmission.js +0 -66
  62. package/dist/lib/emission/RandomEmission.js.map +0 -1
  63. package/dist/lib/emission/StandardEmission.d.ts +0 -62
  64. package/dist/lib/emission/StandardEmission.js +0 -87
  65. package/dist/lib/emission/StandardEmission.js.map +0 -1
  66. package/dist/lib/emission/UniformEmission.d.ts +0 -56
  67. package/dist/lib/emission/UniformEmission.js +0 -83
  68. package/dist/lib/emission/UniformEmission.js.map +0 -1
  69. package/dist/lib/emission/index.d.ts +0 -6
  70. package/dist/lib/emission/index.js +0 -7
  71. package/dist/lib/emission/index.js.map +0 -1
  72. package/dist/lib/emitter/Duration.d.ts +0 -27
  73. package/dist/lib/emitter/Duration.js +0 -41
  74. package/dist/lib/emitter/Duration.js.map +0 -1
  75. package/dist/lib/emitter/Emitter.d.ts +0 -113
  76. package/dist/lib/emitter/Emitter.js +0 -201
  77. package/dist/lib/emitter/Emitter.js.map +0 -1
  78. package/dist/lib/emitter/index.d.ts +0 -3
  79. package/dist/lib/emitter/index.js +0 -4
  80. package/dist/lib/emitter/index.js.map +0 -1
  81. package/dist/lib/index.d.ts +0 -20
  82. package/dist/lib/index.js +0 -21
  83. package/dist/lib/index.js.map +0 -1
  84. package/dist/lib/parser/BehaviourParser.d.ts +0 -21
  85. package/dist/lib/parser/BehaviourParser.js +0 -72
  86. package/dist/lib/parser/BehaviourParser.js.map +0 -1
  87. package/dist/lib/parser/CompatibilityHelper.d.ts +0 -12
  88. package/dist/lib/parser/CompatibilityHelper.js +0 -19
  89. package/dist/lib/parser/CompatibilityHelper.js.map +0 -1
  90. package/dist/lib/parser/EmitControllerParser.d.ts +0 -27
  91. package/dist/lib/parser/EmitControllerParser.js +0 -39
  92. package/dist/lib/parser/EmitControllerParser.js.map +0 -1
  93. package/dist/lib/parser/EmitterParser.d.ts +0 -67
  94. package/dist/lib/parser/EmitterParser.js +0 -168
  95. package/dist/lib/parser/EmitterParser.js.map +0 -1
  96. package/dist/lib/parser/index.d.ts +0 -5
  97. package/dist/lib/parser/index.js +0 -6
  98. package/dist/lib/parser/index.js.map +0 -1
  99. package/dist/lib/pixi/Renderer.d.ts +0 -116
  100. package/dist/lib/pixi/Renderer.js +0 -508
  101. package/dist/lib/pixi/Renderer.js.map +0 -1
  102. package/dist/lib/util/Color.d.ts +0 -133
  103. package/dist/lib/util/Color.js +0 -173
  104. package/dist/lib/util/Color.js.map +0 -1
  105. package/dist/lib/util/List.d.ts +0 -49
  106. package/dist/lib/util/List.js +0 -87
  107. package/dist/lib/util/List.js.map +0 -1
  108. package/dist/lib/util/MinMax.d.ts +0 -34
  109. package/dist/lib/util/MinMax.js +0 -46
  110. package/dist/lib/util/MinMax.js.map +0 -1
  111. package/dist/lib/util/Point.d.ts +0 -34
  112. package/dist/lib/util/Point.js +0 -46
  113. package/dist/lib/util/Point.js.map +0 -1
  114. package/dist/lib/util/Random.d.ts +0 -24
  115. package/dist/lib/util/Random.js +0 -30
  116. package/dist/lib/util/Random.js.map +0 -1
  117. package/dist/lib/util/ThereBack.d.ts +0 -14
  118. package/dist/lib/util/ThereBack.js +0 -23
  119. package/dist/lib/util/ThereBack.js.map +0 -1
  120. package/dist/lib/util/index.d.ts +0 -5
  121. package/dist/lib/util/index.js +0 -6
  122. package/dist/lib/util/index.js.map +0 -1
  123. package/dist/lib/util/maths.d.ts +0 -10
  124. package/dist/lib/util/maths.js +0 -13
  125. package/dist/lib/util/maths.js.map +0 -1
  126. package/dist/lib/util/turbulencePool.d.ts +0 -4
  127. package/dist/lib/util/turbulencePool.js +0 -7
  128. package/dist/lib/util/turbulencePool.js.map +0 -1
package/README.md CHANGED
@@ -1,126 +1,163 @@
1
1
  # CustomPIXIParticles by [@lukasz-okuniewicz](http://github.com/lukasz-okuniewicz)
2
2
 
3
- CustomPIXIParticles is a lightweight and flexible library for creating and managing particle effects in PIXI.js applications. It provides a simple API for defining particle emitters, textures, and configurations, allowing developers to create a wide range of visual effects with ease.
3
+ **CustomPIXIParticles** is a lightweight, high-performance library designed for creating and managing customizable particle effects in **PIXI.js** applications. It offers an intuitive API, flexible configuration options, and seamless compatibility with modern PIXI.js versions, making it an essential tool for developers looking to create stunning visual effects.
4
4
 
5
- ### Features
6
- * Easy-to-use API: Create particle emitters with just a few lines of code
7
- * Flexible configuration: Customize particle behavior, appearance, and animation
8
- * High performance: Render particles efficiently without impacting application performance
9
- * Compatible with PIXI.js v7: Works seamlessly with the latest version of PIXI.js
5
+ ---
10
6
 
11
- ### Versions Compatibility
7
+ ### Support My Work
8
+ If you find **CustomPIXIParticles** useful and would like to support my work, you can buy me a coffee. Your contributions help me dedicate more time to improving this library and creating new features for the community. Thank you for your support! ☕💖
12
9
 
13
- | PixiJS | CustomPIXIParticles |
14
- |---|---|
15
- | v5.x - v6.x | v4.x |
16
- | v7.x | v5.x |
10
+ [![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Support%20My%20Work-orange?logo=buy-me-a-coffee&logoColor=white)](https://buymeacoffee.com/lukasz.okuniewicz)
17
11
 
18
- ### Demo
19
- [custom-pixi-particles](http://particles.okuniewicz.eu/)
12
+ ---
20
13
 
21
- #### Installation:
14
+ ## ✨ Features
15
+ - **Simple API**: Effortlessly create particle emitters with minimal code.
16
+ - **Highly Configurable**: Adjust particle behavior, appearance, animation, and more.
17
+ - **Performance Optimized**: Handle thousands of particles with minimal performance overhead.
18
+ - **PIXI.js Compatibility**: Fully compatible with **PIXI.js v7**, with legacy support for v5.x and v6.x.
19
+ - **Real-Time Customization**: Dynamically update textures, positions, configurations, and emitters on the fly.
22
20
 
23
- ```
21
+ ---
22
+
23
+ ## 🎮 Demo
24
+ Try it out here: [CustomPIXIParticles Live Editor](https://okuniewicz.eu/)
25
+
26
+ ---
27
+
28
+ ## 🛠️ Installation
29
+
30
+ Install via npm:
31
+
32
+ ```bash
24
33
  npm install custom-pixi-particles
25
34
  ```
26
35
 
27
- #### Usage:
28
- Import or require the library:
36
+ ---
37
+
38
+ ## 🚀 Quick Start
39
+ Import or Require
29
40
  ```javascript
30
- const customPixiParticles = require('custom-pixi-particles')
31
- // or
41
+ // ES6 Modules
32
42
  import customPixiParticles from 'custom-pixi-particles'
43
+
44
+ // CommonJS
45
+ const customPixiParticles = require('custom-pixi-particles')
33
46
  ```
34
47
 
48
+ Create Particle Effects
35
49
  ```javascript
36
- // Define array of textures
50
+ // Define textures and emitter configuration
37
51
  const textures = ['texture1.png', 'texture2.png']
38
- // Define generated emiter config
39
- const emitterConfig = {...}
40
- // Create particles
41
- this.particles = customParticles.create({ textures, emitterConfig })
42
- // Start to play
43
- this.particles.play()
44
- // Add particles to PIXI container
45
- container.addChild(this.particles)
52
+ const emitterConfig = {
53
+ // Your configuration object
54
+ }
55
+
56
+ // Initialize particle emitter
57
+ const particles = customPixiParticles.create({ textures, emitterConfig })
58
+
59
+ // Add emitter to the PIXI container
60
+ container.addChild(particles)
61
+
62
+ // Start the emitter
63
+ particles.play()
46
64
  ```
47
65
 
48
- ### API Reference
49
- `create`
66
+ ---
67
+
68
+ ## 📖 API Reference
69
+ Initializes a particle emitter.
50
70
  ```javascript
51
- // All possible params which can be passed during particles creation
52
- this.particles = customPixiParticles.create({
53
- textures: [String],
54
- animatedSpriteZeroPad: Number,
55
- animatedSpriteIndexToStart: Number,
56
- emitterConfig: Object,
57
- finishingTextures: [String],
58
- vertices: Boolean,
59
- position: Boolean,
60
- rotation: Boolean,
61
- uvs: Boolean,
62
- tint: Boolean,
63
- maxParticles: Number,
64
- maxFPS: Number,
65
- tickerSpeed: Number,
71
+ const particles = customPixiParticles.create({
72
+ textures: [String], // Array of particle textures
73
+ emitterConfig: Object, // Configuration object for the emitter
74
+ animatedSpriteZeroPad: Number, // Zero-padding for animated sprite names
75
+ animatedSpriteIndexToStart: Number, // Initial frame index for animated sprites
76
+ finishingTextures: [String], // Textures used for particle finishing
77
+ vertices: Boolean, // Use vertex mode for rendering
78
+ position: Boolean, // Allow position-based behavior
79
+ rotation: Boolean, // Allow rotation-based behavior
80
+ uvs: Boolean, // Apply UV mapping
81
+ tint: Boolean, // Apply tint to particles
82
+ maxParticles: Number, // Maximum particles allowed
83
+ maxFPS: Number, // Cap emitter update frequency
84
+ tickerSpeed: Number, // Speed of the PIXI ticker
66
85
  })
67
86
  ```
68
87
 
88
+ ### Event Callbacks
89
+ Triggered when the particle animation completes.
69
90
  ```javascript
70
- // Callback function called when the particle animation completes.
71
- this.particles.onComplete = () => {
72
- //...
91
+ particles.onComplete = () => {
92
+ console.log("Particle animation finished!")
73
93
  }
74
94
  ```
75
95
 
96
+ ### Texture Management
97
+ Updates the particle emitter's textures.
76
98
  ```javascript
77
- // Define array of new textures
78
- const newTextures = ['texture3.png', 'texture4.png']
79
- // Updates the particle emitter's textures.
80
- this.particles.setTextures(newTextures)
99
+ particles.setTextures(['texture3.png', 'texture4.png'])
81
100
  ```
82
101
 
102
+ ### Configuration Updates
103
+ Dynamically update emitter configurations.
83
104
  ```javascript
84
- // Updates the particle emitter's configuration.
85
- this.particles.updateConfig({
86
- // Update emitter configuration properties
87
- })
105
+ particles.updateConfig({ /* New configuration properties */ })
88
106
  ```
89
107
 
108
+ ### State Control
109
+ Starts or resumes the emitter.
90
110
  ```javascript
91
- // Sets the paused state
92
- pause(isPaused)
93
-
94
- // Starts the emitter
95
- start()
111
+ particles.play()
112
+ ```
113
+ Toggles the paused state.
114
+ ```javascript
115
+ particles.pause(isPaused)
116
+ ```
117
+ Terminates the emitter and stops emission.
118
+ ```javascript
119
+ particles.stop()
120
+ ```
121
+ Halts all emissions immediately.
122
+ ```javascript
123
+ particles.stopImmediately()
124
+ ```
125
+ Resets the emitter to its initial state.
126
+ ```javascript
127
+ particles.resetEmitter()
128
+ ```
96
129
 
97
- // Resets the particle emitters in this class without removing existing particles and plays them
98
- play()
130
+ ### Position Updates
131
+ Dynamically adjust the emitter's position.
132
+ ```javascript
133
+ particles.updatePosition({ x: 100, y: 200 })
134
+ ```
99
135
 
100
- // Immediately stops emitting particles
101
- stopImmediately()
136
+ ### Pool Management
137
+ Clears internal object pools to free memory.
138
+ ```javascript
139
+ particles.clearPool()
140
+ ```
102
141
 
103
- // Destroy particles
104
- destroy()
142
+ ---
105
143
 
106
- // Terminates the emitter
107
- stop()
144
+ ## 🖥️ Versions Compatibility
145
+ | PixiJS | CustomPIXIParticles |
146
+ |-------------|---------------------|
147
+ | v5.x - v6.x | v4.x |
148
+ | v7.x | v7.x |
108
149
 
109
- // Resets the emitters to their initial state
110
- resetEmitter()
150
+ ---
111
151
 
112
- // Update textures used by the emitter
113
- setTextures(textures)
152
+ ## 🛠️ Advanced Editor
153
+ Easily design and fine-tune your particle effects with the CustomPIXIParticles Editor.
154
+ 🔗 [CustomPIXIParticles Live Editor](https://okuniewicz.eu/)
114
155
 
115
- // Updates the configuration of the emitter
116
- updateConfig(config, resetDuration = true)
156
+ ---
117
157
 
118
- // Updates the position of the emitter
119
- updatePosition(position, resetDuration = true)
158
+ ## 🤝 Contributing
159
+ Contributions, feature suggestions, and bug reports are welcome! Open an issue or submit a pull request on the [GitHub repository](https://github.com/lukasz-okuniewicz/custom-pixi-particles).
120
160
 
121
- // Clear pools
122
- clearPool()
123
- ```
161
+ ---
124
162
 
125
- ### Additional Resources
126
- Editor for particles: [custom-pixi-particles-editor](https://github.com/lukasz-okuniewicz/custom-pixi-particles-editor)
163
+ With CustomPIXIParticles, you're not just building animations; you're crafting immersive experiences! 🌟
package/package.json CHANGED
@@ -8,13 +8,13 @@
8
8
  "@types/file-saver": "^2.0.7",
9
9
  "copy-dir": "^1.3.0",
10
10
  "file-saver": "^2.0.5",
11
- "pixi.js": "^7.3.2",
12
- "prettier": "^3.1.0",
11
+ "pixi.js": "^8.6.4",
13
12
  "gsap": "^3.12.5",
14
- "rimraf": "^5.0.5",
13
+ "prettier": "^3.4.2",
14
+ "rimraf": "^6.0.1",
15
15
  "ts-node": "^10.9.2",
16
16
  "tslint": "^6.1.3",
17
- "typescript": "^5.3.3"
17
+ "typescript": "^5.7.2"
18
18
  },
19
19
  "dependencies": {
20
20
  "eventemitter3": "^4.0.7"
@@ -41,5 +41,5 @@
41
41
  "lint": "tslint 'src/**/*.ts'",
42
42
  "lint:fix": "tslint --fix 'src/**/*.ts'"
43
43
  },
44
- "version": "5.2.0"
44
+ "version": "8.0.0"
45
45
  }
package/dist/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import Renderer from './lib/pixi/Renderer';
2
- import { ICustomPixiParticlesSettings } from './lib/customPixiParticlesSettingsInterface';
3
- /**
4
- * Constructs a renderer for custom pixi particles
5
- * @class Renderer
6
- * @param {ICustomPixiParticlesSettings} settings The settings for the renderer
7
- */
8
- declare const customPixiParticles: {
9
- create(settings: ICustomPixiParticlesSettings): Renderer;
10
- };
11
- export { Renderer, customPixiParticles, ICustomPixiParticlesSettings };
package/dist/index.js DELETED
@@ -1,28 +0,0 @@
1
- import Renderer from './lib/pixi/Renderer';
2
- /**
3
- * Constructs a renderer for custom pixi particles
4
- * @class Renderer
5
- * @param {ICustomPixiParticlesSettings} settings The settings for the renderer
6
- */
7
- const customPixiParticles = {
8
- create(settings) {
9
- const { textures, emitterConfig, animatedSpriteZeroPad = 2, animatedSpriteIndexToStart = 0, finishingTextures = [], vertices = true, position = true, rotation = true, uvs = true, tint = true, maxParticles = 10000, maxFPS = 60, tickerSpeed = 0.02, } = settings;
10
- return new Renderer({
11
- textures,
12
- animatedSpriteZeroPad,
13
- animatedSpriteIndexToStart,
14
- emitterConfig,
15
- finishingTextures,
16
- vertices,
17
- position,
18
- rotation,
19
- uvs,
20
- tint,
21
- maxParticles,
22
- maxFPS,
23
- tickerSpeed,
24
- });
25
- },
26
- };
27
- export { Renderer, customPixiParticles };
28
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAG1C;;;;GAIG;AACH,MAAM,mBAAmB,GAAG;IAC1B,MAAM,CAAC,QAAsC;QAC3C,MAAM,EACJ,QAAQ,EACR,aAAa,EACb,qBAAqB,GAAG,CAAC,EACzB,0BAA0B,GAAG,CAAC,EAC9B,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAAG,IAAI,EACf,QAAQ,GAAG,IAAI,EACf,QAAQ,GAAG,IAAI,EACf,GAAG,GAAG,IAAI,EACV,IAAI,GAAG,IAAI,EACX,YAAY,GAAG,KAAK,EACpB,MAAM,GAAG,EAAE,EACX,WAAW,GAAG,IAAI,GACnB,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,QAAQ,CAAC;YAClB,QAAQ;YACR,qBAAqB;YACrB,0BAA0B;YAC1B,aAAa;YACb,iBAAiB;YACjB,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,GAAG;YACH,IAAI;YACJ,YAAY;YACZ,MAAM;YACN,WAAW;SACZ,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAgC,CAAA"}
@@ -1,32 +0,0 @@
1
- export default class Model {
2
- /**
3
- * Boolean value indicating whether warping is enabled
4
- */
5
- warp: boolean;
6
- /**
7
- * The Z position of the camera
8
- */
9
- cameraZ: number;
10
- /**
11
- * The conversion rate for cameraZ
12
- */
13
- cameraZConverter: number;
14
- /**
15
- * The speed of warp
16
- */
17
- warpSpeed: number;
18
- /**
19
- * The base speed of warp
20
- */
21
- warpBaseSpeed: number;
22
- /**
23
- * Update the model with the behaviour object
24
- * @param {Object} behaviour - The behaviour object
25
- */
26
- update(behaviour: any): void;
27
- /**
28
- * Update the camera position based on the delta time
29
- * @param {number} deltaTime - The delta time
30
- */
31
- updateCamera(deltaTime: number): void;
32
- }
package/dist/lib/Model.js DELETED
@@ -1,44 +0,0 @@
1
- export default class Model {
2
- constructor() {
3
- /**
4
- * Boolean value indicating whether warping is enabled
5
- */
6
- this.warp = false;
7
- /**
8
- * The Z position of the camera
9
- */
10
- this.cameraZ = 0;
11
- /**
12
- * The conversion rate for cameraZ
13
- */
14
- this.cameraZConverter = 0;
15
- /**
16
- * The speed of warp
17
- */
18
- this.warpSpeed = 0;
19
- /**
20
- * The base speed of warp
21
- */
22
- this.warpBaseSpeed = 0;
23
- }
24
- /**
25
- * Update the model with the behaviour object
26
- * @param {Object} behaviour - The behaviour object
27
- */
28
- update(behaviour) {
29
- this.warp = behaviour.warp || false;
30
- this.cameraZConverter = behaviour.cameraZConverter;
31
- this.warpSpeed = behaviour.warpSpeed;
32
- this.warpBaseSpeed = behaviour.warpBaseSpeed;
33
- }
34
- /**
35
- * Update the camera position based on the delta time
36
- * @param {number} deltaTime - The delta time
37
- */
38
- updateCamera(deltaTime) {
39
- if (!this.warp)
40
- return;
41
- this.cameraZ += deltaTime * this.cameraZConverter * this.warpSpeed * this.warpBaseSpeed;
42
- }
43
- }
44
- //# sourceMappingURL=Model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/lib/Model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,KAAK;IAA1B;QACE;;WAEG;QACH,SAAI,GAAY,KAAK,CAAA;QAErB;;WAEG;QACH,YAAO,GAAW,CAAC,CAAA;QAEnB;;WAEG;QACH,qBAAgB,GAAW,CAAC,CAAA;QAE5B;;WAEG;QACH,cAAS,GAAW,CAAC,CAAA;QAErB;;WAEG;QACH,kBAAa,GAAW,CAAC,CAAA;IAqB3B,CAAC;IAnBC;;;OAGG;IACH,MAAM,CAAC,SAAc;QACnB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,IAAI,KAAK,CAAA;QACnC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,CAAA;QAClD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAA;QACpC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAA;IAC9C,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,SAAiB;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QACtB,IAAI,CAAC,OAAO,IAAI,SAAS,GAAG,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAA;IACzF,CAAC;CACF"}
@@ -1,220 +0,0 @@
1
- import { Sprite } from 'pixi.js-legacy';
2
- import { Color, Point } from './util';
3
- import ThereBack from './util/ThereBack';
4
- /**
5
- * Represents a particle object used in particle system simulations
6
- */
7
- export default class Particle {
8
- static _UID: {
9
- value: number;
10
- };
11
- next: Particle | null;
12
- prev: Particle | null;
13
- /**
14
- * Stores the unique ID of the particle
15
- */
16
- uid: number;
17
- /**
18
- * Stores the movement of the particle
19
- */
20
- movement: Point;
21
- /**
22
- * Stores the acceleration of the particle
23
- */
24
- acceleration: Point;
25
- /**
26
- * Stores the velocity of the particle
27
- */
28
- velocity: Point;
29
- /**
30
- * Stores the size of the particle
31
- */
32
- size: Point;
33
- /**
34
- * Stores the starting size of the particle
35
- */
36
- sizeStart: Point;
37
- /**
38
- * Stores the starting warp size of the particle
39
- */
40
- warpSizeStart: Point;
41
- /**
42
- * Stores the ending size of the particle
43
- */
44
- sizeEnd: Point;
45
- /**
46
- * Stores the x value of the particle for sin wave
47
- */
48
- sinXVal: Point;
49
- /**
50
- * Stores the y value of the particle for sin wave
51
- */
52
- sinYVal: Point;
53
- /**
54
- * Stores the color of the particle
55
- */
56
- color: Color;
57
- /**
58
- * Stores the starting color of the particle
59
- */
60
- colorStart: Color;
61
- /**
62
- * Stores the ending color of the particle
63
- */
64
- colorEnd: Color;
65
- /**
66
- * Stores the maximum life time of the particle
67
- */
68
- maxLifeTime: number;
69
- /**
70
- * Stores the current life time of the particle
71
- */
72
- lifeTime: number;
73
- /**
74
- * Stores the current life progress of the particle
75
- */
76
- lifeProgress: number;
77
- /**
78
- * Stores the x position of the particle
79
- */
80
- x: number;
81
- /**
82
- * Stores the y position of the particle
83
- */
84
- y: number;
85
- /**
86
- * Stores the z position of the particle
87
- */
88
- z: number;
89
- /**
90
- * Stores the velocity angle of the particle
91
- */
92
- velocityAngle: number;
93
- /**
94
- * Stores the radians per second of the particle
95
- */
96
- radiansPerSecond: number;
97
- /**
98
- * Stores the radius of the particle
99
- */
100
- radius: number;
101
- radiusX: number;
102
- radiusY: number;
103
- /**
104
- * Stores the starting radius of the particle
105
- */
106
- radiusStart: number;
107
- /**
108
- * Stores the ending radius of the particle
109
- */
110
- radiusEnd: number;
111
- /**
112
- * Stores the cosine of the direction of the particle
113
- */
114
- directionCos: number;
115
- /**
116
- * Stores the sine of the direction of the particle
117
- */
118
- directionSin: number;
119
- /**
120
- * Stores the rotation of the particle
121
- */
122
- rotation: number;
123
- /**
124
- * Stores the rotation delta of the particle
125
- */
126
- rotationDelta: number;
127
- /**
128
- * Stores the angle of the particle
129
- */
130
- angle: number;
131
- /**
132
- * Stores the sprite of the particle
133
- */
134
- sprite: Sprite;
135
- /**
136
- * Stores whether the vortices are shown
137
- */
138
- showVortices: boolean;
139
- /**
140
- * Stores whether the turbulence is enabled
141
- */
142
- turbulence: boolean;
143
- /**
144
- * Stores the finishing texture of the particle
145
- */
146
- finishingTexture: number;
147
- /**
148
- * Stores the camera z position of the particle
149
- */
150
- cameraZ: number;
151
- /**
152
- * Stores the camera z position converter of the particle
153
- */
154
- cameraZConverter: number;
155
- /**
156
- * Stores the warp speed of the particle
157
- */
158
- warpSpeed: number;
159
- /**
160
- * Stores the warp base speed of the particle
161
- */
162
- warpBaseSpeed: number;
163
- /**
164
- * Stores the warp field of view of the particle
165
- */
166
- warpFov: number;
167
- /**
168
- * Stores the warp stretch of the particle
169
- */
170
- warpStretch: number;
171
- /**
172
- * Stores the warp distance scale converter of the particle
173
- */
174
- warpDistanceScaleConverter: number;
175
- sizeDifference: {
176
- x: number;
177
- y: number;
178
- };
179
- fromAtoB: boolean;
180
- fromAtoBTwoWays: boolean;
181
- pointA: Point;
182
- pointB: Point;
183
- there: ThereBack;
184
- back: ThereBack;
185
- xStart: number;
186
- yStart: number;
187
- xTarget: number;
188
- yTarget: number;
189
- thereDuration: number;
190
- backDuration: number;
191
- progress: number;
192
- time: number;
193
- thereAmplitude: number;
194
- backAmplitude: number;
195
- direction: number;
196
- /**
197
- * Constructs a particle object
198
- */
199
- constructor();
200
- /**
201
- * Resets the particle object
202
- */
203
- reset(): void;
204
- /**
205
- * Checks if the particle is almost dead
206
- *
207
- * @return {boolean} True if the particle is almost dead, otherwise false
208
- */
209
- isAlmostDead(): boolean;
210
- /**
211
- * Checks if the particle is dead
212
- *
213
- * @return {boolean} True if the particle is dead, otherwise false
214
- */
215
- isDead(): boolean;
216
- /**
217
- * Hides the particle
218
- */
219
- hide(): void;
220
- }