custom-pixi-particles 4.0.20 → 4.0.22
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/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/Model.d.ts +23 -0
- package/dist/lib/Model.js +23 -0
- package/dist/lib/Model.js.map +1 -1
- package/dist/lib/Particle.d.ts +146 -0
- package/dist/lib/Particle.js +61 -0
- package/dist/lib/Particle.js.map +1 -1
- package/dist/lib/ParticlePool.d.ts +28 -0
- package/dist/lib/ParticlePool.js +28 -0
- package/dist/lib/ParticlePool.js.map +1 -1
- package/dist/lib/behaviour/AngularVelocityBehaviour.d.ts +31 -0
- package/dist/lib/behaviour/AngularVelocityBehaviour.js +45 -12
- package/dist/lib/behaviour/AngularVelocityBehaviour.js.map +1 -1
- package/dist/lib/behaviour/Behaviour.d.ts +26 -0
- package/dist/lib/behaviour/Behaviour.js +26 -0
- package/dist/lib/behaviour/Behaviour.js.map +1 -1
- package/dist/lib/behaviour/ColorBehaviour.d.ts +1 -1
- package/dist/lib/behaviour/ColorBehaviour.js +8 -11
- package/dist/lib/behaviour/ColorBehaviour.js.map +1 -1
- package/dist/lib/behaviour/EmitDirectionBehaviour.d.ts +29 -5
- package/dist/lib/behaviour/EmitDirectionBehaviour.js +32 -20
- package/dist/lib/behaviour/EmitDirectionBehaviour.js.map +1 -1
- package/dist/lib/behaviour/EmitterBehaviours.d.ts +44 -2
- package/dist/lib/behaviour/EmitterBehaviours.js +43 -3
- package/dist/lib/behaviour/EmitterBehaviours.js.map +1 -1
- package/dist/lib/behaviour/LifeBehaviour.d.ts +49 -0
- package/dist/lib/behaviour/LifeBehaviour.js +55 -5
- package/dist/lib/behaviour/LifeBehaviour.js.map +1 -1
- package/dist/lib/behaviour/PositionBehaviour.d.ts +34 -1
- package/dist/lib/behaviour/PositionBehaviour.js +70 -28
- package/dist/lib/behaviour/PositionBehaviour.js.map +1 -1
- package/dist/lib/behaviour/RotationBehaviour.d.ts +33 -4
- package/dist/lib/behaviour/RotationBehaviour.js +33 -17
- package/dist/lib/behaviour/RotationBehaviour.js.map +1 -1
- package/dist/lib/behaviour/SizeBehaviour.d.ts +1 -1
- package/dist/lib/behaviour/SizeBehaviour.js +25 -18
- package/dist/lib/behaviour/SizeBehaviour.js.map +1 -1
- package/dist/lib/behaviour/TurbulenceBehaviour.d.ts +1 -1
- package/dist/lib/behaviour/TurbulenceBehaviour.js +1 -5
- package/dist/lib/behaviour/TurbulenceBehaviour.js.map +1 -1
- package/dist/lib/emission/AbstractEmission.d.ts +23 -0
- package/dist/lib/emission/AbstractEmission.js +23 -0
- package/dist/lib/emission/AbstractEmission.js.map +1 -1
- package/dist/lib/emission/RandomEmission.d.ts +33 -0
- package/dist/lib/emission/RandomEmission.js +33 -0
- package/dist/lib/emission/RandomEmission.js.map +1 -1
- package/dist/lib/emission/StandardEmission.d.ts +49 -0
- package/dist/lib/emission/StandardEmission.js +49 -0
- package/dist/lib/emission/StandardEmission.js.map +1 -1
- package/dist/lib/emission/UniformEmission.d.ts +42 -0
- package/dist/lib/emission/UniformEmission.js +42 -0
- package/dist/lib/emission/UniformEmission.js.map +1 -1
- package/dist/lib/emitter/Duration.d.ts +17 -0
- package/dist/lib/emitter/Duration.js +17 -0
- package/dist/lib/emitter/Duration.js.map +1 -1
- package/dist/lib/emitter/Emitter.d.ts +60 -0
- package/dist/lib/emitter/Emitter.js +60 -0
- package/dist/lib/emitter/Emitter.js.map +1 -1
- package/dist/lib/parser/BehaviourParser.d.ts +15 -4
- package/dist/lib/parser/BehaviourParser.js +15 -23
- package/dist/lib/parser/BehaviourParser.js.map +1 -1
- package/dist/lib/parser/CompatibilityHelper.d.ts +9 -0
- package/dist/lib/parser/CompatibilityHelper.js +9 -0
- package/dist/lib/parser/CompatibilityHelper.js.map +1 -1
- package/dist/lib/parser/EmitControllerParser.d.ts +21 -0
- package/dist/lib/parser/EmitControllerParser.js +21 -0
- package/dist/lib/parser/EmitControllerParser.js.map +1 -1
- package/dist/lib/parser/EmitterParser.d.ts +54 -1
- package/dist/lib/parser/EmitterParser.js +72 -15
- package/dist/lib/parser/EmitterParser.js.map +1 -1
- package/dist/lib/pixi/Renderer.d.ts +55 -0
- package/dist/lib/pixi/Renderer.js +55 -0
- package/dist/lib/pixi/Renderer.js.map +1 -1
- package/dist/lib/util/Color.d.ts +101 -0
- package/dist/lib/util/Color.js +101 -0
- package/dist/lib/util/Color.js.map +1 -1
- package/dist/lib/util/List.d.ts +40 -0
- package/dist/lib/util/List.js +40 -0
- package/dist/lib/util/List.js.map +1 -1
- package/dist/lib/util/Point.d.ts +21 -0
- package/dist/lib/util/Point.js +21 -0
- package/dist/lib/util/Point.js.map +1 -1
- package/dist/lib/util/Random.d.ts +20 -0
- package/dist/lib/util/Random.js +20 -0
- package/dist/lib/util/Random.js.map +1 -1
- package/dist/lib/util/maths.d.ts +17 -0
- package/dist/lib/util/maths.js +17 -0
- package/dist/lib/util/maths.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import Renderer from './lib/pixi/Renderer';
|
|
2
2
|
import TestRenderer from './lib/pixi/TestRenderer';
|
|
3
3
|
import { ICustomPixiParticlesSettings } from './lib/customPixiParticlesSettingsInterface';
|
|
4
|
+
/**
|
|
5
|
+
* Constructs a renderer for custom pixi particles
|
|
6
|
+
* @class Renderer
|
|
7
|
+
* @param {ICustomPixiParticlesSettings} settings The settings for the renderer
|
|
8
|
+
*/
|
|
4
9
|
declare const customPixiParticles: {
|
|
5
10
|
create(settings: ICustomPixiParticlesSettings): Renderer;
|
|
6
11
|
createTest(settings: ICustomPixiParticlesSettings): TestRenderer;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import Renderer from './lib/pixi/Renderer';
|
|
2
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
|
+
*/
|
|
3
8
|
const customPixiParticles = {
|
|
4
9
|
create(settings) {
|
|
5
10
|
const { textures, emitterConfig, animatedSpriteZeroPad = 2, animatedSpriteIndexToStart = 0, finishingTextures = [] } = settings;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAC1C,OAAO,YAAY,MAAM,yBAAyB,CAAA;AAGlD,MAAM,mBAAmB,GAAG;IAC1B,MAAM,CAAC,QAAsC;QAC3C,MAAM,EACJ,QAAQ,EAAE,aAAa,EAAE,qBAAqB,GAAG,CAAC,EAAE,0BAA0B,GAAG,CAAC,EAAE,iBAAiB,GAAG,EAAE,EAC3G,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,QAAQ,CAAC,EAAC,QAAQ,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,iBAAiB,EAAC,CAAC,CAAA;IACtH,CAAC;IACD,UAAU,CAAC,QAAsC;QAC/C,MAAM,EACJ,QAAQ,EAAE,aAAa,EAAE,qBAAqB,GAAG,CAAC,EAAE,0BAA0B,GAAG,CAAC,EAAE,iBAAiB,GAAG,EAAE,EAC3G,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,YAAY,CAAC,EAAC,QAAQ,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,iBAAiB,EAAC,CAAC,CAAA;IAC1H,CAAC;CACF,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAC1C,OAAO,YAAY,MAAM,yBAAyB,CAAA;AAGlD;;;;GAIG;AACH,MAAM,mBAAmB,GAAG;IAC1B,MAAM,CAAC,QAAsC;QAC3C,MAAM,EACJ,QAAQ,EAAE,aAAa,EAAE,qBAAqB,GAAG,CAAC,EAAE,0BAA0B,GAAG,CAAC,EAAE,iBAAiB,GAAG,EAAE,EAC3G,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,QAAQ,CAAC,EAAC,QAAQ,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,iBAAiB,EAAC,CAAC,CAAA;IACtH,CAAC;IACD,UAAU,CAAC,QAAsC;QAC/C,MAAM,EACJ,QAAQ,EAAE,aAAa,EAAE,qBAAqB,GAAG,CAAC,EAAE,0BAA0B,GAAG,CAAC,EAAE,iBAAiB,GAAG,EAAE,EAC3G,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,YAAY,CAAC,EAAC,QAAQ,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,iBAAiB,EAAC,CAAC,CAAA;IAC1H,CAAC;CACF,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAgC,CAAA"}
|
package/dist/lib/Model.d.ts
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
export default class Model {
|
|
2
|
+
/**
|
|
3
|
+
* Boolean value indicating whether warping is enabled
|
|
4
|
+
*/
|
|
2
5
|
warp: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The Z position of the camera
|
|
8
|
+
*/
|
|
3
9
|
cameraZ: number;
|
|
10
|
+
/**
|
|
11
|
+
* The conversion rate for cameraZ
|
|
12
|
+
*/
|
|
4
13
|
cameraZConverter: number;
|
|
14
|
+
/**
|
|
15
|
+
* The speed of warp
|
|
16
|
+
*/
|
|
5
17
|
warpSpeed: number;
|
|
18
|
+
/**
|
|
19
|
+
* The base speed of warp
|
|
20
|
+
*/
|
|
6
21
|
warpBaseSpeed: number;
|
|
22
|
+
/**
|
|
23
|
+
* Update the model with the behaviour object
|
|
24
|
+
* @param {Object} behaviour - The behaviour object
|
|
25
|
+
*/
|
|
7
26
|
update(behaviour: any): void;
|
|
27
|
+
/**
|
|
28
|
+
* Update the camera position based on the delta time
|
|
29
|
+
* @param {number} deltaTime - The delta time
|
|
30
|
+
*/
|
|
8
31
|
updateCamera(deltaTime: number): void;
|
|
9
32
|
}
|
package/dist/lib/Model.js
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
1
1
|
export default class Model {
|
|
2
2
|
constructor() {
|
|
3
|
+
/**
|
|
4
|
+
* Boolean value indicating whether warping is enabled
|
|
5
|
+
*/
|
|
3
6
|
this.warp = false;
|
|
7
|
+
/**
|
|
8
|
+
* The Z position of the camera
|
|
9
|
+
*/
|
|
4
10
|
this.cameraZ = 0;
|
|
11
|
+
/**
|
|
12
|
+
* The conversion rate for cameraZ
|
|
13
|
+
*/
|
|
5
14
|
this.cameraZConverter = 0;
|
|
15
|
+
/**
|
|
16
|
+
* The speed of warp
|
|
17
|
+
*/
|
|
6
18
|
this.warpSpeed = 0;
|
|
19
|
+
/**
|
|
20
|
+
* The base speed of warp
|
|
21
|
+
*/
|
|
7
22
|
this.warpBaseSpeed = 0;
|
|
8
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Update the model with the behaviour object
|
|
26
|
+
* @param {Object} behaviour - The behaviour object
|
|
27
|
+
*/
|
|
9
28
|
update(behaviour) {
|
|
10
29
|
this.warp = behaviour.warp || false;
|
|
11
30
|
this.cameraZConverter = behaviour.cameraZConverter;
|
|
12
31
|
this.warpSpeed = behaviour.warpSpeed;
|
|
13
32
|
this.warpBaseSpeed = behaviour.warpBaseSpeed;
|
|
14
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Update the camera position based on the delta time
|
|
36
|
+
* @param {number} deltaTime - The delta time
|
|
37
|
+
*/
|
|
15
38
|
updateCamera(deltaTime) {
|
|
16
39
|
if (!this.warp)
|
|
17
40
|
return;
|
package/dist/lib/Model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/lib/Model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,KAAK;IAA1B;QACI,SAAI,GAAY,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/lib/Model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,KAAK;IAA1B;QACI;;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;IAqB7B,CAAC;IAnBG;;;OAGG;IACH,MAAM,CAAC,SAAc;QACjB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,IAAI,KAAK,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,CAAC;QACnD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,SAAiB;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO;QACvB,IAAI,CAAC,OAAO,IAAI,SAAS,GAAG,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAA;IAC3F,CAAC;CACJ"}
|
package/dist/lib/Particle.d.ts
CHANGED
|
@@ -1,54 +1,200 @@
|
|
|
1
1
|
import { Sprite } from 'pixi.js-legacy';
|
|
2
2
|
import { Color, Point } from './util';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a particle object used in particle system simulations
|
|
5
|
+
*/
|
|
3
6
|
export default class Particle {
|
|
4
7
|
static _UID: {
|
|
5
8
|
value: number;
|
|
6
9
|
};
|
|
7
10
|
next: Particle | null;
|
|
8
11
|
prev: Particle | null;
|
|
12
|
+
/**
|
|
13
|
+
* Stores the unique ID of the particle
|
|
14
|
+
*/
|
|
9
15
|
uid: number;
|
|
16
|
+
/**
|
|
17
|
+
* Stores the movement of the particle
|
|
18
|
+
*/
|
|
10
19
|
movement: Point;
|
|
20
|
+
/**
|
|
21
|
+
* Stores the acceleration of the particle
|
|
22
|
+
*/
|
|
11
23
|
acceleration: Point;
|
|
24
|
+
/**
|
|
25
|
+
* Stores the velocity of the particle
|
|
26
|
+
*/
|
|
12
27
|
velocity: Point;
|
|
28
|
+
/**
|
|
29
|
+
* Stores the size of the particle
|
|
30
|
+
*/
|
|
13
31
|
size: Point;
|
|
32
|
+
/**
|
|
33
|
+
* Stores the starting size of the particle
|
|
34
|
+
*/
|
|
14
35
|
sizeStart: Point;
|
|
36
|
+
/**
|
|
37
|
+
* Stores the starting warp size of the particle
|
|
38
|
+
*/
|
|
15
39
|
warpSizeStart: Point;
|
|
40
|
+
/**
|
|
41
|
+
* Stores the ending size of the particle
|
|
42
|
+
*/
|
|
16
43
|
sizeEnd: Point;
|
|
44
|
+
/**
|
|
45
|
+
* Stores the x value of the particle for sin wave
|
|
46
|
+
*/
|
|
17
47
|
sinXVal: Point;
|
|
48
|
+
/**
|
|
49
|
+
* Stores the y value of the particle for sin wave
|
|
50
|
+
*/
|
|
18
51
|
sinYVal: Point;
|
|
52
|
+
/**
|
|
53
|
+
* Stores the color of the particle
|
|
54
|
+
*/
|
|
19
55
|
color: Color;
|
|
56
|
+
/**
|
|
57
|
+
* Stores the starting color of the particle
|
|
58
|
+
*/
|
|
20
59
|
colorStart: Color;
|
|
60
|
+
/**
|
|
61
|
+
* Stores the ending color of the particle
|
|
62
|
+
*/
|
|
21
63
|
colorEnd: Color;
|
|
64
|
+
/**
|
|
65
|
+
* Stores the maximum life time of the particle
|
|
66
|
+
*/
|
|
22
67
|
maxLifeTime: number;
|
|
68
|
+
/**
|
|
69
|
+
* Stores the current life time of the particle
|
|
70
|
+
*/
|
|
23
71
|
lifeTime: number;
|
|
72
|
+
/**
|
|
73
|
+
* Stores the current life progress of the particle
|
|
74
|
+
*/
|
|
24
75
|
lifeProgress: number;
|
|
76
|
+
/**
|
|
77
|
+
* Stores the x position of the particle
|
|
78
|
+
*/
|
|
25
79
|
x: number;
|
|
80
|
+
/**
|
|
81
|
+
* Stores the y position of the particle
|
|
82
|
+
*/
|
|
26
83
|
y: number;
|
|
84
|
+
/**
|
|
85
|
+
* Stores the z position of the particle
|
|
86
|
+
*/
|
|
27
87
|
z: number;
|
|
88
|
+
/**
|
|
89
|
+
* Stores the velocity angle of the particle
|
|
90
|
+
*/
|
|
28
91
|
velocityAngle: number;
|
|
92
|
+
/**
|
|
93
|
+
* Stores the radians per second of the particle
|
|
94
|
+
*/
|
|
29
95
|
radiansPerSecond: number;
|
|
96
|
+
/**
|
|
97
|
+
* Stores the radius of the particle
|
|
98
|
+
*/
|
|
30
99
|
radius: number;
|
|
100
|
+
/**
|
|
101
|
+
* Stores the starting radius of the particle
|
|
102
|
+
*/
|
|
31
103
|
radiusStart: number;
|
|
104
|
+
/**
|
|
105
|
+
* Stores the ending radius of the particle
|
|
106
|
+
*/
|
|
32
107
|
radiusEnd: number;
|
|
108
|
+
/**
|
|
109
|
+
* Stores the cosine of the direction of the particle
|
|
110
|
+
*/
|
|
33
111
|
directionCos: number;
|
|
112
|
+
/**
|
|
113
|
+
* Stores the sine of the direction of the particle
|
|
114
|
+
*/
|
|
34
115
|
directionSin: number;
|
|
116
|
+
/**
|
|
117
|
+
* Stores the rotation of the particle
|
|
118
|
+
*/
|
|
35
119
|
rotation: number;
|
|
120
|
+
/**
|
|
121
|
+
* Stores the rotation delta of the particle
|
|
122
|
+
*/
|
|
36
123
|
rotationDelta: number;
|
|
124
|
+
/**
|
|
125
|
+
* Stores the angle of the particle
|
|
126
|
+
*/
|
|
37
127
|
angle: number;
|
|
128
|
+
/**
|
|
129
|
+
* Stores the sprite of the particle
|
|
130
|
+
*/
|
|
38
131
|
sprite: Sprite;
|
|
132
|
+
/**
|
|
133
|
+
* Stores whether the vortices are shown
|
|
134
|
+
*/
|
|
39
135
|
showVortices: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Stores whether the turbulence is enabled
|
|
138
|
+
*/
|
|
40
139
|
turbulence: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Stores the finishing texture of the particle
|
|
142
|
+
*/
|
|
41
143
|
finishingTexture: number;
|
|
144
|
+
/**
|
|
145
|
+
* Stores the camera z position of the particle
|
|
146
|
+
*/
|
|
42
147
|
cameraZ: number;
|
|
148
|
+
/**
|
|
149
|
+
* Stores the camera z position converter of the particle
|
|
150
|
+
*/
|
|
43
151
|
cameraZConverter: number;
|
|
152
|
+
/**
|
|
153
|
+
* Stores the warp speed of the particle
|
|
154
|
+
*/
|
|
44
155
|
warpSpeed: number;
|
|
156
|
+
/**
|
|
157
|
+
* Stores the warp base speed of the particle
|
|
158
|
+
*/
|
|
45
159
|
warpBaseSpeed: number;
|
|
160
|
+
/**
|
|
161
|
+
* Stores the warp field of view of the particle
|
|
162
|
+
*/
|
|
46
163
|
warpFov: number;
|
|
164
|
+
/**
|
|
165
|
+
* Stores the warp stretch of the particle
|
|
166
|
+
*/
|
|
47
167
|
warpStretch: number;
|
|
168
|
+
/**
|
|
169
|
+
* Stores the warp distance scale converter of the particle
|
|
170
|
+
*/
|
|
48
171
|
warpDistanceScaleConverter: number;
|
|
172
|
+
sizeDifference: {
|
|
173
|
+
x: number;
|
|
174
|
+
y: number;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Constructs a particle object
|
|
178
|
+
*/
|
|
49
179
|
constructor();
|
|
180
|
+
/**
|
|
181
|
+
* Resets the particle object
|
|
182
|
+
*/
|
|
50
183
|
reset(): void;
|
|
184
|
+
/**
|
|
185
|
+
* Checks if the particle is almost dead
|
|
186
|
+
*
|
|
187
|
+
* @return {boolean} True if the particle is almost dead, otherwise false
|
|
188
|
+
*/
|
|
51
189
|
isAlmostDead(): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Checks if the particle is dead
|
|
192
|
+
*
|
|
193
|
+
* @return {boolean} True if the particle is dead, otherwise false
|
|
194
|
+
*/
|
|
52
195
|
isDead(): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Hides the particle
|
|
198
|
+
*/
|
|
53
199
|
hide(): void;
|
|
54
200
|
}
|
package/dist/lib/Particle.js
CHANGED
|
@@ -1,23 +1,71 @@
|
|
|
1
1
|
import { Color, Point } from './util';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a particle object used in particle system simulations
|
|
4
|
+
*/
|
|
2
5
|
export default class Particle {
|
|
6
|
+
/**
|
|
7
|
+
* Constructs a particle object
|
|
8
|
+
*/
|
|
3
9
|
constructor() {
|
|
4
10
|
this.next = null;
|
|
5
11
|
this.prev = null;
|
|
12
|
+
/**
|
|
13
|
+
* Stores the unique ID of the particle
|
|
14
|
+
*/
|
|
6
15
|
this.uid = Particle._UID.value++;
|
|
16
|
+
/**
|
|
17
|
+
* Stores the movement of the particle
|
|
18
|
+
*/
|
|
7
19
|
this.movement = new Point();
|
|
20
|
+
/**
|
|
21
|
+
* Stores the acceleration of the particle
|
|
22
|
+
*/
|
|
8
23
|
this.acceleration = new Point();
|
|
24
|
+
/**
|
|
25
|
+
* Stores the velocity of the particle
|
|
26
|
+
*/
|
|
9
27
|
this.velocity = new Point();
|
|
28
|
+
/**
|
|
29
|
+
* Stores the size of the particle
|
|
30
|
+
*/
|
|
10
31
|
this.size = new Point();
|
|
32
|
+
/**
|
|
33
|
+
* Stores the starting size of the particle
|
|
34
|
+
*/
|
|
11
35
|
this.sizeStart = new Point();
|
|
36
|
+
/**
|
|
37
|
+
* Stores the starting warp size of the particle
|
|
38
|
+
*/
|
|
12
39
|
this.warpSizeStart = new Point();
|
|
40
|
+
/**
|
|
41
|
+
* Stores the ending size of the particle
|
|
42
|
+
*/
|
|
13
43
|
this.sizeEnd = new Point();
|
|
44
|
+
/**
|
|
45
|
+
* Stores the x value of the particle for sin wave
|
|
46
|
+
*/
|
|
14
47
|
this.sinXVal = new Point();
|
|
48
|
+
/**
|
|
49
|
+
* Stores the y value of the particle for sin wave
|
|
50
|
+
*/
|
|
15
51
|
this.sinYVal = new Point();
|
|
52
|
+
/**
|
|
53
|
+
* Stores the color of the particle
|
|
54
|
+
*/
|
|
16
55
|
this.color = new Color();
|
|
56
|
+
/**
|
|
57
|
+
* Stores the starting color of the particle
|
|
58
|
+
*/
|
|
17
59
|
this.colorStart = new Color();
|
|
60
|
+
/**
|
|
61
|
+
* Stores the ending color of the particle
|
|
62
|
+
*/
|
|
18
63
|
this.colorEnd = new Color();
|
|
19
64
|
this.reset();
|
|
20
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Resets the particle object
|
|
68
|
+
*/
|
|
21
69
|
reset() {
|
|
22
70
|
this.maxLifeTime = 0;
|
|
23
71
|
this.lifeTime = 0;
|
|
@@ -57,12 +105,25 @@ export default class Particle {
|
|
|
57
105
|
this.warpStretch = 5;
|
|
58
106
|
this.warpDistanceScaleConverter = 2000;
|
|
59
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Checks if the particle is almost dead
|
|
110
|
+
*
|
|
111
|
+
* @return {boolean} True if the particle is almost dead, otherwise false
|
|
112
|
+
*/
|
|
60
113
|
isAlmostDead() {
|
|
61
114
|
return this.lifeTime >= this.maxLifeTime - 0.1;
|
|
62
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Checks if the particle is dead
|
|
118
|
+
*
|
|
119
|
+
* @return {boolean} True if the particle is dead, otherwise false
|
|
120
|
+
*/
|
|
63
121
|
isDead() {
|
|
64
122
|
return this.lifeTime >= this.maxLifeTime;
|
|
65
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Hides the particle
|
|
126
|
+
*/
|
|
66
127
|
hide() {
|
|
67
128
|
if (!this.sprite)
|
|
68
129
|
return;
|
package/dist/lib/Particle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Particle.js","sourceRoot":"","sources":["../../src/lib/Particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,QAAQ;
|
|
1
|
+
{"version":3,"file":"Particle.js","sourceRoot":"","sources":["../../src/lib/Particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAErC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IA+M3B;;OAEG;IACH;QAhNA,SAAI,GAAoB,IAAI,CAAA;QAC5B,SAAI,GAAoB,IAAI,CAAA;QAE5B;;WAEG;QACH,QAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;QAE3B;;WAEG;QACH,aAAQ,GAAG,IAAI,KAAK,EAAE,CAAA;QAEtB;;WAEG;QACH,iBAAY,GAAG,IAAI,KAAK,EAAE,CAAA;QAE1B;;WAEG;QACH,aAAQ,GAAG,IAAI,KAAK,EAAE,CAAA;QAEtB;;WAEG;QACH,SAAI,GAAG,IAAI,KAAK,EAAE,CAAA;QAElB;;WAEG;QACH,cAAS,GAAG,IAAI,KAAK,EAAE,CAAA;QAEvB;;WAEG;QACH,kBAAa,GAAG,IAAI,KAAK,EAAE,CAAA;QAE3B;;WAEG;QACH,YAAO,GAAG,IAAI,KAAK,EAAE,CAAA;QAErB;;WAEG;QACH,YAAO,GAAG,IAAI,KAAK,EAAE,CAAA;QAErB;;WAEG;QACH,YAAO,GAAG,IAAI,KAAK,EAAE,CAAA;QAErB;;WAEG;QACH,UAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QAEnB;;WAEG;QACH,eAAU,GAAG,IAAI,KAAK,EAAE,CAAA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MAAM,CAAC,OAAO;YAAE,OAAM;QAChC,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAA;IAC7B,CAAC;;AAlSM,aAAI,GAAsB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA"}
|
|
@@ -1,9 +1,37 @@
|
|
|
1
1
|
import Particle from './Particle';
|
|
2
|
+
/**
|
|
3
|
+
* @class ParticlePool
|
|
4
|
+
* A class for managing a pool of particles.
|
|
5
|
+
*/
|
|
2
6
|
export default class ParticlePool {
|
|
7
|
+
/**
|
|
8
|
+
* A static global instance of ParticlePool.
|
|
9
|
+
*/
|
|
3
10
|
static global: ParticlePool;
|
|
11
|
+
/**
|
|
12
|
+
* The first element in the pool.
|
|
13
|
+
*/
|
|
4
14
|
first: Particle | null;
|
|
15
|
+
/**
|
|
16
|
+
* Removes a particle from the pool and returns it.
|
|
17
|
+
*
|
|
18
|
+
* @returns {Particle} The removed particle.
|
|
19
|
+
*/
|
|
5
20
|
pop(): Particle;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new particle.
|
|
23
|
+
*
|
|
24
|
+
* @returns {Particle} The newly created particle.
|
|
25
|
+
*/
|
|
6
26
|
create(): Particle;
|
|
27
|
+
/**
|
|
28
|
+
* Adds a particle to the pool.
|
|
29
|
+
*
|
|
30
|
+
* @param {Particle} particle The particle to add.
|
|
31
|
+
*/
|
|
7
32
|
push(particle: Particle): void;
|
|
33
|
+
/**
|
|
34
|
+
* Resets the particle pool.
|
|
35
|
+
*/
|
|
8
36
|
reset(): void;
|
|
9
37
|
}
|
package/dist/lib/ParticlePool.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import Particle from './Particle';
|
|
2
|
+
/**
|
|
3
|
+
* @class ParticlePool
|
|
4
|
+
* A class for managing a pool of particles.
|
|
5
|
+
*/
|
|
2
6
|
export default class ParticlePool {
|
|
3
7
|
constructor() {
|
|
8
|
+
/**
|
|
9
|
+
* The first element in the pool.
|
|
10
|
+
*/
|
|
4
11
|
this.first = null;
|
|
5
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Removes a particle from the pool and returns it.
|
|
15
|
+
*
|
|
16
|
+
* @returns {Particle} The removed particle.
|
|
17
|
+
*/
|
|
6
18
|
pop() {
|
|
7
19
|
if (!this.first)
|
|
8
20
|
return this.create();
|
|
@@ -11,17 +23,33 @@ export default class ParticlePool {
|
|
|
11
23
|
current.next = null;
|
|
12
24
|
return current;
|
|
13
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new particle.
|
|
28
|
+
*
|
|
29
|
+
* @returns {Particle} The newly created particle.
|
|
30
|
+
*/
|
|
14
31
|
create() {
|
|
15
32
|
return new Particle();
|
|
16
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Adds a particle to the pool.
|
|
36
|
+
*
|
|
37
|
+
* @param {Particle} particle The particle to add.
|
|
38
|
+
*/
|
|
17
39
|
push(particle) {
|
|
18
40
|
particle.next = this.first;
|
|
19
41
|
this.first = particle;
|
|
20
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Resets the particle pool.
|
|
45
|
+
*/
|
|
21
46
|
reset() {
|
|
22
47
|
this.first = null;
|
|
23
48
|
ParticlePool.global = new ParticlePool();
|
|
24
49
|
}
|
|
25
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* A static global instance of ParticlePool.
|
|
53
|
+
*/
|
|
26
54
|
ParticlePool.global = new ParticlePool();
|
|
27
55
|
//# sourceMappingURL=ParticlePool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParticlePool.js","sourceRoot":"","sources":["../../src/lib/ParticlePool.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,MAAM,CAAC,OAAO,OAAO,YAAY;IAAjC;
|
|
1
|
+
{"version":3,"file":"ParticlePool.js","sourceRoot":"","sources":["../../src/lib/ParticlePool.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAAjC;QAME;;WAEG;QACH,UAAK,GAAoB,IAAI,CAAA;IA0C/B,CAAC;IAxCC;;;;OAIG;IACH,GAAG;QACD,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC,MAAM,EAAE,CAAA;QAErC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAA;QAC1B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAA;QACzB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA;QACnB,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO,IAAI,QAAQ,EAAE,CAAA;IACvB,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,QAAkB;QACrB,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QAC1B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,YAAY,CAAC,MAAM,GAAG,IAAI,YAAY,EAAE,CAAA;IAC1C,CAAC;;AAjDD;;GAEG;AACI,mBAAM,GAAG,IAAI,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import Behaviour from './Behaviour';
|
|
2
2
|
import Particle from '../Particle';
|
|
3
|
+
/**
|
|
4
|
+
* AngularVelocityBehaviour is a subclass of Behaviour and defines the angular velocity of a particle.
|
|
5
|
+
*
|
|
6
|
+
* @class AngularVelocityBehaviour
|
|
7
|
+
* @extends {Behaviour}
|
|
8
|
+
*/
|
|
3
9
|
export default class AngularVelocityBehaviour extends Behaviour {
|
|
4
10
|
private enabled;
|
|
5
11
|
private degrees;
|
|
@@ -9,9 +15,34 @@ export default class AngularVelocityBehaviour extends Behaviour {
|
|
|
9
15
|
private minRadius;
|
|
10
16
|
private minRadiusVariance;
|
|
11
17
|
protected priority: number;
|
|
18
|
+
/**
|
|
19
|
+
* Initializes particle properties of the behaviour
|
|
20
|
+
*
|
|
21
|
+
* @param {Particle} particle - The current particle
|
|
22
|
+
* @memberof AngularVelocityBehaviour
|
|
23
|
+
*/
|
|
12
24
|
init: (particle: Particle) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Applies the behaviour to the particle
|
|
27
|
+
*
|
|
28
|
+
* @param {Particle} particle - The current particle
|
|
29
|
+
* @param {number} deltaTime - Time elapsed since the last frame
|
|
30
|
+
* @memberof AngularVelocityBehaviour
|
|
31
|
+
*/
|
|
13
32
|
apply: (particle: Particle, deltaTime: number) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the name of the behaviour
|
|
35
|
+
*
|
|
36
|
+
* @returns {string} Name of the behaviour
|
|
37
|
+
* @memberof AngularVelocityBehaviour
|
|
38
|
+
*/
|
|
14
39
|
getName(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the properties of the behaviour
|
|
42
|
+
*
|
|
43
|
+
* @returns {object} Properties of the behaviour
|
|
44
|
+
* @memberof AngularVelocityBehaviour
|
|
45
|
+
*/
|
|
15
46
|
getProps(): {
|
|
16
47
|
enabled: boolean;
|
|
17
48
|
degrees: number;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import Behaviour from './Behaviour';
|
|
2
2
|
import math from '../util/maths';
|
|
3
3
|
import BehaviourNames from './BehaviourNames';
|
|
4
|
+
/**
|
|
5
|
+
* AngularVelocityBehaviour is a subclass of Behaviour and defines the angular velocity of a particle.
|
|
6
|
+
*
|
|
7
|
+
* @class AngularVelocityBehaviour
|
|
8
|
+
* @extends {Behaviour}
|
|
9
|
+
*/
|
|
4
10
|
export default class AngularVelocityBehaviour extends Behaviour {
|
|
5
11
|
constructor() {
|
|
6
12
|
super(...arguments);
|
|
@@ -12,31 +18,58 @@ export default class AngularVelocityBehaviour extends Behaviour {
|
|
|
12
18
|
this.minRadius = 0;
|
|
13
19
|
this.minRadiusVariance = 0;
|
|
14
20
|
this.priority = 100;
|
|
21
|
+
/**
|
|
22
|
+
* Initializes particle properties of the behaviour
|
|
23
|
+
*
|
|
24
|
+
* @param {Particle} particle - The current particle
|
|
25
|
+
* @memberof AngularVelocityBehaviour
|
|
26
|
+
*/
|
|
15
27
|
this.init = (particle) => {
|
|
16
|
-
if (!this.enabled)
|
|
17
|
-
return;
|
|
18
28
|
particle.radiansPerSecond = math.degreesToRadians(this.degrees + this.varianceFrom(this.degreesVariance));
|
|
19
|
-
|
|
29
|
+
const radiusStart = this.maxRadius + this.varianceFrom(this.maxRadiusVariance);
|
|
30
|
+
particle.radiusStart = radiusStart;
|
|
20
31
|
particle.radiusEnd = this.minRadius + this.varianceFrom(this.minRadiusVariance);
|
|
21
32
|
particle.x = 0;
|
|
22
33
|
particle.y = 0;
|
|
23
|
-
particle.radius =
|
|
34
|
+
particle.radius = radiusStart;
|
|
24
35
|
particle.angle = 0;
|
|
25
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Applies the behaviour to the particle
|
|
39
|
+
*
|
|
40
|
+
* @param {Particle} particle - The current particle
|
|
41
|
+
* @param {number} deltaTime - Time elapsed since the last frame
|
|
42
|
+
* @memberof AngularVelocityBehaviour
|
|
43
|
+
*/
|
|
26
44
|
this.apply = (particle, deltaTime) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
particle.
|
|
33
|
-
particle.
|
|
34
|
-
particle.
|
|
45
|
+
const { radiusStart, radiusEnd, radiansPerSecond, lifeProgress } = particle;
|
|
46
|
+
const velocityAngle = particle.velocityAngle + radiansPerSecond * deltaTime;
|
|
47
|
+
const radius = radiusStart + (radiusEnd - radiusStart) * lifeProgress;
|
|
48
|
+
const movementX = Math.cos(velocityAngle) * radius;
|
|
49
|
+
const movementY = Math.sin(velocityAngle) * radius;
|
|
50
|
+
particle.velocityAngle = velocityAngle;
|
|
51
|
+
particle.radius = radius;
|
|
52
|
+
particle.movement.x = movementX;
|
|
53
|
+
particle.movement.y = movementY;
|
|
54
|
+
particle.x = movementX;
|
|
55
|
+
particle.y = movementY;
|
|
35
56
|
};
|
|
36
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns the name of the behaviour
|
|
60
|
+
*
|
|
61
|
+
* @returns {string} Name of the behaviour
|
|
62
|
+
* @memberof AngularVelocityBehaviour
|
|
63
|
+
*/
|
|
37
64
|
getName() {
|
|
38
65
|
return BehaviourNames.ANGULAR_BEHAVIOUR;
|
|
39
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns the properties of the behaviour
|
|
69
|
+
*
|
|
70
|
+
* @returns {object} Properties of the behaviour
|
|
71
|
+
* @memberof AngularVelocityBehaviour
|
|
72
|
+
*/
|
|
40
73
|
getProps() {
|
|
41
74
|
return {
|
|
42
75
|
enabled: this.enabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngularVelocityBehaviour.js","sourceRoot":"","sources":["../../../src/lib/behaviour/AngularVelocityBehaviour.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAG7C,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,SAAS;IAA/D;;QACU,YAAO,GAAY,KAAK,CAAA;QACxB,YAAO,GAAW,CAAC,CAAA;QACnB,oBAAe,GAAW,CAAC,CAAA;QAC3B,cAAS,GAAW,CAAC,CAAA;QACrB,sBAAiB,GAAW,CAAC,CAAA;QAC7B,cAAS,GAAW,CAAC,CAAA;QACrB,sBAAiB,GAAW,CAAC,CAAA;QAC3B,aAAQ,GAAW,GAAG,CAAA;QAEhC,SAAI,GAAG,CAAC,QAAkB,EAAE,EAAE;YAC5B,
|
|
1
|
+
{"version":3,"file":"AngularVelocityBehaviour.js","sourceRoot":"","sources":["../../../src/lib/behaviour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