custom-pixi-particles 2.0.9 → 2.0.13
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/LICENSE +21 -21
- package/README.md +45 -45
- package/dist/index.d.ts +6 -6
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/lib/Particle.d.ts +44 -45
- package/dist/lib/Particle.js +68 -68
- package/dist/lib/Particle.js.map +1 -1
- package/dist/lib/ParticlePool.d.ts +9 -9
- package/dist/lib/ParticlePool.js +33 -33
- package/dist/lib/behaviour/AngularVelocityBehaviour.d.ts +26 -26
- package/dist/lib/behaviour/AngularVelocityBehaviour.js +77 -77
- package/dist/lib/behaviour/Behaviour.d.ts +7 -7
- package/dist/lib/behaviour/Behaviour.js +26 -26
- package/dist/lib/behaviour/BehaviourNames.d.ts +11 -11
- package/dist/lib/behaviour/BehaviourNames.js +12 -12
- package/dist/lib/behaviour/ColorBehaviour.d.ts +45 -45
- package/dist/lib/behaviour/ColorBehaviour.js +103 -103
- package/dist/lib/behaviour/EmitDirectionBehaviour.d.ts +22 -22
- package/dist/lib/behaviour/EmitDirectionBehaviour.js +83 -83
- package/dist/lib/behaviour/EmitterBehaviours.d.ts +12 -12
- package/dist/lib/behaviour/EmitterBehaviours.js +59 -59
- package/dist/lib/behaviour/LifeBehaviour.d.ts +18 -18
- package/dist/lib/behaviour/LifeBehaviour.js +55 -55
- package/dist/lib/behaviour/PositionBehaviour.d.ts +62 -62
- package/dist/lib/behaviour/PositionBehaviour.js +146 -146
- package/dist/lib/behaviour/RotationBehaviour.d.ts +22 -22
- package/dist/lib/behaviour/RotationBehaviour.js +77 -77
- package/dist/lib/behaviour/SizeBehaviour.d.ts +31 -31
- package/dist/lib/behaviour/SizeBehaviour.js +84 -84
- package/dist/lib/behaviour/TurbulenceBehaviour.d.ts +69 -69
- package/dist/lib/behaviour/TurbulenceBehaviour.js +153 -153
- package/dist/lib/behaviour/index.d.ts +12 -12
- package/dist/lib/behaviour/index.js +28 -28
- package/dist/lib/customPixiParticlesSettingsInterface.d.ts +12 -8
- package/dist/lib/customPixiParticlesSettingsInterface.js +2 -2
- package/dist/lib/emission/AbstractEmission.d.ts +7 -7
- package/dist/lib/emission/AbstractEmission.js +21 -21
- package/dist/lib/emission/EmissionTypes.d.ts +6 -6
- package/dist/lib/emission/EmissionTypes.js +7 -7
- package/dist/lib/emission/RandomEmission.d.ts +11 -11
- package/dist/lib/emission/RandomEmission.js +61 -61
- package/dist/lib/emission/StandardEmission.d.ts +12 -12
- package/dist/lib/emission/StandardEmission.js +65 -65
- package/dist/lib/emission/UniformEmission.d.ts +14 -14
- package/dist/lib/emission/UniformEmission.js +73 -73
- package/dist/lib/emission/index.d.ts +6 -6
- package/dist/lib/emission/index.js +16 -16
- package/dist/lib/emitter/Duration.d.ts +10 -10
- package/dist/lib/emitter/Duration.js +28 -28
- package/dist/lib/emitter/Emitter.d.ts +43 -45
- package/dist/lib/emitter/Emitter.js +213 -214
- package/dist/lib/emitter/Emitter.js.map +1 -1
- package/dist/lib/emitter/index.d.ts +3 -3
- package/dist/lib/emitter/index.js +10 -10
- package/dist/lib/index.d.ts +20 -20
- package/dist/lib/index.js +44 -44
- package/dist/lib/parser/BehaviourParser.d.ts +10 -10
- package/dist/lib/parser/BehaviourParser.js +48 -48
- package/dist/lib/parser/CompatibilityHelper.d.ts +3 -3
- package/dist/lib/parser/CompatibilityHelper.js +14 -14
- package/dist/lib/parser/EmitControllerParser.d.ts +6 -6
- package/dist/lib/parser/EmitControllerParser.js +22 -22
- package/dist/lib/parser/EmitterParser.d.ts +12 -12
- package/dist/lib/parser/EmitterParser.js +126 -126
- package/dist/lib/parser/EmitterParser.js.map +1 -1
- package/dist/lib/parser/index.d.ts +5 -5
- package/dist/lib/parser/index.js +14 -14
- package/dist/lib/pixi/Renderer.d.ts +53 -49
- package/dist/lib/pixi/Renderer.js +432 -437
- package/dist/lib/pixi/Renderer.js.map +1 -1
- package/dist/lib/util/Color.d.ts +32 -32
- package/dist/lib/util/Color.js +98 -98
- package/dist/lib/util/List.d.ts +9 -9
- package/dist/lib/util/List.js +50 -50
- package/dist/lib/util/Point.d.ts +13 -13
- package/dist/lib/util/Point.js +29 -29
- package/dist/lib/util/Random.d.ts +4 -4
- package/dist/lib/util/Random.js +14 -14
- package/dist/lib/util/index.d.ts +5 -5
- package/dist/lib/util/index.js +14 -14
- package/dist/lib/util/maths.d.ts +7 -7
- package/dist/lib/util/maths.js +16 -16
- package/dist/lib/util/turbulencePool.d.ts +5 -5
- package/dist/lib/util/turbulencePool.js +9 -9
- package/package.json +41 -41
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Lukasz Okuniewicz
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Lukasz Okuniewicz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
CustomPIXIParticles by [@lukasz-okuniewicz](http://github.com/lukasz-okuniewicz)
|
|
2
|
-
=========
|
|
3
|
-
|
|
4
|
-
Custom PIXI Particles.
|
|
5
|
-
|
|
6
|
-
Editor for particles: [custom-pixi-particles-editor](https://github.com/lukasz-okuniewicz/custom-pixi-particles-editor)
|
|
7
|
-
|
|
8
|
-
How to use:
|
|
9
|
-
```
|
|
10
|
-
npm install custom-pixi-particles
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
then:
|
|
14
|
-
```javascript
|
|
15
|
-
const customPIXIParticles = require('custom-pixi-particles')
|
|
16
|
-
// or
|
|
17
|
-
import customPIXIParticles from 'custom-pixi-particles'
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
```javascript
|
|
21
|
-
// Define array of textures
|
|
22
|
-
const textures = ['texture1.png', 'texture2.png']
|
|
23
|
-
// Define generated emiter config
|
|
24
|
-
const emitterConfig = {...}
|
|
25
|
-
// Create particles
|
|
26
|
-
this.particles = customParticles.create({ textures, emitterConfig })
|
|
27
|
-
// Start to play
|
|
28
|
-
this.particles.play()
|
|
29
|
-
// Add particles to PIXI container
|
|
30
|
-
container.addChild(this.particles)
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```javascript
|
|
34
|
-
// On complete
|
|
35
|
-
this.particles.onComplete = () => {
|
|
36
|
-
//...
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
```javascript
|
|
41
|
-
// Define array of new textures
|
|
42
|
-
const newTextures = ['texture3.png', 'texture4.png']
|
|
43
|
-
// Change textures
|
|
44
|
-
this.particles.setTextures(newTextures)
|
|
45
|
-
```
|
|
1
|
+
CustomPIXIParticles by [@lukasz-okuniewicz](http://github.com/lukasz-okuniewicz)
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
Custom PIXI Particles.
|
|
5
|
+
|
|
6
|
+
Editor for particles: [custom-pixi-particles-editor](https://github.com/lukasz-okuniewicz/custom-pixi-particles-editor)
|
|
7
|
+
|
|
8
|
+
How to use:
|
|
9
|
+
```
|
|
10
|
+
npm install custom-pixi-particles
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
then:
|
|
14
|
+
```javascript
|
|
15
|
+
const customPIXIParticles = require('custom-pixi-particles')
|
|
16
|
+
// or
|
|
17
|
+
import customPIXIParticles from 'custom-pixi-particles'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
// Define array of textures
|
|
22
|
+
const textures = ['texture1.png', 'texture2.png']
|
|
23
|
+
// Define generated emiter config
|
|
24
|
+
const emitterConfig = {...}
|
|
25
|
+
// Create particles
|
|
26
|
+
this.particles = customParticles.create({ textures, emitterConfig })
|
|
27
|
+
// Start to play
|
|
28
|
+
this.particles.play()
|
|
29
|
+
// Add particles to PIXI container
|
|
30
|
+
container.addChild(this.particles)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
// On complete
|
|
35
|
+
this.particles.onComplete = () => {
|
|
36
|
+
//...
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
// Define array of new textures
|
|
42
|
+
const newTextures = ['texture3.png', 'texture4.png']
|
|
43
|
+
// Change textures
|
|
44
|
+
this.particles.setTextures(newTextures)
|
|
45
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Renderer from './lib/pixi/Renderer';
|
|
2
|
-
import { ICustomPixiParticlesSettings } from './lib/customPixiParticlesSettingsInterface';
|
|
3
|
-
declare const customPixiParticles: {
|
|
4
|
-
create(settings: ICustomPixiParticlesSettings): Renderer;
|
|
5
|
-
};
|
|
6
|
-
export { Renderer, customPixiParticles, ICustomPixiParticlesSettings };
|
|
1
|
+
import Renderer from './lib/pixi/Renderer';
|
|
2
|
+
import { ICustomPixiParticlesSettings } from './lib/customPixiParticlesSettingsInterface';
|
|
3
|
+
declare const customPixiParticles: {
|
|
4
|
+
create(settings: ICustomPixiParticlesSettings): Renderer;
|
|
5
|
+
};
|
|
6
|
+
export { Renderer, customPixiParticles, ICustomPixiParticlesSettings };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.customPixiParticles = exports.Renderer = void 0;
|
|
7
|
-
var Renderer_1 = __importDefault(require("./lib/pixi/Renderer"));
|
|
8
|
-
exports.Renderer = Renderer_1.default;
|
|
9
|
-
var customPixiParticles = {
|
|
10
|
-
create: function (settings) {
|
|
11
|
-
var textures = settings.textures, emitterConfig = settings.emitterConfig,
|
|
12
|
-
return new Renderer_1.default({ textures: textures, emitterConfig: emitterConfig, finishingTextures: finishingTextures });
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
exports.customPixiParticles = customPixiParticles;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.customPixiParticles = exports.Renderer = void 0;
|
|
7
|
+
var Renderer_1 = __importDefault(require("./lib/pixi/Renderer"));
|
|
8
|
+
exports.Renderer = Renderer_1.default;
|
|
9
|
+
var customPixiParticles = {
|
|
10
|
+
create: function (settings) {
|
|
11
|
+
var textures = settings.textures, resources = settings.resources, _a = settings.animatedSpriteZeroPad, animatedSpriteZeroPad = _a === void 0 ? 2 : _a, _b = settings.animatedSpriteIndexToStart, animatedSpriteIndexToStart = _b === void 0 ? 0 : _b, emitterConfig = settings.emitterConfig, PIXI = settings.PIXI, _c = settings.finishingTextures, finishingTextures = _c === void 0 ? [] : _c;
|
|
12
|
+
return new Renderer_1.default({ textures: textures, resources: resources, animatedSpriteZeroPad: animatedSpriteZeroPad, animatedSpriteIndexToStart: animatedSpriteIndexToStart, emitterConfig: emitterConfig, finishingTextures: finishingTextures, PIXI: PIXI });
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
exports.customPixiParticles = customPixiParticles;
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iEAA0C;AAYjC,mBAZF,kBAAQ,CAYE;AATjB,IAAM,mBAAmB,GAAG;IAC1B,MAAM,EAAN,UAAO,QAAsC;QAEzC,IAAA,QAAQ,GACN,QAAQ,SADF,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iEAA0C;AAYjC,mBAZF,kBAAQ,CAYE;AATjB,IAAM,mBAAmB,GAAG;IAC1B,MAAM,EAAN,UAAO,QAAsC;QAEzC,IAAA,QAAQ,GACN,QAAQ,SADF,EAAE,SAAS,GACjB,QAAQ,UADS,EAAE,KACnB,QAAQ,sBADoC,EAAzB,qBAAqB,mBAAG,CAAC,KAAA,EAAE,KAC9C,QAAQ,2BADoE,EAA9B,0BAA0B,mBAAG,CAAC,KAAA,EAAE,aAAa,GAC3F,QAAQ,cADmF,EAAE,IAAI,GACjG,QAAQ,KADyF,EAAE,KACnG,QAAQ,kBADiH,EAAtB,iBAAiB,mBAAG,EAAE,KAAA,CACjH;QACZ,OAAO,IAAI,kBAAQ,CAAC,EAAC,QAAQ,UAAA,EAAE,SAAS,WAAA,EAAE,qBAAqB,uBAAA,EAAE,0BAA0B,4BAAA,EAAE,aAAa,eAAA,EAAE,iBAAiB,mBAAA,EAAE,IAAI,MAAA,EAAC,CAAC,CAAA;IACvI,CAAC;CACF,CAAA;AAEkB,kDAAmB"}
|
package/dist/lib/Particle.d.ts
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
1
|
+
import { Color, Point } from './util';
|
|
2
|
+
export default class Particle {
|
|
3
|
+
static _UID: {
|
|
4
|
+
value: number;
|
|
5
|
+
};
|
|
6
|
+
next: null;
|
|
7
|
+
prev: null;
|
|
8
|
+
uid: number;
|
|
9
|
+
movement: Point;
|
|
10
|
+
acceleration: Point;
|
|
11
|
+
velocity: Point;
|
|
12
|
+
size: Point;
|
|
13
|
+
sizeStart: Point;
|
|
14
|
+
sizeEnd: Point;
|
|
15
|
+
sinXVal: Point;
|
|
16
|
+
sinYVal: Point;
|
|
17
|
+
color: Color;
|
|
18
|
+
colorStart: Color;
|
|
19
|
+
colorEnd: Color;
|
|
20
|
+
maxLifeTime: number;
|
|
21
|
+
lifeTime: number;
|
|
22
|
+
lifeProgress: number;
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
velocityAngle: number;
|
|
26
|
+
radiansPerSecond: number;
|
|
27
|
+
radius: number;
|
|
28
|
+
radiusStart: number;
|
|
29
|
+
radiusEnd: number;
|
|
30
|
+
directionCos: number;
|
|
31
|
+
directionSin: number;
|
|
32
|
+
rotation: number;
|
|
33
|
+
rotationDelta: number;
|
|
34
|
+
angle: number;
|
|
35
|
+
sprite: any;
|
|
36
|
+
showVortices: boolean;
|
|
37
|
+
turbulence: boolean;
|
|
38
|
+
finishingTexture: number;
|
|
39
|
+
constructor();
|
|
40
|
+
reset(): void;
|
|
41
|
+
isAlmostDead(): boolean;
|
|
42
|
+
isDead(): boolean;
|
|
43
|
+
hide(): void;
|
|
44
|
+
}
|
package/dist/lib/Particle.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var util_1 = require("./util");
|
|
4
|
-
var Particle = /** @class */ (function () {
|
|
5
|
-
function Particle() {
|
|
6
|
-
this.next = null;
|
|
7
|
-
this.prev = null;
|
|
8
|
-
this.uid = Particle._UID.value++;
|
|
9
|
-
this.movement = new util_1.Point();
|
|
10
|
-
this.acceleration = new util_1.Point();
|
|
11
|
-
this.velocity = new util_1.Point();
|
|
12
|
-
this.size = new util_1.Point();
|
|
13
|
-
this.sizeStart = new util_1.Point();
|
|
14
|
-
this.sizeEnd = new util_1.Point();
|
|
15
|
-
this.sinXVal = new util_1.Point();
|
|
16
|
-
this.sinYVal = new util_1.Point();
|
|
17
|
-
this.color = new util_1.Color();
|
|
18
|
-
this.colorStart = new util_1.Color();
|
|
19
|
-
this.colorEnd = new util_1.Color();
|
|
20
|
-
this.reset();
|
|
21
|
-
}
|
|
22
|
-
Particle.prototype.reset = function () {
|
|
23
|
-
this.maxLifeTime = 0;
|
|
24
|
-
this.lifeTime = 0;
|
|
25
|
-
this.lifeProgress = 0;
|
|
26
|
-
this.x = 0;
|
|
27
|
-
this.y = 0;
|
|
28
|
-
this.movement.set(0, 0);
|
|
29
|
-
this.acceleration.set(0, 0);
|
|
30
|
-
this.velocity.set(0, 0);
|
|
31
|
-
this.sinXVal.set(0, 0);
|
|
32
|
-
this.sinYVal.set(0, 0);
|
|
33
|
-
this.velocityAngle = 0;
|
|
34
|
-
this.radiansPerSecond = 0;
|
|
35
|
-
this.radius = 0;
|
|
36
|
-
this.radiusStart = 0;
|
|
37
|
-
this.radiusEnd = 0;
|
|
38
|
-
this.directionCos = 1;
|
|
39
|
-
this.directionSin = 0;
|
|
40
|
-
this.finishingTexture = 0;
|
|
41
|
-
this.showVortices = false;
|
|
42
|
-
this.turbulence = false;
|
|
43
|
-
this.rotation = 0;
|
|
44
|
-
this.rotationDelta = 0;
|
|
45
|
-
this.size.set(1, 1);
|
|
46
|
-
this.sizeStart.set(0, 0);
|
|
47
|
-
this.sizeEnd.set(0, 0);
|
|
48
|
-
this.color.set(255, 255, 255, 1);
|
|
49
|
-
this.colorStart.set(0, 0, 0, 1);
|
|
50
|
-
this.colorEnd.set(0, 0, 0, 1);
|
|
51
|
-
};
|
|
52
|
-
Particle.prototype.isAlmostDead = function () {
|
|
53
|
-
return this.lifeTime >= this.maxLifeTime - 0.1;
|
|
54
|
-
};
|
|
55
|
-
Particle.prototype.isDead = function () {
|
|
56
|
-
return this.lifeTime >= this.maxLifeTime;
|
|
57
|
-
};
|
|
58
|
-
Particle.prototype.hide = function () {
|
|
59
|
-
if (!this.sprite)
|
|
60
|
-
return;
|
|
61
|
-
if (!this.sprite.visible)
|
|
62
|
-
return;
|
|
63
|
-
this.sprite.visible = false;
|
|
64
|
-
};
|
|
65
|
-
Particle._UID = { value: 0 };
|
|
66
|
-
return Particle;
|
|
67
|
-
}());
|
|
68
|
-
exports.default = Particle;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var util_1 = require("./util");
|
|
4
|
+
var Particle = /** @class */ (function () {
|
|
5
|
+
function Particle() {
|
|
6
|
+
this.next = null;
|
|
7
|
+
this.prev = null;
|
|
8
|
+
this.uid = Particle._UID.value++;
|
|
9
|
+
this.movement = new util_1.Point();
|
|
10
|
+
this.acceleration = new util_1.Point();
|
|
11
|
+
this.velocity = new util_1.Point();
|
|
12
|
+
this.size = new util_1.Point();
|
|
13
|
+
this.sizeStart = new util_1.Point();
|
|
14
|
+
this.sizeEnd = new util_1.Point();
|
|
15
|
+
this.sinXVal = new util_1.Point();
|
|
16
|
+
this.sinYVal = new util_1.Point();
|
|
17
|
+
this.color = new util_1.Color();
|
|
18
|
+
this.colorStart = new util_1.Color();
|
|
19
|
+
this.colorEnd = new util_1.Color();
|
|
20
|
+
this.reset();
|
|
21
|
+
}
|
|
22
|
+
Particle.prototype.reset = function () {
|
|
23
|
+
this.maxLifeTime = 0;
|
|
24
|
+
this.lifeTime = 0;
|
|
25
|
+
this.lifeProgress = 0;
|
|
26
|
+
this.x = 0;
|
|
27
|
+
this.y = 0;
|
|
28
|
+
this.movement.set(0, 0);
|
|
29
|
+
this.acceleration.set(0, 0);
|
|
30
|
+
this.velocity.set(0, 0);
|
|
31
|
+
this.sinXVal.set(0, 0);
|
|
32
|
+
this.sinYVal.set(0, 0);
|
|
33
|
+
this.velocityAngle = 0;
|
|
34
|
+
this.radiansPerSecond = 0;
|
|
35
|
+
this.radius = 0;
|
|
36
|
+
this.radiusStart = 0;
|
|
37
|
+
this.radiusEnd = 0;
|
|
38
|
+
this.directionCos = 1;
|
|
39
|
+
this.directionSin = 0;
|
|
40
|
+
this.finishingTexture = 0;
|
|
41
|
+
this.showVortices = false;
|
|
42
|
+
this.turbulence = false;
|
|
43
|
+
this.rotation = 0;
|
|
44
|
+
this.rotationDelta = 0;
|
|
45
|
+
this.size.set(1, 1);
|
|
46
|
+
this.sizeStart.set(0, 0);
|
|
47
|
+
this.sizeEnd.set(0, 0);
|
|
48
|
+
this.color.set(255, 255, 255, 1);
|
|
49
|
+
this.colorStart.set(0, 0, 0, 1);
|
|
50
|
+
this.colorEnd.set(0, 0, 0, 1);
|
|
51
|
+
};
|
|
52
|
+
Particle.prototype.isAlmostDead = function () {
|
|
53
|
+
return this.lifeTime >= this.maxLifeTime - 0.1;
|
|
54
|
+
};
|
|
55
|
+
Particle.prototype.isDead = function () {
|
|
56
|
+
return this.lifeTime >= this.maxLifeTime;
|
|
57
|
+
};
|
|
58
|
+
Particle.prototype.hide = function () {
|
|
59
|
+
if (!this.sprite)
|
|
60
|
+
return;
|
|
61
|
+
if (!this.sprite.visible)
|
|
62
|
+
return;
|
|
63
|
+
this.sprite.visible = false;
|
|
64
|
+
};
|
|
65
|
+
Particle._UID = { value: 0 };
|
|
66
|
+
return Particle;
|
|
67
|
+
}());
|
|
68
|
+
exports.default = Particle;
|
|
69
69
|
//# sourceMappingURL=Particle.js.map
|
package/dist/lib/Particle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Particle.js","sourceRoot":"","sources":["../../src/lib/Particle.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Particle.js","sourceRoot":"","sources":["../../src/lib/Particle.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Particle from './Particle';
|
|
2
|
-
export default class ParticlePool {
|
|
3
|
-
static global: ParticlePool;
|
|
4
|
-
first: any;
|
|
5
|
-
pop(): any;
|
|
6
|
-
create(): Particle;
|
|
7
|
-
push(particle: Particle): void;
|
|
8
|
-
reset(): void;
|
|
9
|
-
}
|
|
1
|
+
import Particle from './Particle';
|
|
2
|
+
export default class ParticlePool {
|
|
3
|
+
static global: ParticlePool;
|
|
4
|
+
first: any;
|
|
5
|
+
pop(): any;
|
|
6
|
+
create(): Particle;
|
|
7
|
+
push(particle: Particle): void;
|
|
8
|
+
reset(): void;
|
|
9
|
+
}
|
package/dist/lib/ParticlePool.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var Particle_1 = __importDefault(require("./Particle"));
|
|
7
|
-
var ParticlePool = /** @class */ (function () {
|
|
8
|
-
function ParticlePool() {
|
|
9
|
-
this.first = null;
|
|
10
|
-
}
|
|
11
|
-
ParticlePool.prototype.pop = function () {
|
|
12
|
-
if (!this.first)
|
|
13
|
-
return this.create();
|
|
14
|
-
var current = this.first;
|
|
15
|
-
this.first = current.next;
|
|
16
|
-
current.next = null;
|
|
17
|
-
return current;
|
|
18
|
-
};
|
|
19
|
-
ParticlePool.prototype.create = function () {
|
|
20
|
-
return new Particle_1.default();
|
|
21
|
-
};
|
|
22
|
-
ParticlePool.prototype.push = function (particle) {
|
|
23
|
-
particle.next = this.first;
|
|
24
|
-
this.first = particle;
|
|
25
|
-
};
|
|
26
|
-
ParticlePool.prototype.reset = function () {
|
|
27
|
-
this.first = null;
|
|
28
|
-
ParticlePool.global = new ParticlePool();
|
|
29
|
-
};
|
|
30
|
-
ParticlePool.global = new ParticlePool();
|
|
31
|
-
return ParticlePool;
|
|
32
|
-
}());
|
|
33
|
-
exports.default = ParticlePool;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var Particle_1 = __importDefault(require("./Particle"));
|
|
7
|
+
var ParticlePool = /** @class */ (function () {
|
|
8
|
+
function ParticlePool() {
|
|
9
|
+
this.first = null;
|
|
10
|
+
}
|
|
11
|
+
ParticlePool.prototype.pop = function () {
|
|
12
|
+
if (!this.first)
|
|
13
|
+
return this.create();
|
|
14
|
+
var current = this.first;
|
|
15
|
+
this.first = current.next;
|
|
16
|
+
current.next = null;
|
|
17
|
+
return current;
|
|
18
|
+
};
|
|
19
|
+
ParticlePool.prototype.create = function () {
|
|
20
|
+
return new Particle_1.default();
|
|
21
|
+
};
|
|
22
|
+
ParticlePool.prototype.push = function (particle) {
|
|
23
|
+
particle.next = this.first;
|
|
24
|
+
this.first = particle;
|
|
25
|
+
};
|
|
26
|
+
ParticlePool.prototype.reset = function () {
|
|
27
|
+
this.first = null;
|
|
28
|
+
ParticlePool.global = new ParticlePool();
|
|
29
|
+
};
|
|
30
|
+
ParticlePool.global = new ParticlePool();
|
|
31
|
+
return ParticlePool;
|
|
32
|
+
}());
|
|
33
|
+
exports.default = ParticlePool;
|
|
34
34
|
//# sourceMappingURL=ParticlePool.js.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import Behaviour from './Behaviour';
|
|
2
|
-
import Particle from '../Particle';
|
|
3
|
-
export default class AngularVelocityBehaviour extends Behaviour {
|
|
4
|
-
private enabled;
|
|
5
|
-
private degrees;
|
|
6
|
-
private degreesVariance;
|
|
7
|
-
private maxRadius;
|
|
8
|
-
private maxRadiusVariance;
|
|
9
|
-
private minRadius;
|
|
10
|
-
private minRadiusVariance;
|
|
11
|
-
protected priority: number;
|
|
12
|
-
init: (particle: Particle) => void;
|
|
13
|
-
apply: (particle: Particle, deltaTime: number) => void;
|
|
14
|
-
getName(): string;
|
|
15
|
-
getProps(): {
|
|
16
|
-
enabled: boolean;
|
|
17
|
-
degrees: number;
|
|
18
|
-
degreesVariance: number;
|
|
19
|
-
maxRadius: number;
|
|
20
|
-
maxRadiusVariance: number;
|
|
21
|
-
minRadius: number;
|
|
22
|
-
minRadiusVariance: number;
|
|
23
|
-
priority: number;
|
|
24
|
-
name: string;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
1
|
+
import Behaviour from './Behaviour';
|
|
2
|
+
import Particle from '../Particle';
|
|
3
|
+
export default class AngularVelocityBehaviour extends Behaviour {
|
|
4
|
+
private enabled;
|
|
5
|
+
private degrees;
|
|
6
|
+
private degreesVariance;
|
|
7
|
+
private maxRadius;
|
|
8
|
+
private maxRadiusVariance;
|
|
9
|
+
private minRadius;
|
|
10
|
+
private minRadiusVariance;
|
|
11
|
+
protected priority: number;
|
|
12
|
+
init: (particle: Particle) => void;
|
|
13
|
+
apply: (particle: Particle, deltaTime: number) => void;
|
|
14
|
+
getName(): string;
|
|
15
|
+
getProps(): {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
degrees: number;
|
|
18
|
+
degreesVariance: number;
|
|
19
|
+
maxRadius: number;
|
|
20
|
+
maxRadiusVariance: number;
|
|
21
|
+
minRadius: number;
|
|
22
|
+
minRadiusVariance: number;
|
|
23
|
+
priority: number;
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
}
|