custom-pixi-particles 8.0.1 → 8.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +2 -1
  2. package/package.json +5 -4
  3. package/dist/index.d.ts +0 -15
  4. package/dist/index.js +0 -45
  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 -234
  10. package/dist/lib/Particle.js +0 -201
  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 -61
  16. package/dist/lib/behaviour/AngularVelocityBehaviour.js +0 -118
  17. package/dist/lib/behaviour/AngularVelocityBehaviour.js.map +0 -1
  18. package/dist/lib/behaviour/AttractionRepulsionBehaviour.d.ts +0 -42
  19. package/dist/lib/behaviour/AttractionRepulsionBehaviour.js +0 -78
  20. package/dist/lib/behaviour/AttractionRepulsionBehaviour.js.map +0 -1
  21. package/dist/lib/behaviour/Behaviour.d.ts +0 -33
  22. package/dist/lib/behaviour/Behaviour.js +0 -45
  23. package/dist/lib/behaviour/Behaviour.js.map +0 -1
  24. package/dist/lib/behaviour/BehaviourNames.d.ts +0 -22
  25. package/dist/lib/behaviour/BehaviourNames.js +0 -23
  26. package/dist/lib/behaviour/BehaviourNames.js.map +0 -1
  27. package/dist/lib/behaviour/CollisionBehaviour.d.ts +0 -86
  28. package/dist/lib/behaviour/CollisionBehaviour.js +0 -140
  29. package/dist/lib/behaviour/CollisionBehaviour.js.map +0 -1
  30. package/dist/lib/behaviour/ColorBehaviour.d.ts +0 -67
  31. package/dist/lib/behaviour/ColorBehaviour.js +0 -193
  32. package/dist/lib/behaviour/ColorBehaviour.js.map +0 -1
  33. package/dist/lib/behaviour/EmitDirectionBehaviour.d.ts +0 -52
  34. package/dist/lib/behaviour/EmitDirectionBehaviour.js +0 -105
  35. package/dist/lib/behaviour/EmitDirectionBehaviour.js.map +0 -1
  36. package/dist/lib/behaviour/EmitterBehaviours.d.ts +0 -69
  37. package/dist/lib/behaviour/EmitterBehaviours.js +0 -116
  38. package/dist/lib/behaviour/EmitterBehaviours.js.map +0 -1
  39. package/dist/lib/behaviour/ForceFieldsBehaviour.d.ts +0 -53
  40. package/dist/lib/behaviour/ForceFieldsBehaviour.js +0 -80
  41. package/dist/lib/behaviour/ForceFieldsBehaviour.js.map +0 -1
  42. package/dist/lib/behaviour/GroupingBehaviour.d.ts +0 -57
  43. package/dist/lib/behaviour/GroupingBehaviour.js +0 -143
  44. package/dist/lib/behaviour/GroupingBehaviour.js.map +0 -1
  45. package/dist/lib/behaviour/LifeBehaviour.d.ts +0 -47
  46. package/dist/lib/behaviour/LifeBehaviour.js +0 -65
  47. package/dist/lib/behaviour/LifeBehaviour.js.map +0 -1
  48. package/dist/lib/behaviour/LightEffectBehaviour.d.ts +0 -59
  49. package/dist/lib/behaviour/LightEffectBehaviour.js +0 -94
  50. package/dist/lib/behaviour/LightEffectBehaviour.js.map +0 -1
  51. package/dist/lib/behaviour/NoiseBasedMotionBehaviour.d.ts +0 -35
  52. package/dist/lib/behaviour/NoiseBasedMotionBehaviour.js +0 -93
  53. package/dist/lib/behaviour/NoiseBasedMotionBehaviour.js.map +0 -1
  54. package/dist/lib/behaviour/PositionBehaviour.d.ts +0 -164
  55. package/dist/lib/behaviour/PositionBehaviour.js +0 -484
  56. package/dist/lib/behaviour/PositionBehaviour.js.map +0 -1
  57. package/dist/lib/behaviour/RotationBehaviour.d.ts +0 -59
  58. package/dist/lib/behaviour/RotationBehaviour.js +0 -100
  59. package/dist/lib/behaviour/RotationBehaviour.js.map +0 -1
  60. package/dist/lib/behaviour/SizeBehaviour.d.ts +0 -61
  61. package/dist/lib/behaviour/SizeBehaviour.js +0 -156
  62. package/dist/lib/behaviour/SizeBehaviour.js.map +0 -1
  63. package/dist/lib/behaviour/SoundReactiveBehaviour.d.ts +0 -58
  64. package/dist/lib/behaviour/SoundReactiveBehaviour.js +0 -132
  65. package/dist/lib/behaviour/SoundReactiveBehaviour.js.map +0 -1
  66. package/dist/lib/behaviour/SpawnBehaviour.d.ts +0 -89
  67. package/dist/lib/behaviour/SpawnBehaviour.js +0 -705
  68. package/dist/lib/behaviour/SpawnBehaviour.js.map +0 -1
  69. package/dist/lib/behaviour/StretchBehaviour.d.ts +0 -30
  70. package/dist/lib/behaviour/StretchBehaviour.js +0 -59
  71. package/dist/lib/behaviour/StretchBehaviour.js.map +0 -1
  72. package/dist/lib/behaviour/TemperatureBehaviour.d.ts +0 -47
  73. package/dist/lib/behaviour/TemperatureBehaviour.js +0 -64
  74. package/dist/lib/behaviour/TemperatureBehaviour.js.map +0 -1
  75. package/dist/lib/behaviour/TimelineBehaviour.d.ts +0 -73
  76. package/dist/lib/behaviour/TimelineBehaviour.js +0 -100
  77. package/dist/lib/behaviour/TimelineBehaviour.js.map +0 -1
  78. package/dist/lib/behaviour/TurbulenceBehaviour.d.ts +0 -73
  79. package/dist/lib/behaviour/TurbulenceBehaviour.js +0 -133
  80. package/dist/lib/behaviour/TurbulenceBehaviour.js.map +0 -1
  81. package/dist/lib/behaviour/index.d.ts +0 -23
  82. package/dist/lib/behaviour/index.js +0 -24
  83. package/dist/lib/behaviour/index.js.map +0 -1
  84. package/dist/lib/customPixiParticlesSettingsInterface.d.ts +0 -19
  85. package/dist/lib/customPixiParticlesSettingsInterface.js +0 -2
  86. package/dist/lib/customPixiParticlesSettingsInterface.js.map +0 -1
  87. package/dist/lib/emission/AbstractEmission.d.ts +0 -30
  88. package/dist/lib/emission/AbstractEmission.js +0 -39
  89. package/dist/lib/emission/AbstractEmission.js.map +0 -1
  90. package/dist/lib/emission/EmissionTypes.d.ts +0 -6
  91. package/dist/lib/emission/EmissionTypes.js +0 -6
  92. package/dist/lib/emission/EmissionTypes.js.map +0 -1
  93. package/dist/lib/emission/RandomEmission.d.ts +0 -44
  94. package/dist/lib/emission/RandomEmission.js +0 -66
  95. package/dist/lib/emission/RandomEmission.js.map +0 -1
  96. package/dist/lib/emission/StandardEmission.d.ts +0 -62
  97. package/dist/lib/emission/StandardEmission.js +0 -87
  98. package/dist/lib/emission/StandardEmission.js.map +0 -1
  99. package/dist/lib/emission/UniformEmission.d.ts +0 -56
  100. package/dist/lib/emission/UniformEmission.js +0 -83
  101. package/dist/lib/emission/UniformEmission.js.map +0 -1
  102. package/dist/lib/emission/index.d.ts +0 -6
  103. package/dist/lib/emission/index.js +0 -7
  104. package/dist/lib/emission/index.js.map +0 -1
  105. package/dist/lib/emitter/Duration.d.ts +0 -27
  106. package/dist/lib/emitter/Duration.js +0 -41
  107. package/dist/lib/emitter/Duration.js.map +0 -1
  108. package/dist/lib/emitter/Emitter.d.ts +0 -116
  109. package/dist/lib/emitter/Emitter.js +0 -240
  110. package/dist/lib/emitter/Emitter.js.map +0 -1
  111. package/dist/lib/emitter/index.d.ts +0 -3
  112. package/dist/lib/emitter/index.js +0 -4
  113. package/dist/lib/emitter/index.js.map +0 -1
  114. package/dist/lib/index.d.ts +0 -20
  115. package/dist/lib/index.js +0 -21
  116. package/dist/lib/index.js.map +0 -1
  117. package/dist/lib/parser/BehaviourParser.d.ts +0 -21
  118. package/dist/lib/parser/BehaviourParser.js +0 -72
  119. package/dist/lib/parser/BehaviourParser.js.map +0 -1
  120. package/dist/lib/parser/CompatibilityHelper.d.ts +0 -12
  121. package/dist/lib/parser/CompatibilityHelper.js +0 -19
  122. package/dist/lib/parser/CompatibilityHelper.js.map +0 -1
  123. package/dist/lib/parser/EmitControllerParser.d.ts +0 -27
  124. package/dist/lib/parser/EmitControllerParser.js +0 -39
  125. package/dist/lib/parser/EmitControllerParser.js.map +0 -1
  126. package/dist/lib/parser/EmitterParser.d.ts +0 -67
  127. package/dist/lib/parser/EmitterParser.js +0 -168
  128. package/dist/lib/parser/EmitterParser.js.map +0 -1
  129. package/dist/lib/parser/index.d.ts +0 -5
  130. package/dist/lib/parser/index.js +0 -6
  131. package/dist/lib/parser/index.js.map +0 -1
  132. package/dist/lib/pixi/Renderer.d.ts +0 -125
  133. package/dist/lib/pixi/Renderer.js +0 -560
  134. package/dist/lib/pixi/Renderer.js.map +0 -1
  135. package/dist/lib/pixi/TestRenderer.d.ts +0 -125
  136. package/dist/lib/pixi/TestRenderer.js +0 -560
  137. package/dist/lib/pixi/TestRenderer.js.map +0 -1
  138. package/dist/lib/util/Color.d.ts +0 -133
  139. package/dist/lib/util/Color.js +0 -173
  140. package/dist/lib/util/Color.js.map +0 -1
  141. package/dist/lib/util/List.d.ts +0 -49
  142. package/dist/lib/util/List.js +0 -87
  143. package/dist/lib/util/List.js.map +0 -1
  144. package/dist/lib/util/MinMax.d.ts +0 -34
  145. package/dist/lib/util/MinMax.js +0 -46
  146. package/dist/lib/util/MinMax.js.map +0 -1
  147. package/dist/lib/util/Point.d.ts +0 -34
  148. package/dist/lib/util/Point.js +0 -46
  149. package/dist/lib/util/Point.js.map +0 -1
  150. package/dist/lib/util/Random.d.ts +0 -24
  151. package/dist/lib/util/Random.js +0 -30
  152. package/dist/lib/util/Random.js.map +0 -1
  153. package/dist/lib/util/ThereBack.d.ts +0 -14
  154. package/dist/lib/util/ThereBack.js +0 -23
  155. package/dist/lib/util/ThereBack.js.map +0 -1
  156. package/dist/lib/util/index.d.ts +0 -5
  157. package/dist/lib/util/index.js +0 -6
  158. package/dist/lib/util/index.js.map +0 -1
  159. package/dist/lib/util/maths.d.ts +0 -10
  160. package/dist/lib/util/maths.js +0 -13
  161. package/dist/lib/util/maths.js.map +0 -1
  162. package/dist/lib/util/turbulencePool.d.ts +0 -4
  163. package/dist/lib/util/turbulencePool.js +0 -7
  164. package/dist/lib/util/turbulencePool.js.map +0 -1
package/README.md CHANGED
@@ -15,7 +15,7 @@ If you find **CustomPIXIParticles** useful and would like to support my work, yo
15
15
  - **Simple API**: Effortlessly create particle emitters with minimal code.
16
16
  - **Highly Configurable**: Adjust particle behavior, appearance, animation, and more.
17
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.
18
+ - **PIXI.js Compatibility**: Fully compatible with **PIXI.js v8**, **PIXI.js v7**, with legacy support for v5.x and v6.x.
19
19
  - **Real-Time Customization**: Dynamically update textures, positions, configurations, and emitters on the fly.
20
20
 
21
21
  ---
@@ -146,6 +146,7 @@ particles.clearPool()
146
146
  |-------------|---------------------|
147
147
  | v5.x - v6.x | v4.x |
148
148
  | v7.x | v7.x |
149
+ | v8.x | v8.x |
149
150
 
150
151
  ---
151
152
 
package/package.json CHANGED
@@ -8,8 +8,6 @@
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": "^8.6.4",
12
- "gsap": "^3.12.5",
13
11
  "prettier": "^3.4.2",
14
12
  "rimraf": "^6.0.1",
15
13
  "ts-node": "^10.9.2",
@@ -17,7 +15,10 @@
17
15
  "typescript": "^5.7.2"
18
16
  },
19
17
  "dependencies": {
20
- "eventemitter3": "^4.0.7"
18
+ "gsap": "^3.12.5",
19
+ "eventemitter3": "^4.0.7",
20
+ "pixi.js": "^8.6.6",
21
+ "simplex-noise": "^4.0.3"
21
22
  },
22
23
  "files": [
23
24
  "dist"
@@ -41,5 +42,5 @@
41
42
  "lint": "tslint 'src/**/*.ts'",
42
43
  "lint:fix": "tslint --fix 'src/**/*.ts'"
43
44
  },
44
- "version": "8.0.1"
45
+ "version": "8.1.1"
45
46
  }
package/dist/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import Renderer from './lib/pixi/Renderer';
2
- import { ICustomPixiParticlesSettings } from './lib/customPixiParticlesSettingsInterface';
3
- import TestRenderer from './lib/pixi/TestRenderer';
4
- /**
5
- * Constructs a renderer for custom pixi particles
6
- * @class Renderer
7
- * @param {ICustomPixiParticlesSettings} settings The settings for the renderer
8
- */
9
- declare const customPixiParticles: {
10
- create(settings: ICustomPixiParticlesSettings): Renderer;
11
- };
12
- declare const _customPixiParticlesEditorOnly: {
13
- create(settings: ICustomPixiParticlesSettings): TestRenderer;
14
- };
15
- export { Renderer, customPixiParticles, _customPixiParticlesEditorOnly, ICustomPixiParticlesSettings };
package/dist/index.js DELETED
@@ -1,45 +0,0 @@
1
- import Renderer from './lib/pixi/Renderer';
2
- import TestRenderer from './lib/pixi/TestRenderer';
3
- /**
4
- * Constructs a renderer for custom pixi particles
5
- * @class Renderer
6
- * @param {ICustomPixiParticlesSettings} settings The settings for the renderer
7
- */
8
- const customPixiParticles = {
9
- create(settings) {
10
- const { textures, emitterConfig, animatedSpriteZeroPad = 2, animatedSpriteIndexToStart = 0, finishingTextures = [], vertices = true, position = true, rotation = true, uvs = true, tint = true, maxParticles = 10000, maxFPS = 60, minFPS = 30, tickerSpeed = 0.02, } = settings;
11
- return new Renderer({
12
- textures,
13
- animatedSpriteZeroPad,
14
- animatedSpriteIndexToStart,
15
- emitterConfig,
16
- finishingTextures,
17
- vertices,
18
- position,
19
- rotation,
20
- uvs,
21
- tint,
22
- maxParticles,
23
- maxFPS,
24
- minFPS,
25
- tickerSpeed,
26
- });
27
- },
28
- };
29
- const _customPixiParticlesEditorOnly = {
30
- create(settings) {
31
- const { textures, emitterConfig, animatedSpriteZeroPad = 2, animatedSpriteIndexToStart = 0, finishingTextures = [], maxFPS = 60, minFPS = 60, tickerSpeed = 0.02, } = settings;
32
- return new TestRenderer({
33
- textures,
34
- animatedSpriteZeroPad,
35
- animatedSpriteIndexToStart,
36
- emitterConfig,
37
- finishingTextures,
38
- maxFPS,
39
- minFPS,
40
- tickerSpeed,
41
- });
42
- },
43
- };
44
- export { Renderer, customPixiParticles, _customPixiParticlesEditorOnly };
45
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@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IACJ,CAAC;CACF,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,8BAA8B,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,234 +0,0 @@
1
- import { Sprite } from 'pixi.js';
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
- superColorAlphaEnd: number;
66
- /**
67
- * Stores the maximum life time of the particle
68
- */
69
- maxLifeTime: number;
70
- /**
71
- * Stores the current life time of the particle
72
- */
73
- lifeTime: number;
74
- /**
75
- * Stores the current life progress of the particle
76
- */
77
- lifeProgress: number;
78
- /**
79
- * Stores the x position of the particle
80
- */
81
- x: number;
82
- /**
83
- * Stores the y position of the particle
84
- */
85
- y: number;
86
- /**
87
- * Stores the z position of the particle
88
- */
89
- z: number;
90
- /**
91
- * Stores the velocity angle of the particle
92
- */
93
- velocityAngle: number;
94
- /**
95
- * Stores the radians per second of the particle
96
- */
97
- radiansPerSecond: number;
98
- /**
99
- * Stores the radius of the particle
100
- */
101
- radius: number;
102
- radiusX: number;
103
- radiusY: number;
104
- /**
105
- * Stores the starting radius of the particle
106
- */
107
- radiusStart: number;
108
- /**
109
- * Stores the ending radius of the particle
110
- */
111
- radiusEnd: number;
112
- /**
113
- * Stores the cosine of the direction of the particle
114
- */
115
- directionCos: number;
116
- /**
117
- * Stores the sine of the direction of the particle
118
- */
119
- directionSin: number;
120
- /**
121
- * Stores the rotation of the particle
122
- */
123
- rotation: number;
124
- /**
125
- * Stores the rotation delta of the particle
126
- */
127
- rotationDelta: number;
128
- /**
129
- * Stores the angle of the particle
130
- */
131
- angle: number;
132
- /**
133
- * Stores the sprite of the particle
134
- */
135
- sprite: Sprite;
136
- /**
137
- * Stores whether the vortices are shown
138
- */
139
- showVortices: boolean;
140
- /**
141
- * Stores whether the turbulence is enabled
142
- */
143
- turbulence: boolean;
144
- /**
145
- * Stores the finishing texture of the particle
146
- */
147
- finishingTexture: number;
148
- /**
149
- * Stores the camera z position of the particle
150
- */
151
- cameraZ: number;
152
- /**
153
- * Stores the camera z position converter of the particle
154
- */
155
- cameraZConverter: number;
156
- /**
157
- * Stores the warp speed of the particle
158
- */
159
- warpSpeed: number;
160
- /**
161
- * Stores the warp base speed of the particle
162
- */
163
- warpBaseSpeed: number;
164
- /**
165
- * Stores the warp field of view of the particle
166
- */
167
- warpFov: number;
168
- /**
169
- * Stores the warp stretch of the particle
170
- */
171
- warpStretch: number;
172
- skipPositionBehaviour: boolean;
173
- skipAngularVelocityBehaviour: boolean;
174
- skipColorBehaviour: boolean;
175
- skipEmitDirectionBehaviour: boolean;
176
- skipRotationBehaviour: boolean;
177
- skipSizeBehaviour: boolean;
178
- skipAttractionRepulsionBehaviour: boolean;
179
- /**
180
- * Stores the warp distance scale converter of the particle
181
- */
182
- warpDistanceScaleConverter: number;
183
- sizeDifference: {
184
- x: number;
185
- y: number;
186
- };
187
- fromAtoB: boolean;
188
- fromAtoBTwoWays: boolean;
189
- pointA: Point;
190
- pointB: Point;
191
- there: ThereBack;
192
- back: ThereBack;
193
- xStart: number;
194
- yStart: number;
195
- xTarget: number;
196
- yTarget: number;
197
- thereDuration: number;
198
- backDuration: number;
199
- progress: number;
200
- time: number;
201
- thereAmplitude: number;
202
- backAmplitude: number;
203
- direction: number;
204
- noiseOffset: Point;
205
- timeline: any[];
206
- initialDirectionCos: number;
207
- initialDirectionSin: number;
208
- velocityScale: number;
209
- rotationAcceleration: number;
210
- /**
211
- * Constructs a particle object
212
- */
213
- constructor();
214
- /**
215
- * Resets the particle object
216
- */
217
- reset(): void;
218
- /**
219
- * Checks if the particle is almost dead
220
- *
221
- * @return {boolean} True if the particle is almost dead, otherwise false
222
- */
223
- isAlmostDead(): boolean;
224
- /**
225
- * Checks if the particle is dead
226
- *
227
- * @return {boolean} True if the particle is dead, otherwise false
228
- */
229
- isDead(): boolean;
230
- /**
231
- * Hides the particle
232
- */
233
- hide(): void;
234
- }
@@ -1,201 +0,0 @@
1
- import { Color, Point } from './util';
2
- import ThereBack from './util/ThereBack';
3
- /**
4
- * Represents a particle object used in particle system simulations
5
- */
6
- class Particle {
7
- /**
8
- * Constructs a particle object
9
- */
10
- constructor() {
11
- this.next = null;
12
- this.prev = null;
13
- /**
14
- * Stores the unique ID of the particle
15
- */
16
- this.uid = Particle._UID.value++;
17
- /**
18
- * Stores the movement of the particle
19
- */
20
- this.movement = new Point();
21
- /**
22
- * Stores the acceleration of the particle
23
- */
24
- this.acceleration = new Point();
25
- /**
26
- * Stores the velocity of the particle
27
- */
28
- this.velocity = new Point();
29
- /**
30
- * Stores the size of the particle
31
- */
32
- this.size = new Point();
33
- /**
34
- * Stores the starting size of the particle
35
- */
36
- this.sizeStart = new Point();
37
- /**
38
- * Stores the starting warp size of the particle
39
- */
40
- this.warpSizeStart = new Point();
41
- /**
42
- * Stores the ending size of the particle
43
- */
44
- this.sizeEnd = new Point();
45
- /**
46
- * Stores the x value of the particle for sin wave
47
- */
48
- this.sinXVal = new Point();
49
- /**
50
- * Stores the y value of the particle for sin wave
51
- */
52
- this.sinYVal = new Point();
53
- /**
54
- * Stores the color of the particle
55
- */
56
- this.color = new Color();
57
- /**
58
- * Stores the starting color of the particle
59
- */
60
- this.colorStart = new Color();
61
- /**
62
- * Stores the ending color of the particle
63
- */
64
- this.colorEnd = new Color();
65
- this.superColorAlphaEnd = 1;
66
- this.skipPositionBehaviour = false;
67
- this.skipAngularVelocityBehaviour = false;
68
- this.skipColorBehaviour = false;
69
- this.skipEmitDirectionBehaviour = false;
70
- this.skipRotationBehaviour = false;
71
- this.skipSizeBehaviour = false;
72
- this.skipAttractionRepulsionBehaviour = false;
73
- this.fromAtoB = false;
74
- this.fromAtoBTwoWays = false;
75
- this.pointA = new Point();
76
- this.pointB = new Point();
77
- this.there = new ThereBack();
78
- this.back = new ThereBack();
79
- this.xStart = 0;
80
- this.yStart = 0;
81
- this.xTarget = 0;
82
- this.yTarget = 0;
83
- this.thereDuration = 1;
84
- this.backDuration = 1;
85
- this.progress = 0;
86
- this.time = 0;
87
- this.thereAmplitude = 10;
88
- this.backAmplitude = 10;
89
- this.direction = 1;
90
- this.noiseOffset = new Point();
91
- this.timeline = [];
92
- this.initialDirectionCos = 0;
93
- this.initialDirectionSin = 0;
94
- this.velocityScale = 1;
95
- this.rotationAcceleration = 0;
96
- this.reset();
97
- }
98
- /**
99
- * Resets the particle object
100
- */
101
- reset() {
102
- this.maxLifeTime = 0;
103
- this.lifeTime = 0;
104
- this.lifeProgress = 0;
105
- this.x = 0;
106
- this.y = 0;
107
- this.z = 0;
108
- this.timeline = [];
109
- this.skipPositionBehaviour = false;
110
- this.skipAngularVelocityBehaviour = false;
111
- this.skipColorBehaviour = false;
112
- this.skipAttractionRepulsionBehaviour = false;
113
- this.skipEmitDirectionBehaviour = false;
114
- this.skipRotationBehaviour = false;
115
- this.skipSizeBehaviour = false;
116
- this.movement.set(0, 0);
117
- this.acceleration.set(0, 0);
118
- this.velocity.set(0, 0);
119
- this.sinXVal.set(0, 0);
120
- this.sinYVal.set(0, 0);
121
- this.velocityAngle = 0;
122
- this.radiansPerSecond = 0;
123
- this.radius = 0;
124
- this.radiusStart = 0;
125
- this.radiusEnd = 0;
126
- this.directionCos = 1;
127
- this.directionSin = 0;
128
- this.finishingTexture = 0;
129
- this.showVortices = false;
130
- this.turbulence = false;
131
- this.rotation = 0;
132
- this.rotationDelta = 0;
133
- this.size.set(1, 1);
134
- this.sizeStart.set(0, 0);
135
- this.warpSizeStart.set(0, 0);
136
- this.sizeEnd.set(0, 0);
137
- this.color.set(255, 255, 255, 1);
138
- this.colorStart.set(0, 0, 0, 1);
139
- this.colorEnd.set(0, 0, 0, 1);
140
- this.superColorAlphaEnd = 1;
141
- this.cameraZ = 0;
142
- this.cameraZConverter = 10;
143
- this.warpSpeed = 0;
144
- this.warpBaseSpeed = 0;
145
- this.warpFov = 20;
146
- this.warpStretch = 5;
147
- this.warpDistanceScaleConverter = 2000;
148
- this.sizeDifference = { x: 1, y: 1 };
149
- this.fromAtoB = false;
150
- this.fromAtoBTwoWays = false;
151
- this.pointA.set(0, 0);
152
- this.pointB.set(0, 0);
153
- this.there.set('', '', '');
154
- this.back.set('', '', '');
155
- this.thereDuration = 1;
156
- this.backDuration = 1;
157
- this.thereAmplitude = 10;
158
- this.backAmplitude = 10;
159
- this.progress = 0;
160
- this.direction = 1;
161
- this.time = 0;
162
- this.xStart = 0;
163
- this.yStart = 0;
164
- this.xTarget = 0;
165
- this.yTarget = 0;
166
- this.noiseOffset = new Point();
167
- this.initialDirectionCos = 0;
168
- this.initialDirectionSin = 0;
169
- this.velocityScale = 1;
170
- this.rotationAcceleration = 0;
171
- }
172
- /**
173
- * Checks if the particle is almost dead
174
- *
175
- * @return {boolean} True if the particle is almost dead, otherwise false
176
- */
177
- isAlmostDead() {
178
- return this.lifeTime >= this.maxLifeTime - 0.1;
179
- }
180
- /**
181
- * Checks if the particle is dead
182
- *
183
- * @return {boolean} True if the particle is dead, otherwise false
184
- */
185
- isDead() {
186
- return this.lifeTime >= this.maxLifeTime;
187
- }
188
- /**
189
- * Hides the particle
190
- */
191
- hide() {
192
- if (!this.sprite)
193
- return;
194
- if (!this.sprite.visible)
195
- return;
196
- this.sprite.visible = false;
197
- }
198
- }
199
- Particle._UID = { value: 0 };
200
- export default Particle;
201
- //# sourceMappingURL=Particle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Particle.js","sourceRoot":"","sources":["../../src/lib/Particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,SAAS,MAAM,kBAAkB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particles.
5
- */
6
- export default class ParticlePool {
7
- /**
8
- * A static global instance of ParticlePool.
9
- */
10
- static global: ParticlePool;
11
- /**
12
- * The first element in the pool.
13
- */
14
- first: Particle | null;
15
- /**
16
- * Removes a particle from the pool and returns it.
17
- *
18
- * @returns {Particle} The removed particle.
19
- */
20
- pop(): Particle;
21
- /**
22
- * Creates a new particle.
23
- *
24
- * @returns {Particle} The newly created particle.
25
- */
26
- create(): Particle;
27
- /**
28
- * Adds a particle to the pool.
29
- *
30
- * @param {Particle} particle The particle to add.
31
- */
32
- push(particle: Particle): void;
33
- /**
34
- * Resets the particle pool.
35
- */
36
- reset(): void;
37
- }