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.
- package/README.md +119 -82
- package/package.json +5 -5
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/lib/Model.d.ts +0 -32
- package/dist/lib/Model.js +0 -44
- package/dist/lib/Model.js.map +0 -1
- package/dist/lib/Particle.d.ts +0 -220
- package/dist/lib/Particle.js +0 -172
- package/dist/lib/Particle.js.map +0 -1
- package/dist/lib/ParticlePool.d.ts +0 -37
- package/dist/lib/ParticlePool.js +0 -56
- package/dist/lib/ParticlePool.js.map +0 -1
- package/dist/lib/behaviour/AngularVelocityBehaviour.d.ts +0 -57
- package/dist/lib/behaviour/AngularVelocityBehaviour.js +0 -87
- package/dist/lib/behaviour/AngularVelocityBehaviour.js.map +0 -1
- package/dist/lib/behaviour/Behaviour.d.ts +0 -33
- package/dist/lib/behaviour/Behaviour.js +0 -45
- package/dist/lib/behaviour/Behaviour.js.map +0 -1
- package/dist/lib/behaviour/BehaviourNames.d.ts +0 -11
- package/dist/lib/behaviour/BehaviourNames.js +0 -11
- package/dist/lib/behaviour/BehaviourNames.js.map +0 -1
- package/dist/lib/behaviour/ColorBehaviour.d.ts +0 -45
- package/dist/lib/behaviour/ColorBehaviour.js +0 -77
- package/dist/lib/behaviour/ColorBehaviour.js.map +0 -1
- package/dist/lib/behaviour/EmitDirectionBehaviour.d.ts +0 -46
- package/dist/lib/behaviour/EmitDirectionBehaviour.js +0 -64
- package/dist/lib/behaviour/EmitDirectionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/EmitterBehaviours.d.ts +0 -63
- package/dist/lib/behaviour/EmitterBehaviours.js +0 -105
- package/dist/lib/behaviour/EmitterBehaviours.js.map +0 -1
- package/dist/lib/behaviour/LifeBehaviour.d.ts +0 -67
- package/dist/lib/behaviour/LifeBehaviour.js +0 -85
- package/dist/lib/behaviour/LifeBehaviour.js.map +0 -1
- package/dist/lib/behaviour/PositionBehaviour.d.ts +0 -177
- package/dist/lib/behaviour/PositionBehaviour.js +0 -534
- package/dist/lib/behaviour/PositionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/RotationBehaviour.d.ts +0 -51
- package/dist/lib/behaviour/RotationBehaviour.js +0 -66
- package/dist/lib/behaviour/RotationBehaviour.js.map +0 -1
- package/dist/lib/behaviour/SizeBehaviour.d.ts +0 -31
- package/dist/lib/behaviour/SizeBehaviour.js +0 -71
- package/dist/lib/behaviour/SizeBehaviour.js.map +0 -1
- package/dist/lib/behaviour/TurbulenceBehaviour.d.ts +0 -72
- package/dist/lib/behaviour/TurbulenceBehaviour.js +0 -128
- package/dist/lib/behaviour/TurbulenceBehaviour.js.map +0 -1
- package/dist/lib/behaviour/index.d.ts +0 -12
- package/dist/lib/behaviour/index.js +0 -13
- package/dist/lib/behaviour/index.js.map +0 -1
- package/dist/lib/customPixiParticlesSettingsInterface.d.ts +0 -18
- package/dist/lib/customPixiParticlesSettingsInterface.js +0 -2
- package/dist/lib/customPixiParticlesSettingsInterface.js.map +0 -1
- package/dist/lib/emission/AbstractEmission.d.ts +0 -30
- package/dist/lib/emission/AbstractEmission.js +0 -39
- package/dist/lib/emission/AbstractEmission.js.map +0 -1
- package/dist/lib/emission/EmissionTypes.d.ts +0 -6
- package/dist/lib/emission/EmissionTypes.js +0 -6
- package/dist/lib/emission/EmissionTypes.js.map +0 -1
- package/dist/lib/emission/RandomEmission.d.ts +0 -44
- package/dist/lib/emission/RandomEmission.js +0 -66
- package/dist/lib/emission/RandomEmission.js.map +0 -1
- package/dist/lib/emission/StandardEmission.d.ts +0 -62
- package/dist/lib/emission/StandardEmission.js +0 -87
- package/dist/lib/emission/StandardEmission.js.map +0 -1
- package/dist/lib/emission/UniformEmission.d.ts +0 -56
- package/dist/lib/emission/UniformEmission.js +0 -83
- package/dist/lib/emission/UniformEmission.js.map +0 -1
- package/dist/lib/emission/index.d.ts +0 -6
- package/dist/lib/emission/index.js +0 -7
- package/dist/lib/emission/index.js.map +0 -1
- package/dist/lib/emitter/Duration.d.ts +0 -27
- package/dist/lib/emitter/Duration.js +0 -41
- package/dist/lib/emitter/Duration.js.map +0 -1
- package/dist/lib/emitter/Emitter.d.ts +0 -113
- package/dist/lib/emitter/Emitter.js +0 -201
- package/dist/lib/emitter/Emitter.js.map +0 -1
- package/dist/lib/emitter/index.d.ts +0 -3
- package/dist/lib/emitter/index.js +0 -4
- package/dist/lib/emitter/index.js.map +0 -1
- package/dist/lib/index.d.ts +0 -20
- package/dist/lib/index.js +0 -21
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/parser/BehaviourParser.d.ts +0 -21
- package/dist/lib/parser/BehaviourParser.js +0 -72
- package/dist/lib/parser/BehaviourParser.js.map +0 -1
- package/dist/lib/parser/CompatibilityHelper.d.ts +0 -12
- package/dist/lib/parser/CompatibilityHelper.js +0 -19
- package/dist/lib/parser/CompatibilityHelper.js.map +0 -1
- package/dist/lib/parser/EmitControllerParser.d.ts +0 -27
- package/dist/lib/parser/EmitControllerParser.js +0 -39
- package/dist/lib/parser/EmitControllerParser.js.map +0 -1
- package/dist/lib/parser/EmitterParser.d.ts +0 -67
- package/dist/lib/parser/EmitterParser.js +0 -168
- package/dist/lib/parser/EmitterParser.js.map +0 -1
- package/dist/lib/parser/index.d.ts +0 -5
- package/dist/lib/parser/index.js +0 -6
- package/dist/lib/parser/index.js.map +0 -1
- package/dist/lib/pixi/Renderer.d.ts +0 -116
- package/dist/lib/pixi/Renderer.js +0 -508
- package/dist/lib/pixi/Renderer.js.map +0 -1
- package/dist/lib/util/Color.d.ts +0 -133
- package/dist/lib/util/Color.js +0 -173
- package/dist/lib/util/Color.js.map +0 -1
- package/dist/lib/util/List.d.ts +0 -49
- package/dist/lib/util/List.js +0 -87
- package/dist/lib/util/List.js.map +0 -1
- package/dist/lib/util/MinMax.d.ts +0 -34
- package/dist/lib/util/MinMax.js +0 -46
- package/dist/lib/util/MinMax.js.map +0 -1
- package/dist/lib/util/Point.d.ts +0 -34
- package/dist/lib/util/Point.js +0 -46
- package/dist/lib/util/Point.js.map +0 -1
- package/dist/lib/util/Random.d.ts +0 -24
- package/dist/lib/util/Random.js +0 -30
- package/dist/lib/util/Random.js.map +0 -1
- package/dist/lib/util/ThereBack.d.ts +0 -14
- package/dist/lib/util/ThereBack.js +0 -23
- package/dist/lib/util/ThereBack.js.map +0 -1
- package/dist/lib/util/index.d.ts +0 -5
- package/dist/lib/util/index.js +0 -6
- package/dist/lib/util/index.js.map +0 -1
- package/dist/lib/util/maths.d.ts +0 -10
- package/dist/lib/util/maths.js +0 -13
- package/dist/lib/util/maths.js.map +0 -1
- package/dist/lib/util/turbulencePool.d.ts +0 -4
- package/dist/lib/util/turbulencePool.js +0 -7
- package/dist/lib/util/turbulencePool.js.map +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { AbstractEmission } from './index';
|
|
2
|
-
/**
|
|
3
|
-
* The StandardEmission class is an abstract class extending from AbstractEmission.
|
|
4
|
-
*
|
|
5
|
-
* It provides methods for calculating the number of particles emitted
|
|
6
|
-
* in an interval of time and setting/getting the emission rate and maximum number of particles.
|
|
7
|
-
*
|
|
8
|
-
* @abstract
|
|
9
|
-
*/
|
|
10
|
-
export default class StandardEmission extends AbstractEmission {
|
|
11
|
-
/**
|
|
12
|
-
* The emitCounter field stores the counter for emission rate.
|
|
13
|
-
* @private
|
|
14
|
-
* @type {number}
|
|
15
|
-
*/
|
|
16
|
-
_emitCounter: number;
|
|
17
|
-
/**
|
|
18
|
-
* The maxParticles field stores the maximum number of particles allowed to be emitted.
|
|
19
|
-
* @private
|
|
20
|
-
* @type {number}
|
|
21
|
-
*/
|
|
22
|
-
_maxParticles: number;
|
|
23
|
-
/**
|
|
24
|
-
* Getter for the maxParticles field.
|
|
25
|
-
* @return {number} - The maximum number of particles allowed to be emitted.
|
|
26
|
-
*/
|
|
27
|
-
get maxParticles(): number;
|
|
28
|
-
/**
|
|
29
|
-
* Setter for the maxParticles field.
|
|
30
|
-
* @param {number} value - The new maximum number of particles allowed to be emitted.
|
|
31
|
-
*/
|
|
32
|
-
set maxParticles(value: number);
|
|
33
|
-
/**
|
|
34
|
-
* The emissionRate field stores the current rate of emission.
|
|
35
|
-
* @private
|
|
36
|
-
* @type {number}
|
|
37
|
-
*/
|
|
38
|
-
_emissionRate: number;
|
|
39
|
-
/**
|
|
40
|
-
* Getter for the emissionRate field.
|
|
41
|
-
* @return {number} - The current emission rate.
|
|
42
|
-
*/
|
|
43
|
-
get emissionRate(): number;
|
|
44
|
-
/**
|
|
45
|
-
* Setter for the emissionRate field.
|
|
46
|
-
* @param {number} value - The new emission rate.
|
|
47
|
-
*/
|
|
48
|
-
set emissionRate(value: number);
|
|
49
|
-
/**
|
|
50
|
-
* howMany() calculates how many particles should be emitted in the given interval of time.
|
|
51
|
-
*
|
|
52
|
-
* @param {number} deltaTime - The amount of time elapsed since the last emission.
|
|
53
|
-
* @param {number} particlesCount - The current number of particles.
|
|
54
|
-
* @return {number} - The number of particles to be emitted.
|
|
55
|
-
*/
|
|
56
|
-
howMany(deltaTime: number, particlesCount: number): number;
|
|
57
|
-
/**
|
|
58
|
-
* GetName() returns the type of the emission.
|
|
59
|
-
* @return {EmissionTypes} - The type of the emission.
|
|
60
|
-
*/
|
|
61
|
-
getName: () => string;
|
|
62
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { AbstractEmission, EmissionTypes } from './index';
|
|
2
|
-
/**
|
|
3
|
-
* The StandardEmission class is an abstract class extending from AbstractEmission.
|
|
4
|
-
*
|
|
5
|
-
* It provides methods for calculating the number of particles emitted
|
|
6
|
-
* in an interval of time and setting/getting the emission rate and maximum number of particles.
|
|
7
|
-
*
|
|
8
|
-
* @abstract
|
|
9
|
-
*/
|
|
10
|
-
export default class StandardEmission extends AbstractEmission {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
/**
|
|
14
|
-
* The emitCounter field stores the counter for emission rate.
|
|
15
|
-
* @private
|
|
16
|
-
* @type {number}
|
|
17
|
-
*/
|
|
18
|
-
this._emitCounter = 0;
|
|
19
|
-
/**
|
|
20
|
-
* The maxParticles field stores the maximum number of particles allowed to be emitted.
|
|
21
|
-
* @private
|
|
22
|
-
* @type {number}
|
|
23
|
-
*/
|
|
24
|
-
this._maxParticles = 0;
|
|
25
|
-
/**
|
|
26
|
-
* The emissionRate field stores the current rate of emission.
|
|
27
|
-
* @private
|
|
28
|
-
* @type {number}
|
|
29
|
-
*/
|
|
30
|
-
this._emissionRate = 0;
|
|
31
|
-
/**
|
|
32
|
-
* GetName() returns the type of the emission.
|
|
33
|
-
* @return {EmissionTypes} - The type of the emission.
|
|
34
|
-
*/
|
|
35
|
-
this.getName = () => {
|
|
36
|
-
return EmissionTypes.UNIFORM;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Getter for the maxParticles field.
|
|
41
|
-
* @return {number} - The maximum number of particles allowed to be emitted.
|
|
42
|
-
*/
|
|
43
|
-
get maxParticles() {
|
|
44
|
-
return this._maxParticles;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Setter for the maxParticles field.
|
|
48
|
-
* @param {number} value - The new maximum number of particles allowed to be emitted.
|
|
49
|
-
*/
|
|
50
|
-
set maxParticles(value) {
|
|
51
|
-
this._maxParticles = Math.max(0, value);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Getter for the emissionRate field.
|
|
55
|
-
* @return {number} - The current emission rate.
|
|
56
|
-
*/
|
|
57
|
-
get emissionRate() {
|
|
58
|
-
return this._emissionRate;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Setter for the emissionRate field.
|
|
62
|
-
* @param {number} value - The new emission rate.
|
|
63
|
-
*/
|
|
64
|
-
set emissionRate(value) {
|
|
65
|
-
this._emissionRate = Math.max(0, value);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* howMany() calculates how many particles should be emitted in the given interval of time.
|
|
69
|
-
*
|
|
70
|
-
* @param {number} deltaTime - The amount of time elapsed since the last emission.
|
|
71
|
-
* @param {number} particlesCount - The current number of particles.
|
|
72
|
-
* @return {number} - The number of particles to be emitted.
|
|
73
|
-
*/
|
|
74
|
-
howMany(deltaTime, particlesCount) {
|
|
75
|
-
const rate = 1.0 / this.emissionRate;
|
|
76
|
-
let count = 0;
|
|
77
|
-
if (particlesCount < this.maxParticles) {
|
|
78
|
-
this._emitCounter += deltaTime;
|
|
79
|
-
}
|
|
80
|
-
while (particlesCount < this.maxParticles && this._emitCounter > rate) {
|
|
81
|
-
count++;
|
|
82
|
-
this._emitCounter -= rate;
|
|
83
|
-
}
|
|
84
|
-
return count;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=StandardEmission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StandardEmission.js","sourceRoot":"","sources":["../../../src/lib/emission/StandardEmission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,gBAAgB;IAA9D;;QACE;;;;WAIG;QACH,iBAAY,GAAG,CAAC,CAAA;QAEhB;;;;WAIG;QACH,kBAAa,GAAG,CAAC,CAAA;QAkBjB;;;;WAIG;QACH,kBAAa,GAAG,CAAC,CAAA;QAwCjB;;;WAGG;QACH,YAAO,GAAG,GAAG,EAAE;YACb,OAAO,aAAa,CAAC,OAAO,CAAA;QAC9B,CAAC,CAAA;IACH,CAAC;IApEC;;;OAGG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,IAAI,YAAY,CAAC,KAAa;QAC5B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;IASD;;;OAGG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,IAAI,YAAY,CAAC,KAAa;QAC5B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,SAAiB,EAAE,cAAsB;QAC/C,MAAM,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,CAAA;QACpC,IAAI,KAAK,GAAG,CAAC,CAAA;QACb,IAAI,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACvC,IAAI,CAAC,YAAY,IAAI,SAAS,CAAA;QAChC,CAAC;QAED,OAAO,cAAc,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,EAAE,CAAC;YACtE,KAAK,EAAE,CAAA;YACP,IAAI,CAAC,YAAY,IAAI,IAAI,CAAA;QAC3B,CAAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC;CASF"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { AbstractEmission } from './index';
|
|
2
|
-
/**
|
|
3
|
-
* UniformEmission class is the implementation of the abstract class AbstractEmission.
|
|
4
|
-
* It implements the method howMany and has other methods to set and get the related data.
|
|
5
|
-
*
|
|
6
|
-
* @class UniformEmission
|
|
7
|
-
* @extends AbstractEmission
|
|
8
|
-
*/
|
|
9
|
-
export default class UniformEmission extends AbstractEmission {
|
|
10
|
-
_maxParticles: number;
|
|
11
|
-
_maxLife: number;
|
|
12
|
-
_emitPerSecond: number;
|
|
13
|
-
_frames: number;
|
|
14
|
-
/**
|
|
15
|
-
* Calculates the number of particles to emit.
|
|
16
|
-
*
|
|
17
|
-
* @param {number} deltaTime - The elapsed time between frames.
|
|
18
|
-
* @param {number} particlesCount - The current number of particles on the screen.
|
|
19
|
-
* @returns {number} The number of particles to emit in the current frame.
|
|
20
|
-
*/
|
|
21
|
-
howMany(deltaTime: number, particlesCount: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* Recalculates the emitPerSecond value based on the maxParticles and maxLife values.
|
|
24
|
-
*/
|
|
25
|
-
refresh(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Sets the maxLife value and calls refresh() to recalculate the emitPerSecond.
|
|
28
|
-
*
|
|
29
|
-
* @param {number} value - The new maxLife value.
|
|
30
|
-
*/
|
|
31
|
-
set maxLife(value: number);
|
|
32
|
-
/**
|
|
33
|
-
* Sets the maxParticles value and calls refresh() to recalculate the emitPerSecond.
|
|
34
|
-
*
|
|
35
|
-
* @param {number} value - The new maxParticles value.
|
|
36
|
-
*/
|
|
37
|
-
set maxParticles(value: number);
|
|
38
|
-
/**
|
|
39
|
-
* Returns the emitPerSecond value.
|
|
40
|
-
*
|
|
41
|
-
* @returns {number} The emitPerSecond value.
|
|
42
|
-
*/
|
|
43
|
-
get emitPerSecond(): number;
|
|
44
|
-
/**
|
|
45
|
-
* Sets the emitPerSecond value.
|
|
46
|
-
*
|
|
47
|
-
* @param {number} value - The new emitPerSecond value.
|
|
48
|
-
*/
|
|
49
|
-
set emitPerSecond(value: number);
|
|
50
|
-
/**
|
|
51
|
-
* Returns EmissionTypes.DEFAULT.
|
|
52
|
-
*
|
|
53
|
-
* @returns {string} EmissionTypes.DEFAULT.
|
|
54
|
-
*/
|
|
55
|
-
getName: () => string;
|
|
56
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { AbstractEmission, EmissionTypes } from './index';
|
|
2
|
-
/**
|
|
3
|
-
* UniformEmission class is the implementation of the abstract class AbstractEmission.
|
|
4
|
-
* It implements the method howMany and has other methods to set and get the related data.
|
|
5
|
-
*
|
|
6
|
-
* @class UniformEmission
|
|
7
|
-
* @extends AbstractEmission
|
|
8
|
-
*/
|
|
9
|
-
export default class UniformEmission extends AbstractEmission {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this._maxParticles = 0;
|
|
13
|
-
this._maxLife = 1;
|
|
14
|
-
this._emitPerSecond = 0;
|
|
15
|
-
this._frames = 0;
|
|
16
|
-
/**
|
|
17
|
-
* Returns EmissionTypes.DEFAULT.
|
|
18
|
-
*
|
|
19
|
-
* @returns {string} EmissionTypes.DEFAULT.
|
|
20
|
-
*/
|
|
21
|
-
this.getName = () => {
|
|
22
|
-
return EmissionTypes.DEFAULT;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Calculates the number of particles to emit.
|
|
27
|
-
*
|
|
28
|
-
* @param {number} deltaTime - The elapsed time between frames.
|
|
29
|
-
* @param {number} particlesCount - The current number of particles on the screen.
|
|
30
|
-
* @returns {number} The number of particles to emit in the current frame.
|
|
31
|
-
*/
|
|
32
|
-
howMany(deltaTime, particlesCount) {
|
|
33
|
-
const ratio = this._emitPerSecond * deltaTime;
|
|
34
|
-
this._frames += ratio;
|
|
35
|
-
let numberToEmit = 0;
|
|
36
|
-
if (this._frames >= 1.0) {
|
|
37
|
-
numberToEmit = Math.round(this._frames);
|
|
38
|
-
this._frames = 0;
|
|
39
|
-
}
|
|
40
|
-
return numberToEmit;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Recalculates the emitPerSecond value based on the maxParticles and maxLife values.
|
|
44
|
-
*/
|
|
45
|
-
refresh() {
|
|
46
|
-
this.emitPerSecond = this._maxParticles / this._maxLife;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Sets the maxLife value and calls refresh() to recalculate the emitPerSecond.
|
|
50
|
-
*
|
|
51
|
-
* @param {number} value - The new maxLife value.
|
|
52
|
-
*/
|
|
53
|
-
set maxLife(value) {
|
|
54
|
-
this._maxLife = Math.max(value, 1);
|
|
55
|
-
this.refresh();
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Sets the maxParticles value and calls refresh() to recalculate the emitPerSecond.
|
|
59
|
-
*
|
|
60
|
-
* @param {number} value - The new maxParticles value.
|
|
61
|
-
*/
|
|
62
|
-
set maxParticles(value) {
|
|
63
|
-
this._maxParticles = Math.max(value, 0);
|
|
64
|
-
this.refresh();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Returns the emitPerSecond value.
|
|
68
|
-
*
|
|
69
|
-
* @returns {number} The emitPerSecond value.
|
|
70
|
-
*/
|
|
71
|
-
get emitPerSecond() {
|
|
72
|
-
return this._emitPerSecond;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Sets the emitPerSecond value.
|
|
76
|
-
*
|
|
77
|
-
* @param {number} value - The new emitPerSecond value.
|
|
78
|
-
*/
|
|
79
|
-
set emitPerSecond(value) {
|
|
80
|
-
this._emitPerSecond = Math.max(value, 0);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=UniformEmission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UniformEmission.js","sourceRoot":"","sources":["../../../src/lib/emission/UniformEmission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,gBAAgB;IAA7D;;QACE,kBAAa,GAAG,CAAC,CAAA;QACjB,aAAQ,GAAG,CAAC,CAAA;QACZ,mBAAc,GAAG,CAAC,CAAA;QAClB,YAAO,GAAG,CAAC,CAAA;QAmEX;;;;WAIG;QACH,YAAO,GAAG,GAAG,EAAE;YACb,OAAO,aAAa,CAAC,OAAO,CAAA;QAC9B,CAAC,CAAA;IACH,CAAC;IAzEC;;;;;;OAMG;IACH,OAAO,CAAC,SAAiB,EAAE,cAAsB;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,GAAG,SAAS,CAAA;QAC7C,IAAI,CAAC,OAAO,IAAI,KAAK,CAAA;QAErB,IAAI,YAAY,GAAG,CAAC,CAAA;QACpB,IAAI,IAAI,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC;YACxB,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACvC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;QAClB,CAAC;QAED,OAAO,YAAY,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAA;IACzD,CAAC;IAED;;;;OAIG;IACH,IAAI,OAAO,CAAC,KAAa;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAClC,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;IAED;;;;OAIG;IACH,IAAI,YAAY,CAAC,KAAa;QAC5B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACvC,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;IAED;;;;OAIG;IACH,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAA;IAC5B,CAAC;IAED;;;;OAIG;IACH,IAAI,aAAa,CAAC,KAAa;QAC7B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC1C,CAAC;CAUF"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import EmissionTypes from './EmissionTypes';
|
|
2
|
-
import AbstractEmission from './AbstractEmission';
|
|
3
|
-
import UniformEmission from './UniformEmission';
|
|
4
|
-
import RandomEmission from './RandomEmission';
|
|
5
|
-
import StandardEmission from './StandardEmission';
|
|
6
|
-
export { EmissionTypes, AbstractEmission, UniformEmission, RandomEmission, StandardEmission };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import EmissionTypes from './EmissionTypes';
|
|
2
|
-
import AbstractEmission from './AbstractEmission';
|
|
3
|
-
import UniformEmission from './UniformEmission';
|
|
4
|
-
import RandomEmission from './RandomEmission';
|
|
5
|
-
import StandardEmission from './StandardEmission';
|
|
6
|
-
export { EmissionTypes, AbstractEmission, UniformEmission, RandomEmission, StandardEmission };
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/emission/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default class Duration {
|
|
2
|
-
maxTime: number;
|
|
3
|
-
private _stop;
|
|
4
|
-
private _elapsedTime;
|
|
5
|
-
/**
|
|
6
|
-
* Checks if the time has elapsed.
|
|
7
|
-
* @returns {boolean} Returns true if the time is elapsed, false otherwise.
|
|
8
|
-
*/
|
|
9
|
-
isTimeElapsed: () => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Updates the elapsed time.
|
|
12
|
-
* @param {number} deltaTime - The amount of time that has passed since the last update.
|
|
13
|
-
*/
|
|
14
|
-
update: (deltaTime: number) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Resets the elapsed time.
|
|
17
|
-
*/
|
|
18
|
-
reset: () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Stops the elapsed time.
|
|
21
|
-
*/
|
|
22
|
-
stop: () => void;
|
|
23
|
-
/**
|
|
24
|
-
* Starts the elapsed time.
|
|
25
|
-
*/
|
|
26
|
-
start: () => void;
|
|
27
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export default class Duration {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.maxTime = -1;
|
|
4
|
-
this._stop = false;
|
|
5
|
-
this._elapsedTime = 0;
|
|
6
|
-
/**
|
|
7
|
-
* Checks if the time has elapsed.
|
|
8
|
-
* @returns {boolean} Returns true if the time is elapsed, false otherwise.
|
|
9
|
-
*/
|
|
10
|
-
this.isTimeElapsed = () => {
|
|
11
|
-
return this._stop || (this.maxTime > 0 && this._elapsedTime >= this.maxTime);
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Updates the elapsed time.
|
|
15
|
-
* @param {number} deltaTime - The amount of time that has passed since the last update.
|
|
16
|
-
*/
|
|
17
|
-
this.update = (deltaTime) => {
|
|
18
|
-
this._elapsedTime += deltaTime;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Resets the elapsed time.
|
|
22
|
-
*/
|
|
23
|
-
this.reset = () => {
|
|
24
|
-
this._stop = false;
|
|
25
|
-
this._elapsedTime = 0;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Stops the elapsed time.
|
|
29
|
-
*/
|
|
30
|
-
this.stop = () => {
|
|
31
|
-
this._stop = true;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Starts the elapsed time.
|
|
35
|
-
*/
|
|
36
|
-
this.start = () => {
|
|
37
|
-
this._stop = false;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=Duration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Duration.js","sourceRoot":"","sources":["../../../src/lib/emitter/Duration.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,QAAQ;IAA7B;QACE,YAAO,GAAW,CAAC,CAAC,CAAA;QACZ,UAAK,GAAY,KAAK,CAAA;QACtB,iBAAY,GAAW,CAAC,CAAA;QAEhC;;;WAGG;QACH,kBAAa,GAAG,GAAG,EAAE;YACnB,OAAO,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9E,CAAC,CAAA;QAED;;;WAGG;QACH,WAAM,GAAG,CAAC,SAAiB,EAAE,EAAE;YAC7B,IAAI,CAAC,YAAY,IAAI,SAAS,CAAA;QAChC,CAAC,CAAA;QAED;;WAEG;QACH,UAAK,GAAG,GAAG,EAAE;YACX,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;YAClB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAA;QACvB,CAAC,CAAA;QAED;;WAEG;QACH,SAAI,GAAG,GAAG,EAAE;YACV,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACnB,CAAC,CAAA;QAED;;WAEG;QACH,UAAK,GAAG,GAAG,EAAE;YACX,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,CAAC,CAAA;IACH,CAAC;CAAA"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import Duration from './Duration';
|
|
2
|
-
import { EmitterBehaviours } from '../behaviour';
|
|
3
|
-
import eventemitter3 from 'eventemitter3';
|
|
4
|
-
import { EmitterParser } from '../parser';
|
|
5
|
-
import List from '../util/List';
|
|
6
|
-
import Particle from '../Particle';
|
|
7
|
-
import { BLEND_MODES } from 'pixi.js-legacy';
|
|
8
|
-
import Model from '../Model';
|
|
9
|
-
import TurbulencePool from '../util/turbulencePool';
|
|
10
|
-
export default class Emitter extends eventemitter3 {
|
|
11
|
-
static STOP: string;
|
|
12
|
-
static RESET: string;
|
|
13
|
-
static CREATE: string;
|
|
14
|
-
static UPDATE: string;
|
|
15
|
-
static REMOVE: string;
|
|
16
|
-
static FINISHING: string;
|
|
17
|
-
static COMPLETE: string;
|
|
18
|
-
list: List;
|
|
19
|
-
duration: Duration;
|
|
20
|
-
animatedSprite: {
|
|
21
|
-
loop: boolean;
|
|
22
|
-
frameRate: number;
|
|
23
|
-
randomFrameStart: number;
|
|
24
|
-
};
|
|
25
|
-
alpha: number;
|
|
26
|
-
anchor: {
|
|
27
|
-
x: number;
|
|
28
|
-
y: number;
|
|
29
|
-
};
|
|
30
|
-
blendMode: BLEND_MODES;
|
|
31
|
-
behaviours: EmitterBehaviours;
|
|
32
|
-
emitController: any;
|
|
33
|
-
turbulencePool: TurbulencePool;
|
|
34
|
-
private _play;
|
|
35
|
-
private _model;
|
|
36
|
-
constructor(model: Model);
|
|
37
|
-
/**
|
|
38
|
-
* Updates the emitter, emits particles and updates the particles.
|
|
39
|
-
* Triggers the COMPLETE event when the duration is elapsed and the list is empty.
|
|
40
|
-
* @param {number} deltaTime - Time elapsed since the last update
|
|
41
|
-
*/
|
|
42
|
-
update(deltaTime: number): Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Emits particles if the duration is not elapsed.
|
|
45
|
-
* @param {number} deltaTime - Time elapsed since the last update
|
|
46
|
-
*/
|
|
47
|
-
emitParticles(deltaTime: number): void;
|
|
48
|
-
/**
|
|
49
|
-
* Creates the particles to be emitted.
|
|
50
|
-
* Triggers the CREATE event when a particle is created.
|
|
51
|
-
* @param {number} deltaTime - Time elapsed since the last update
|
|
52
|
-
*/
|
|
53
|
-
createParticles(deltaTime: number): void;
|
|
54
|
-
/**
|
|
55
|
-
* Updates the list of particles
|
|
56
|
-
* @param {number} deltaTime - The amount of time that has passed since the last update
|
|
57
|
-
*/
|
|
58
|
-
updateParticles(deltaTime: number): void;
|
|
59
|
-
/**
|
|
60
|
-
* Updates a single particle
|
|
61
|
-
* @param {Particle} particle - The particle to update
|
|
62
|
-
* @param {number} deltaTime - The amount of time that has passed since the last update
|
|
63
|
-
*/
|
|
64
|
-
updateParticle(particle: Particle, deltaTime: number): void;
|
|
65
|
-
/**
|
|
66
|
-
* Removes a particle from the list and reset it
|
|
67
|
-
* @param {Particle} particle - The particle to remove
|
|
68
|
-
*/
|
|
69
|
-
removeParticle(particle: Particle): void;
|
|
70
|
-
/**
|
|
71
|
-
* Gets a parser to parse the emitter and it's particles
|
|
72
|
-
* @returns {EmitterParser} - The parser for this emitter
|
|
73
|
-
*/
|
|
74
|
-
getParser(): EmitterParser;
|
|
75
|
-
/**
|
|
76
|
-
* Creates props for a behaviour
|
|
77
|
-
* @param {string} name - The name of the behaviour
|
|
78
|
-
* @returns {Object} - The props for the behaviour
|
|
79
|
-
*/
|
|
80
|
-
createBehaviourProps(name: string): any;
|
|
81
|
-
/**
|
|
82
|
-
* Starts the emitter playing
|
|
83
|
-
*/
|
|
84
|
-
play(): void;
|
|
85
|
-
/**
|
|
86
|
-
* Resets the emitter and starts playing
|
|
87
|
-
*/
|
|
88
|
-
resetAndPlay(): void;
|
|
89
|
-
/**
|
|
90
|
-
* Resets the emitter without removing the particles and starts playing
|
|
91
|
-
*/
|
|
92
|
-
resetWithoutRemovingAndPlay(): void;
|
|
93
|
-
/**
|
|
94
|
-
* Resets the emitter and removes all the particles
|
|
95
|
-
*/
|
|
96
|
-
reset(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Resets the emitter without removing the particles
|
|
99
|
-
*/
|
|
100
|
-
resetWithoutRemoving(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Stops the emitter and removes all the particles
|
|
103
|
-
*/
|
|
104
|
-
stop(): void;
|
|
105
|
-
/**
|
|
106
|
-
* Stops the emitter without killing the particles
|
|
107
|
-
*/
|
|
108
|
-
stopWithoutKilling(): void;
|
|
109
|
-
/**
|
|
110
|
-
* Removes all the particles from the list
|
|
111
|
-
*/
|
|
112
|
-
removeParticles(): void;
|
|
113
|
-
}
|