custom-pixi-particles 8.1.0 → 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.
- package/package.json +3 -3
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -45
- 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 -234
- package/dist/lib/Particle.js +0 -201
- 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 -61
- package/dist/lib/behaviour/AngularVelocityBehaviour.js +0 -118
- package/dist/lib/behaviour/AngularVelocityBehaviour.js.map +0 -1
- package/dist/lib/behaviour/AttractionRepulsionBehaviour.d.ts +0 -42
- package/dist/lib/behaviour/AttractionRepulsionBehaviour.js +0 -78
- package/dist/lib/behaviour/AttractionRepulsionBehaviour.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 -22
- package/dist/lib/behaviour/BehaviourNames.js +0 -23
- package/dist/lib/behaviour/BehaviourNames.js.map +0 -1
- package/dist/lib/behaviour/CollisionBehaviour.d.ts +0 -86
- package/dist/lib/behaviour/CollisionBehaviour.js +0 -140
- package/dist/lib/behaviour/CollisionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/ColorBehaviour.d.ts +0 -67
- package/dist/lib/behaviour/ColorBehaviour.js +0 -193
- package/dist/lib/behaviour/ColorBehaviour.js.map +0 -1
- package/dist/lib/behaviour/EmitDirectionBehaviour.d.ts +0 -52
- package/dist/lib/behaviour/EmitDirectionBehaviour.js +0 -105
- package/dist/lib/behaviour/EmitDirectionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/EmitterBehaviours.d.ts +0 -69
- package/dist/lib/behaviour/EmitterBehaviours.js +0 -116
- package/dist/lib/behaviour/EmitterBehaviours.js.map +0 -1
- package/dist/lib/behaviour/ForceFieldsBehaviour.d.ts +0 -53
- package/dist/lib/behaviour/ForceFieldsBehaviour.js +0 -80
- package/dist/lib/behaviour/ForceFieldsBehaviour.js.map +0 -1
- package/dist/lib/behaviour/GroupingBehaviour.d.ts +0 -57
- package/dist/lib/behaviour/GroupingBehaviour.js +0 -143
- package/dist/lib/behaviour/GroupingBehaviour.js.map +0 -1
- package/dist/lib/behaviour/LifeBehaviour.d.ts +0 -47
- package/dist/lib/behaviour/LifeBehaviour.js +0 -65
- package/dist/lib/behaviour/LifeBehaviour.js.map +0 -1
- package/dist/lib/behaviour/LightEffectBehaviour.d.ts +0 -59
- package/dist/lib/behaviour/LightEffectBehaviour.js +0 -94
- package/dist/lib/behaviour/LightEffectBehaviour.js.map +0 -1
- package/dist/lib/behaviour/NoiseBasedMotionBehaviour.d.ts +0 -28
- package/dist/lib/behaviour/NoiseBasedMotionBehaviour.js +0 -50
- package/dist/lib/behaviour/NoiseBasedMotionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/PositionBehaviour.d.ts +0 -164
- package/dist/lib/behaviour/PositionBehaviour.js +0 -484
- package/dist/lib/behaviour/PositionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/RotationBehaviour.d.ts +0 -59
- package/dist/lib/behaviour/RotationBehaviour.js +0 -100
- package/dist/lib/behaviour/RotationBehaviour.js.map +0 -1
- package/dist/lib/behaviour/SizeBehaviour.d.ts +0 -61
- package/dist/lib/behaviour/SizeBehaviour.js +0 -156
- package/dist/lib/behaviour/SizeBehaviour.js.map +0 -1
- package/dist/lib/behaviour/SoundReactiveBehaviour.d.ts +0 -58
- package/dist/lib/behaviour/SoundReactiveBehaviour.js +0 -132
- package/dist/lib/behaviour/SoundReactiveBehaviour.js.map +0 -1
- package/dist/lib/behaviour/SpawnBehaviour.d.ts +0 -89
- package/dist/lib/behaviour/SpawnBehaviour.js +0 -705
- package/dist/lib/behaviour/SpawnBehaviour.js.map +0 -1
- package/dist/lib/behaviour/StretchBehaviour.d.ts +0 -30
- package/dist/lib/behaviour/StretchBehaviour.js +0 -59
- package/dist/lib/behaviour/StretchBehaviour.js.map +0 -1
- package/dist/lib/behaviour/TemperatureBehaviour.d.ts +0 -47
- package/dist/lib/behaviour/TemperatureBehaviour.js +0 -64
- package/dist/lib/behaviour/TemperatureBehaviour.js.map +0 -1
- package/dist/lib/behaviour/TimelineBehaviour.d.ts +0 -73
- package/dist/lib/behaviour/TimelineBehaviour.js +0 -100
- package/dist/lib/behaviour/TimelineBehaviour.js.map +0 -1
- package/dist/lib/behaviour/TurbulenceBehaviour.d.ts +0 -73
- package/dist/lib/behaviour/TurbulenceBehaviour.js +0 -133
- package/dist/lib/behaviour/TurbulenceBehaviour.js.map +0 -1
- package/dist/lib/behaviour/index.d.ts +0 -23
- package/dist/lib/behaviour/index.js +0 -24
- package/dist/lib/behaviour/index.js.map +0 -1
- package/dist/lib/customPixiParticlesSettingsInterface.d.ts +0 -19
- 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 -116
- package/dist/lib/emitter/Emitter.js +0 -240
- 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 -125
- package/dist/lib/pixi/Renderer.js +0 -560
- package/dist/lib/pixi/Renderer.js.map +0 -1
- package/dist/lib/pixi/TestRenderer.d.ts +0 -125
- package/dist/lib/pixi/TestRenderer.js +0 -560
- package/dist/lib/pixi/TestRenderer.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,133 +0,0 @@
|
|
|
1
|
-
import Behaviour from './Behaviour';
|
|
2
|
-
import BehaviourNames from './BehaviourNames';
|
|
3
|
-
import { Point } from '../util';
|
|
4
|
-
export default class TurbulenceBehaviour extends Behaviour {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.priority = 1000;
|
|
8
|
-
this.position = new Point();
|
|
9
|
-
this.positionVariance = new Point();
|
|
10
|
-
this.velocity = new Point();
|
|
11
|
-
this.velocityVariance = new Point();
|
|
12
|
-
this.acceleration = new Point();
|
|
13
|
-
this.accelerationVariance = new Point();
|
|
14
|
-
this.sizeStart = new Point(1, 1);
|
|
15
|
-
this.sizeEnd = new Point(1, 1);
|
|
16
|
-
this.startVariance = 0;
|
|
17
|
-
this.endVariance = 0;
|
|
18
|
-
this.emitPerSecond = 0;
|
|
19
|
-
this.duration = 0;
|
|
20
|
-
this.maxLifeTime = 0;
|
|
21
|
-
this.enabled = false;
|
|
22
|
-
this.showVortices = false;
|
|
23
|
-
this.effect = 0;
|
|
24
|
-
this.turbulence = false;
|
|
25
|
-
this.vortexOrgSize = 128;
|
|
26
|
-
this.init = (particle, model, turbulencePool) => {
|
|
27
|
-
if (!this.enabled)
|
|
28
|
-
return;
|
|
29
|
-
particle.showVortices = this.showVortices;
|
|
30
|
-
particle.turbulence = this.turbulence;
|
|
31
|
-
this.turbulencePool = turbulencePool;
|
|
32
|
-
};
|
|
33
|
-
this.apply = (particle) => {
|
|
34
|
-
if (!this.enabled)
|
|
35
|
-
return;
|
|
36
|
-
if (particle.turbulence)
|
|
37
|
-
return;
|
|
38
|
-
this.turbulencePool.list.forEach((vortex) => {
|
|
39
|
-
let vx = 0;
|
|
40
|
-
let vy = 0;
|
|
41
|
-
let factor = 0;
|
|
42
|
-
const dx = particle.x - vortex.x;
|
|
43
|
-
const dy = particle.y - vortex.y;
|
|
44
|
-
if (dx > this.vortexOrgSize * vortex.size.x)
|
|
45
|
-
return;
|
|
46
|
-
if (dy > this.vortexOrgSize * vortex.size.x)
|
|
47
|
-
return;
|
|
48
|
-
if (this.effect === 0 || this.effect === 1) {
|
|
49
|
-
if (!this.effect) {
|
|
50
|
-
vx = -dy + vortex.velocity.x;
|
|
51
|
-
vy = dx + vortex.velocity.y;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
vx = dy + vortex.velocity.x;
|
|
55
|
-
vy = -dx + vortex.velocity.y;
|
|
56
|
-
}
|
|
57
|
-
factor = 1 / (1 + (dx * dx + dy * dy) / (this.vortexOrgSize * vortex.size.x));
|
|
58
|
-
}
|
|
59
|
-
else if (this.effect === 2) {
|
|
60
|
-
vx = dx + vortex.velocity.x;
|
|
61
|
-
vy = dy + vortex.velocity.y;
|
|
62
|
-
factor = 1 / (1 + (dx * dx + dy * dy) / (this.vortexOrgSize * vortex.size.x));
|
|
63
|
-
}
|
|
64
|
-
else if (this.effect === 3) {
|
|
65
|
-
vx = dx - vortex.velocity.x;
|
|
66
|
-
vy = dy - vortex.velocity.y;
|
|
67
|
-
factor = 1 / (1 + (dx * dx + dy * dy) / (this.vortexOrgSize * vortex.size.x));
|
|
68
|
-
}
|
|
69
|
-
else if (this.effect === 4) {
|
|
70
|
-
vx = -dx + vortex.velocity.x;
|
|
71
|
-
vy = -dy + vortex.velocity.y;
|
|
72
|
-
factor = 1 / (1 + (dx * dx + dy * dy) / (this.vortexOrgSize * vortex.size.x));
|
|
73
|
-
}
|
|
74
|
-
else if (this.effect === 5) {
|
|
75
|
-
vx = -dx - vortex.velocity.x;
|
|
76
|
-
vy = -dy - vortex.velocity.y;
|
|
77
|
-
factor = 1 / (1 + (dx * dx + dy * dy) / (this.vortexOrgSize * vortex.size.x));
|
|
78
|
-
}
|
|
79
|
-
particle.velocity.x += (vx - particle.velocity.x) * factor;
|
|
80
|
-
particle.velocity.y += (vy - particle.velocity.y) * factor;
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
getName() {
|
|
85
|
-
return BehaviourNames.TURBULENCE_BEHAVIOUR;
|
|
86
|
-
}
|
|
87
|
-
getProps() {
|
|
88
|
-
return {
|
|
89
|
-
enabled: this.enabled,
|
|
90
|
-
priority: this.priority,
|
|
91
|
-
position: {
|
|
92
|
-
x: this.position.x,
|
|
93
|
-
y: this.position.y,
|
|
94
|
-
},
|
|
95
|
-
positionVariance: {
|
|
96
|
-
x: this.positionVariance.x,
|
|
97
|
-
y: this.positionVariance.y,
|
|
98
|
-
},
|
|
99
|
-
velocity: {
|
|
100
|
-
x: this.velocity.x,
|
|
101
|
-
y: this.velocity.y,
|
|
102
|
-
},
|
|
103
|
-
velocityVariance: {
|
|
104
|
-
x: this.velocityVariance.x,
|
|
105
|
-
y: this.velocityVariance.y,
|
|
106
|
-
},
|
|
107
|
-
acceleration: {
|
|
108
|
-
x: this.acceleration.x,
|
|
109
|
-
y: this.acceleration.y,
|
|
110
|
-
},
|
|
111
|
-
accelerationVariance: {
|
|
112
|
-
x: this.accelerationVariance.x,
|
|
113
|
-
y: this.accelerationVariance.y,
|
|
114
|
-
},
|
|
115
|
-
sizeStart: {
|
|
116
|
-
x: this.sizeStart.x,
|
|
117
|
-
y: this.sizeStart.y,
|
|
118
|
-
},
|
|
119
|
-
sizeEnd: {
|
|
120
|
-
x: this.sizeEnd.x,
|
|
121
|
-
y: this.sizeEnd.y,
|
|
122
|
-
},
|
|
123
|
-
startVariance: this.startVariance,
|
|
124
|
-
endVariance: this.endVariance,
|
|
125
|
-
emitPerSecond: this.emitPerSecond,
|
|
126
|
-
duration: this.duration,
|
|
127
|
-
maxLifeTime: this.maxLifeTime,
|
|
128
|
-
effect: this.effect,
|
|
129
|
-
name: this.getName(),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=TurbulenceBehaviour.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TurbulenceBehaviour.js","sourceRoot":"","sources":["../../../src/lib/behaviour/TurbulenceBehaviour.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAI/B,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,SAAS;IAA1D;;QACE,aAAQ,GAAG,IAAI,CAAA;QACf,aAAQ,GAAG,IAAI,KAAK,EAAE,CAAA;QACtB,qBAAgB,GAAG,IAAI,KAAK,EAAE,CAAA;QAC9B,aAAQ,GAAG,IAAI,KAAK,EAAE,CAAA;QACtB,qBAAgB,GAAG,IAAI,KAAK,EAAE,CAAA;QAC9B,iBAAY,GAAG,IAAI,KAAK,EAAE,CAAA;QAC1B,yBA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AC,CAAC;aAC/B;YACD,SAAS,EAAE;gBACT,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBACnB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;aACpB;YACD,OAAO,EAAE;gBACP,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBACjB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;aAClB;YACD,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;SACrB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import BehaviourNames from './BehaviourNames';
|
|
2
|
-
import EmitterBehaviours from './EmitterBehaviours';
|
|
3
|
-
import Behaviour from './Behaviour';
|
|
4
|
-
import LifeBehaviour from './LifeBehaviour';
|
|
5
|
-
import PositionBehaviour from './PositionBehaviour';
|
|
6
|
-
import ColorBehaviour from './ColorBehaviour';
|
|
7
|
-
import AttractionRepulsionBehaviour from './AttractionRepulsionBehaviour';
|
|
8
|
-
import SizeBehaviour from './SizeBehaviour';
|
|
9
|
-
import AngularVelocityBehaviour from './AngularVelocityBehaviour';
|
|
10
|
-
import EmitDirectionBehaviour from './EmitDirectionBehaviour';
|
|
11
|
-
import RotationBehaviour from './RotationBehaviour';
|
|
12
|
-
import TurbulenceBehaviour from './TurbulenceBehaviour';
|
|
13
|
-
import CollisionBehaviour from './CollisionBehaviour';
|
|
14
|
-
import NoiseBasedMotionBehaviour from './NoiseBasedMotionBehaviour';
|
|
15
|
-
import ForceFieldsBehaviour from './ForceFieldsBehaviour';
|
|
16
|
-
import SpawnBehaviour from './SpawnBehaviour';
|
|
17
|
-
import TimelineBehaviour from './TimelineBehaviour';
|
|
18
|
-
import GroupingBehaviour from './GroupingBehaviour';
|
|
19
|
-
import SoundReactiveBehaviour from './SoundReactiveBehaviour';
|
|
20
|
-
import LightEffectBehaviour from './LightEffectBehaviour';
|
|
21
|
-
import StretchBehaviour from './StretchBehaviour';
|
|
22
|
-
import TemperatureBehaviour from './TemperatureBehaviour';
|
|
23
|
-
export { EmitterBehaviours, Behaviour, SpawnBehaviour, LifeBehaviour, PositionBehaviour, ColorBehaviour, SizeBehaviour, AngularVelocityBehaviour, EmitDirectionBehaviour, RotationBehaviour, TurbulenceBehaviour, CollisionBehaviour, AttractionRepulsionBehaviour, NoiseBasedMotionBehaviour, ForceFieldsBehaviour, TimelineBehaviour, GroupingBehaviour, SoundReactiveBehaviour, LightEffectBehaviour, StretchBehaviour, TemperatureBehaviour, BehaviourNames, };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import BehaviourNames from './BehaviourNames';
|
|
2
|
-
import EmitterBehaviours from './EmitterBehaviours';
|
|
3
|
-
import Behaviour from './Behaviour';
|
|
4
|
-
import LifeBehaviour from './LifeBehaviour';
|
|
5
|
-
import PositionBehaviour from './PositionBehaviour';
|
|
6
|
-
import ColorBehaviour from './ColorBehaviour';
|
|
7
|
-
import AttractionRepulsionBehaviour from './AttractionRepulsionBehaviour';
|
|
8
|
-
import SizeBehaviour from './SizeBehaviour';
|
|
9
|
-
import AngularVelocityBehaviour from './AngularVelocityBehaviour';
|
|
10
|
-
import EmitDirectionBehaviour from './EmitDirectionBehaviour';
|
|
11
|
-
import RotationBehaviour from './RotationBehaviour';
|
|
12
|
-
import TurbulenceBehaviour from './TurbulenceBehaviour';
|
|
13
|
-
import CollisionBehaviour from './CollisionBehaviour';
|
|
14
|
-
import NoiseBasedMotionBehaviour from './NoiseBasedMotionBehaviour';
|
|
15
|
-
import ForceFieldsBehaviour from './ForceFieldsBehaviour';
|
|
16
|
-
import SpawnBehaviour from './SpawnBehaviour';
|
|
17
|
-
import TimelineBehaviour from './TimelineBehaviour';
|
|
18
|
-
import GroupingBehaviour from './GroupingBehaviour';
|
|
19
|
-
import SoundReactiveBehaviour from './SoundReactiveBehaviour';
|
|
20
|
-
import LightEffectBehaviour from './LightEffectBehaviour';
|
|
21
|
-
import StretchBehaviour from './StretchBehaviour';
|
|
22
|
-
import TemperatureBehaviour from './TemperatureBehaviour';
|
|
23
|
-
export { EmitterBehaviours, Behaviour, SpawnBehaviour, LifeBehaviour, PositionBehaviour, ColorBehaviour, SizeBehaviour, AngularVelocityBehaviour, EmitDirectionBehaviour, RotationBehaviour, TurbulenceBehaviour, CollisionBehaviour, AttractionRepulsionBehaviour, NoiseBasedMotionBehaviour, ForceFieldsBehaviour, TimelineBehaviour, GroupingBehaviour, SoundReactiveBehaviour, LightEffectBehaviour, StretchBehaviour, TemperatureBehaviour, BehaviourNames, };
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/behaviour/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,4BAA4B,MAAM,gCAAgC,CAAA;AACzE,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AACjE,OAAO,sBAAsB,MAAM,0BAA0B,CAAA;AAC7D,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AACvD,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,yBAAyB,MAAM,6BAA6B,CAAA;AACnE,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AACzD,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,sBAAsB,MAAM,0BAA0B,CAAA;AAC7D,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AACzD,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,EAC5B,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,GACf,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface ICustomPixiParticlesSettings {
|
|
2
|
-
textures: string[];
|
|
3
|
-
emitterConfig: any;
|
|
4
|
-
animatedSpriteZeroPad?: number;
|
|
5
|
-
animatedSpriteIndexToStart?: number;
|
|
6
|
-
animatedSprite?: boolean;
|
|
7
|
-
finishingTextures?: string[];
|
|
8
|
-
animatedSpriteFrameRate?: number;
|
|
9
|
-
animatedSpriteLoop?: boolean;
|
|
10
|
-
vertices?: boolean;
|
|
11
|
-
position?: boolean;
|
|
12
|
-
rotation?: boolean;
|
|
13
|
-
uvs?: boolean;
|
|
14
|
-
tint?: boolean;
|
|
15
|
-
maxParticles?: number;
|
|
16
|
-
maxFPS: number;
|
|
17
|
-
minFPS: number;
|
|
18
|
-
tickerSpeed: number;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customPixiParticlesSettingsInterface.js","sourceRoot":"","sources":["../../src/lib/customPixiParticlesSettingsInterface.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { EmitControllerParser } from '../parser';
|
|
2
|
-
/**
|
|
3
|
-
* Abstract class representing a particle emitter.
|
|
4
|
-
* @abstract
|
|
5
|
-
*/
|
|
6
|
-
export default class AbstractEmission {
|
|
7
|
-
/**
|
|
8
|
-
* Calculate number of particles emitted after given time deltas
|
|
9
|
-
* @param {number} deltaTime - number of seconds passed
|
|
10
|
-
* @param {number} particlesCount - current number of particles
|
|
11
|
-
* @return {number} - the number of particles emitted
|
|
12
|
-
* @abstract
|
|
13
|
-
*/
|
|
14
|
-
howMany(deltaTime: number, particlesCount: number): void;
|
|
15
|
-
/**
|
|
16
|
-
* Reset the emission
|
|
17
|
-
*/
|
|
18
|
-
reset(): void;
|
|
19
|
-
/**
|
|
20
|
-
* Get the name of the emission
|
|
21
|
-
* @return {string} - the name of the emission
|
|
22
|
-
* @throws {Error} - when the method is not overridden in subclass
|
|
23
|
-
*/
|
|
24
|
-
getName(): void;
|
|
25
|
-
/**
|
|
26
|
-
* Get the parser for the emitter
|
|
27
|
-
* @return {EmitControllerParser} - parser for the emitter
|
|
28
|
-
*/
|
|
29
|
-
getParser(): EmitControllerParser;
|
|
30
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { EmitControllerParser } from '../parser';
|
|
2
|
-
/**
|
|
3
|
-
* Abstract class representing a particle emitter.
|
|
4
|
-
* @abstract
|
|
5
|
-
*/
|
|
6
|
-
export default class AbstractEmission {
|
|
7
|
-
/**
|
|
8
|
-
* Calculate number of particles emitted after given time deltas
|
|
9
|
-
* @param {number} deltaTime - number of seconds passed
|
|
10
|
-
* @param {number} particlesCount - current number of particles
|
|
11
|
-
* @return {number} - the number of particles emitted
|
|
12
|
-
* @abstract
|
|
13
|
-
*/
|
|
14
|
-
howMany(deltaTime, particlesCount) {
|
|
15
|
-
throw new Error('Abstract method');
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Reset the emission
|
|
19
|
-
*/
|
|
20
|
-
reset() {
|
|
21
|
-
//
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Get the name of the emission
|
|
25
|
-
* @return {string} - the name of the emission
|
|
26
|
-
* @throws {Error} - when the method is not overridden in subclass
|
|
27
|
-
*/
|
|
28
|
-
getName() {
|
|
29
|
-
throw new Error('This method has to be overridden in subclass');
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Get the parser for the emitter
|
|
33
|
-
* @return {EmitControllerParser} - parser for the emitter
|
|
34
|
-
*/
|
|
35
|
-
getParser() {
|
|
36
|
-
return new EmitControllerParser(this);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=AbstractEmission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractEmission.js","sourceRoot":"","sources":["../../../src/lib/emission/AbstractEmission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEhD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC;;;;;;OAMG;IACH,OAAO,CAAC,SAAiB,EAAE,cAAsB;QAC/C,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAED;;OAEG;IACH,KAAK;QACH,EAAE;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACjE,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmissionTypes.js","sourceRoot":"","sources":["../../../src/lib/emission/EmissionTypes.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,kBAAkB;CAC5B,CAAA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { AbstractEmission } from './index';
|
|
2
|
-
/**
|
|
3
|
-
* RandomEmission class to generate random particles
|
|
4
|
-
* @extends AbstractEmission
|
|
5
|
-
*/
|
|
6
|
-
export default class RandomEmission extends AbstractEmission {
|
|
7
|
-
/**
|
|
8
|
-
* Maximum number of particles
|
|
9
|
-
*/
|
|
10
|
-
_maxParticles: number;
|
|
11
|
-
/**
|
|
12
|
-
* Emission rate
|
|
13
|
-
*/
|
|
14
|
-
_emissionRate: number;
|
|
15
|
-
/**
|
|
16
|
-
* Calculates how many particles to emit
|
|
17
|
-
* @param {number} deltaTime - how much time is passed
|
|
18
|
-
* @param {number} particlesCount - current number of particles
|
|
19
|
-
*/
|
|
20
|
-
howMany(deltaTime: number, particlesCount: number): number;
|
|
21
|
-
/**
|
|
22
|
-
* Gets the emission rate
|
|
23
|
-
*/
|
|
24
|
-
get emissionRate(): number;
|
|
25
|
-
/**
|
|
26
|
-
* Sets the emission rate
|
|
27
|
-
* @param {number} value - the emission rate to set
|
|
28
|
-
*/
|
|
29
|
-
set emissionRate(value: number);
|
|
30
|
-
/**
|
|
31
|
-
* Gets the maximum number of particles
|
|
32
|
-
*/
|
|
33
|
-
get maxParticles(): number;
|
|
34
|
-
/**
|
|
35
|
-
* Sets the maximum number of particles
|
|
36
|
-
* @param {number} value - the maximum number of particles to set
|
|
37
|
-
*/
|
|
38
|
-
set maxParticles(value: number);
|
|
39
|
-
/**
|
|
40
|
-
* Gets the name of the emission type
|
|
41
|
-
* @returns {string} Emission type
|
|
42
|
-
*/
|
|
43
|
-
getName: () => string;
|
|
44
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { AbstractEmission, EmissionTypes } from './index';
|
|
2
|
-
import { Random } from '../util';
|
|
3
|
-
/**
|
|
4
|
-
* RandomEmission class to generate random particles
|
|
5
|
-
* @extends AbstractEmission
|
|
6
|
-
*/
|
|
7
|
-
export default class RandomEmission extends AbstractEmission {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
/**
|
|
11
|
-
* Maximum number of particles
|
|
12
|
-
*/
|
|
13
|
-
this._maxParticles = 0;
|
|
14
|
-
/**
|
|
15
|
-
* Emission rate
|
|
16
|
-
*/
|
|
17
|
-
this._emissionRate = 0;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the name of the emission type
|
|
20
|
-
* @returns {string} Emission type
|
|
21
|
-
*/
|
|
22
|
-
this.getName = () => {
|
|
23
|
-
return EmissionTypes.RANDOM;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Calculates how many particles to emit
|
|
28
|
-
* @param {number} deltaTime - how much time is passed
|
|
29
|
-
* @param {number} particlesCount - current number of particles
|
|
30
|
-
*/
|
|
31
|
-
howMany(deltaTime, particlesCount) {
|
|
32
|
-
if (particlesCount < this.maxParticles) {
|
|
33
|
-
const count = Math.round(Random.uniform(0, Math.ceil(this.emissionRate * deltaTime)));
|
|
34
|
-
const total = particlesCount + count;
|
|
35
|
-
return total > this._maxParticles ? this.maxParticles - particlesCount : count;
|
|
36
|
-
}
|
|
37
|
-
return 0;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Gets the emission rate
|
|
41
|
-
*/
|
|
42
|
-
get emissionRate() {
|
|
43
|
-
return this._emissionRate;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Sets the emission rate
|
|
47
|
-
* @param {number} value - the emission rate to set
|
|
48
|
-
*/
|
|
49
|
-
set emissionRate(value) {
|
|
50
|
-
this._emissionRate = Math.max(0, value);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Gets the maximum number of particles
|
|
54
|
-
*/
|
|
55
|
-
get maxParticles() {
|
|
56
|
-
return this._maxParticles;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Sets the maximum number of particles
|
|
60
|
-
* @param {number} value - the maximum number of particles to set
|
|
61
|
-
*/
|
|
62
|
-
set maxParticles(value) {
|
|
63
|
-
this._maxParticles = Math.max(0, value);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=RandomEmission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RandomEmission.js","sourceRoot":"","sources":["../../../src/lib/emission/RandomEmission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,gBAAgB;IAA5D;;QACE;;WAEG;QACH,kBAAa,GAAG,CAAC,CAAA;QAEjB;;WAEG;QACH,kBAAa,GAAG,CAAC,CAAA;QA+CjB;;;WAGG;QACH,YAAO,GAAG,GAAG,EAAE;YACb,OAAO,aAAa,CAAC,MAAM,CAAA;QAC7B,CAAC,CAAA;IACH,CAAC;IApDC;;;;OAIG;IACH,OAAO,CAAC,SAAiB,EAAE,cAAsB;QAC/C,IAAI,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;YACrF,MAAM,KAAK,GAAG,cAAc,GAAG,KAAK,CAAA;YACpC,OAAO,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC,KAAK,CAAA;QAChF,CAAC;QAED,OAAO,CAAC,CAAA;IACV,CAAC;IAED;;OAEG;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;;OAEG;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;CASF"}
|
|
@@ -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
|
-
}
|