custom-pixi-particles 2.0.10 → 3.0.2
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 +9 -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 +50 -49
- package/dist/lib/pixi/Renderer.js +427 -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 +40 -41
|
@@ -1,29 +1,29 @@
|
|
|
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.BehaviourNames = exports.TurbulenceBehaviour = exports.RotationBehaviour = exports.EmitDirectionBehaviour = exports.AngularVelocityBehaviour = exports.SizeBehaviour = exports.ColorBehaviour = exports.PositionBehaviour = exports.LifeBehaviour = exports.Behaviour = exports.EmitterBehaviours = void 0;
|
|
7
|
-
var BehaviourNames_1 = __importDefault(require("./BehaviourNames"));
|
|
8
|
-
exports.BehaviourNames = BehaviourNames_1.default;
|
|
9
|
-
var EmitterBehaviours_1 = __importDefault(require("./EmitterBehaviours"));
|
|
10
|
-
exports.EmitterBehaviours = EmitterBehaviours_1.default;
|
|
11
|
-
var Behaviour_1 = __importDefault(require("./Behaviour"));
|
|
12
|
-
exports.Behaviour = Behaviour_1.default;
|
|
13
|
-
var LifeBehaviour_1 = __importDefault(require("./LifeBehaviour"));
|
|
14
|
-
exports.LifeBehaviour = LifeBehaviour_1.default;
|
|
15
|
-
var PositionBehaviour_1 = __importDefault(require("./PositionBehaviour"));
|
|
16
|
-
exports.PositionBehaviour = PositionBehaviour_1.default;
|
|
17
|
-
var ColorBehaviour_1 = __importDefault(require("./ColorBehaviour"));
|
|
18
|
-
exports.ColorBehaviour = ColorBehaviour_1.default;
|
|
19
|
-
var SizeBehaviour_1 = __importDefault(require("./SizeBehaviour"));
|
|
20
|
-
exports.SizeBehaviour = SizeBehaviour_1.default;
|
|
21
|
-
var AngularVelocityBehaviour_1 = __importDefault(require("./AngularVelocityBehaviour"));
|
|
22
|
-
exports.AngularVelocityBehaviour = AngularVelocityBehaviour_1.default;
|
|
23
|
-
var EmitDirectionBehaviour_1 = __importDefault(require("./EmitDirectionBehaviour"));
|
|
24
|
-
exports.EmitDirectionBehaviour = EmitDirectionBehaviour_1.default;
|
|
25
|
-
var RotationBehaviour_1 = __importDefault(require("./RotationBehaviour"));
|
|
26
|
-
exports.RotationBehaviour = RotationBehaviour_1.default;
|
|
27
|
-
var TurbulenceBehaviour_1 = __importDefault(require("./TurbulenceBehaviour"));
|
|
28
|
-
exports.TurbulenceBehaviour = TurbulenceBehaviour_1.default;
|
|
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.BehaviourNames = exports.TurbulenceBehaviour = exports.RotationBehaviour = exports.EmitDirectionBehaviour = exports.AngularVelocityBehaviour = exports.SizeBehaviour = exports.ColorBehaviour = exports.PositionBehaviour = exports.LifeBehaviour = exports.Behaviour = exports.EmitterBehaviours = void 0;
|
|
7
|
+
var BehaviourNames_1 = __importDefault(require("./BehaviourNames"));
|
|
8
|
+
exports.BehaviourNames = BehaviourNames_1.default;
|
|
9
|
+
var EmitterBehaviours_1 = __importDefault(require("./EmitterBehaviours"));
|
|
10
|
+
exports.EmitterBehaviours = EmitterBehaviours_1.default;
|
|
11
|
+
var Behaviour_1 = __importDefault(require("./Behaviour"));
|
|
12
|
+
exports.Behaviour = Behaviour_1.default;
|
|
13
|
+
var LifeBehaviour_1 = __importDefault(require("./LifeBehaviour"));
|
|
14
|
+
exports.LifeBehaviour = LifeBehaviour_1.default;
|
|
15
|
+
var PositionBehaviour_1 = __importDefault(require("./PositionBehaviour"));
|
|
16
|
+
exports.PositionBehaviour = PositionBehaviour_1.default;
|
|
17
|
+
var ColorBehaviour_1 = __importDefault(require("./ColorBehaviour"));
|
|
18
|
+
exports.ColorBehaviour = ColorBehaviour_1.default;
|
|
19
|
+
var SizeBehaviour_1 = __importDefault(require("./SizeBehaviour"));
|
|
20
|
+
exports.SizeBehaviour = SizeBehaviour_1.default;
|
|
21
|
+
var AngularVelocityBehaviour_1 = __importDefault(require("./AngularVelocityBehaviour"));
|
|
22
|
+
exports.AngularVelocityBehaviour = AngularVelocityBehaviour_1.default;
|
|
23
|
+
var EmitDirectionBehaviour_1 = __importDefault(require("./EmitDirectionBehaviour"));
|
|
24
|
+
exports.EmitDirectionBehaviour = EmitDirectionBehaviour_1.default;
|
|
25
|
+
var RotationBehaviour_1 = __importDefault(require("./RotationBehaviour"));
|
|
26
|
+
exports.RotationBehaviour = RotationBehaviour_1.default;
|
|
27
|
+
var TurbulenceBehaviour_1 = __importDefault(require("./TurbulenceBehaviour"));
|
|
28
|
+
exports.TurbulenceBehaviour = TurbulenceBehaviour_1.default;
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export interface ICustomPixiParticlesSettings {
|
|
2
|
-
textures:
|
|
3
|
-
emitterConfig: any;
|
|
4
|
-
animatedSprite?: boolean;
|
|
5
|
-
finishingTextures?:
|
|
6
|
-
animatedSpriteFrameRate?: number;
|
|
7
|
-
animatedSpriteLoop?: boolean;
|
|
8
|
-
|
|
1
|
+
export interface ICustomPixiParticlesSettings {
|
|
2
|
+
textures: any[];
|
|
3
|
+
emitterConfig: any;
|
|
4
|
+
animatedSprite?: boolean;
|
|
5
|
+
finishingTextures?: any[];
|
|
6
|
+
animatedSpriteFrameRate?: number;
|
|
7
|
+
animatedSpriteLoop?: boolean;
|
|
8
|
+
PIXI: any;
|
|
9
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=customPixiParticlesSettingsInterface.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EmitControllerParser } from '../parser';
|
|
2
|
-
export default class AbstractEmission {
|
|
3
|
-
howMany(deltaTime: number, particlesCount: number): void;
|
|
4
|
-
reset(): void;
|
|
5
|
-
getName(): void;
|
|
6
|
-
getParser(): EmitControllerParser;
|
|
7
|
-
}
|
|
1
|
+
import { EmitControllerParser } from '../parser';
|
|
2
|
+
export default class AbstractEmission {
|
|
3
|
+
howMany(deltaTime: number, particlesCount: number): void;
|
|
4
|
+
reset(): void;
|
|
5
|
+
getName(): void;
|
|
6
|
+
getParser(): EmitControllerParser;
|
|
7
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var parser_1 = require("../parser");
|
|
4
|
-
var AbstractEmission = /** @class */ (function () {
|
|
5
|
-
function AbstractEmission() {
|
|
6
|
-
}
|
|
7
|
-
AbstractEmission.prototype.howMany = function (deltaTime, particlesCount) {
|
|
8
|
-
throw new Error('Abstract method');
|
|
9
|
-
};
|
|
10
|
-
AbstractEmission.prototype.reset = function () {
|
|
11
|
-
//
|
|
12
|
-
};
|
|
13
|
-
AbstractEmission.prototype.getName = function () {
|
|
14
|
-
throw new Error('This method has to be overridden in subclass');
|
|
15
|
-
};
|
|
16
|
-
AbstractEmission.prototype.getParser = function () {
|
|
17
|
-
return new parser_1.EmitControllerParser(this);
|
|
18
|
-
};
|
|
19
|
-
return AbstractEmission;
|
|
20
|
-
}());
|
|
21
|
-
exports.default = AbstractEmission;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var parser_1 = require("../parser");
|
|
4
|
+
var AbstractEmission = /** @class */ (function () {
|
|
5
|
+
function AbstractEmission() {
|
|
6
|
+
}
|
|
7
|
+
AbstractEmission.prototype.howMany = function (deltaTime, particlesCount) {
|
|
8
|
+
throw new Error('Abstract method');
|
|
9
|
+
};
|
|
10
|
+
AbstractEmission.prototype.reset = function () {
|
|
11
|
+
//
|
|
12
|
+
};
|
|
13
|
+
AbstractEmission.prototype.getName = function () {
|
|
14
|
+
throw new Error('This method has to be overridden in subclass');
|
|
15
|
+
};
|
|
16
|
+
AbstractEmission.prototype.getParser = function () {
|
|
17
|
+
return new parser_1.EmitControllerParser(this);
|
|
18
|
+
};
|
|
19
|
+
return AbstractEmission;
|
|
20
|
+
}());
|
|
21
|
+
exports.default = AbstractEmission;
|
|
22
22
|
//# sourceMappingURL=AbstractEmission.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
DEFAULT: string;
|
|
3
|
-
RANDOM: string;
|
|
4
|
-
UNIFORM: string;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
DEFAULT: string;
|
|
3
|
+
RANDOM: string;
|
|
4
|
+
UNIFORM: string;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
DEFAULT: 'UniformEmission',
|
|
5
|
-
RANDOM: 'RandomEmission',
|
|
6
|
-
UNIFORM: 'StandardEmission',
|
|
7
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
DEFAULT: 'UniformEmission',
|
|
5
|
+
RANDOM: 'RandomEmission',
|
|
6
|
+
UNIFORM: 'StandardEmission',
|
|
7
|
+
};
|
|
8
8
|
//# sourceMappingURL=EmissionTypes.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AbstractEmission } from './index';
|
|
2
|
-
export default class RandomEmission extends AbstractEmission {
|
|
3
|
-
_maxParticles: number;
|
|
4
|
-
_emissionRate: number;
|
|
5
|
-
howMany(deltaTime: number, particlesCount: number): number;
|
|
6
|
-
get emissionRate(): number;
|
|
7
|
-
set emissionRate(value: number);
|
|
8
|
-
get maxParticles(): number;
|
|
9
|
-
set maxParticles(value: number);
|
|
10
|
-
getName: () => string;
|
|
11
|
-
}
|
|
1
|
+
import { AbstractEmission } from './index';
|
|
2
|
+
export default class RandomEmission extends AbstractEmission {
|
|
3
|
+
_maxParticles: number;
|
|
4
|
+
_emissionRate: number;
|
|
5
|
+
howMany(deltaTime: number, particlesCount: number): number;
|
|
6
|
+
get emissionRate(): number;
|
|
7
|
+
set emissionRate(value: number);
|
|
8
|
+
get maxParticles(): number;
|
|
9
|
+
set maxParticles(value: number);
|
|
10
|
+
getName: () => string;
|
|
11
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var index_1 = require("./index");
|
|
19
|
-
var util_1 = require("../util");
|
|
20
|
-
var RandomEmission = /** @class */ (function (_super) {
|
|
21
|
-
__extends(RandomEmission, _super);
|
|
22
|
-
function RandomEmission() {
|
|
23
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
_this._maxParticles = 0;
|
|
25
|
-
_this._emissionRate = 0;
|
|
26
|
-
_this.getName = function () {
|
|
27
|
-
return index_1.EmissionTypes.RANDOM;
|
|
28
|
-
};
|
|
29
|
-
return _this;
|
|
30
|
-
}
|
|
31
|
-
RandomEmission.prototype.howMany = function (deltaTime, particlesCount) {
|
|
32
|
-
if (particlesCount < this.maxParticles) {
|
|
33
|
-
var count = Math.round(util_1.Random.uniform(0, Math.ceil(this.emissionRate * deltaTime)));
|
|
34
|
-
var total = particlesCount + count;
|
|
35
|
-
return total > this._maxParticles ? this.maxParticles - particlesCount : count;
|
|
36
|
-
}
|
|
37
|
-
return 0;
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(RandomEmission.prototype, "emissionRate", {
|
|
40
|
-
get: function () {
|
|
41
|
-
return this._emissionRate;
|
|
42
|
-
},
|
|
43
|
-
set: function (value) {
|
|
44
|
-
this._emissionRate = Math.max(0, value);
|
|
45
|
-
},
|
|
46
|
-
enumerable: false,
|
|
47
|
-
configurable: true
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(RandomEmission.prototype, "maxParticles", {
|
|
50
|
-
get: function () {
|
|
51
|
-
return this._maxParticles;
|
|
52
|
-
},
|
|
53
|
-
set: function (value) {
|
|
54
|
-
this._maxParticles = Math.max(0, value);
|
|
55
|
-
},
|
|
56
|
-
enumerable: false,
|
|
57
|
-
configurable: true
|
|
58
|
-
});
|
|
59
|
-
return RandomEmission;
|
|
60
|
-
}(index_1.AbstractEmission));
|
|
61
|
-
exports.default = RandomEmission;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var index_1 = require("./index");
|
|
19
|
+
var util_1 = require("../util");
|
|
20
|
+
var RandomEmission = /** @class */ (function (_super) {
|
|
21
|
+
__extends(RandomEmission, _super);
|
|
22
|
+
function RandomEmission() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this._maxParticles = 0;
|
|
25
|
+
_this._emissionRate = 0;
|
|
26
|
+
_this.getName = function () {
|
|
27
|
+
return index_1.EmissionTypes.RANDOM;
|
|
28
|
+
};
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
RandomEmission.prototype.howMany = function (deltaTime, particlesCount) {
|
|
32
|
+
if (particlesCount < this.maxParticles) {
|
|
33
|
+
var count = Math.round(util_1.Random.uniform(0, Math.ceil(this.emissionRate * deltaTime)));
|
|
34
|
+
var total = particlesCount + count;
|
|
35
|
+
return total > this._maxParticles ? this.maxParticles - particlesCount : count;
|
|
36
|
+
}
|
|
37
|
+
return 0;
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(RandomEmission.prototype, "emissionRate", {
|
|
40
|
+
get: function () {
|
|
41
|
+
return this._emissionRate;
|
|
42
|
+
},
|
|
43
|
+
set: function (value) {
|
|
44
|
+
this._emissionRate = Math.max(0, value);
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(RandomEmission.prototype, "maxParticles", {
|
|
50
|
+
get: function () {
|
|
51
|
+
return this._maxParticles;
|
|
52
|
+
},
|
|
53
|
+
set: function (value) {
|
|
54
|
+
this._maxParticles = Math.max(0, value);
|
|
55
|
+
},
|
|
56
|
+
enumerable: false,
|
|
57
|
+
configurable: true
|
|
58
|
+
});
|
|
59
|
+
return RandomEmission;
|
|
60
|
+
}(index_1.AbstractEmission));
|
|
61
|
+
exports.default = RandomEmission;
|
|
62
62
|
//# sourceMappingURL=RandomEmission.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AbstractEmission } from './index';
|
|
2
|
-
export default class StandardEmission extends AbstractEmission {
|
|
3
|
-
_maxParticles: number;
|
|
4
|
-
_emissionRate: number;
|
|
5
|
-
_emitCounter: number;
|
|
6
|
-
howMany(deltaTime: number, particlesCount: number): number;
|
|
7
|
-
get emissionRate(): number;
|
|
8
|
-
set emissionRate(value: number);
|
|
9
|
-
get maxParticles(): number;
|
|
10
|
-
set maxParticles(value: number);
|
|
11
|
-
getName: () => string;
|
|
12
|
-
}
|
|
1
|
+
import { AbstractEmission } from './index';
|
|
2
|
+
export default class StandardEmission extends AbstractEmission {
|
|
3
|
+
_maxParticles: number;
|
|
4
|
+
_emissionRate: number;
|
|
5
|
+
_emitCounter: number;
|
|
6
|
+
howMany(deltaTime: number, particlesCount: number): number;
|
|
7
|
+
get emissionRate(): number;
|
|
8
|
+
set emissionRate(value: number);
|
|
9
|
+
get maxParticles(): number;
|
|
10
|
+
set maxParticles(value: number);
|
|
11
|
+
getName: () => string;
|
|
12
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var index_1 = require("./index");
|
|
19
|
-
var StandardEmission = /** @class */ (function (_super) {
|
|
20
|
-
__extends(StandardEmission, _super);
|
|
21
|
-
function StandardEmission() {
|
|
22
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
-
_this._maxParticles = 0;
|
|
24
|
-
_this._emissionRate = 0;
|
|
25
|
-
_this._emitCounter = 0;
|
|
26
|
-
_this.getName = function () {
|
|
27
|
-
return index_1.EmissionTypes.UNIFORM;
|
|
28
|
-
};
|
|
29
|
-
return _this;
|
|
30
|
-
}
|
|
31
|
-
StandardEmission.prototype.howMany = function (deltaTime, particlesCount) {
|
|
32
|
-
var rate = 1.0 / this.emissionRate;
|
|
33
|
-
var count = 0;
|
|
34
|
-
if (particlesCount < this.maxParticles) {
|
|
35
|
-
this._emitCounter += deltaTime;
|
|
36
|
-
}
|
|
37
|
-
while (particlesCount < this.maxParticles && this._emitCounter > rate) {
|
|
38
|
-
count++;
|
|
39
|
-
this._emitCounter -= rate;
|
|
40
|
-
}
|
|
41
|
-
return count;
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(StandardEmission.prototype, "emissionRate", {
|
|
44
|
-
get: function () {
|
|
45
|
-
return this._emissionRate;
|
|
46
|
-
},
|
|
47
|
-
set: function (value) {
|
|
48
|
-
this._emissionRate = Math.max(0, value);
|
|
49
|
-
},
|
|
50
|
-
enumerable: false,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(StandardEmission.prototype, "maxParticles", {
|
|
54
|
-
get: function () {
|
|
55
|
-
return this._maxParticles;
|
|
56
|
-
},
|
|
57
|
-
set: function (value) {
|
|
58
|
-
this._maxParticles = Math.max(0, value);
|
|
59
|
-
},
|
|
60
|
-
enumerable: false,
|
|
61
|
-
configurable: true
|
|
62
|
-
});
|
|
63
|
-
return StandardEmission;
|
|
64
|
-
}(index_1.AbstractEmission));
|
|
65
|
-
exports.default = StandardEmission;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var index_1 = require("./index");
|
|
19
|
+
var StandardEmission = /** @class */ (function (_super) {
|
|
20
|
+
__extends(StandardEmission, _super);
|
|
21
|
+
function StandardEmission() {
|
|
22
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
_this._maxParticles = 0;
|
|
24
|
+
_this._emissionRate = 0;
|
|
25
|
+
_this._emitCounter = 0;
|
|
26
|
+
_this.getName = function () {
|
|
27
|
+
return index_1.EmissionTypes.UNIFORM;
|
|
28
|
+
};
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
StandardEmission.prototype.howMany = function (deltaTime, particlesCount) {
|
|
32
|
+
var rate = 1.0 / this.emissionRate;
|
|
33
|
+
var count = 0;
|
|
34
|
+
if (particlesCount < this.maxParticles) {
|
|
35
|
+
this._emitCounter += deltaTime;
|
|
36
|
+
}
|
|
37
|
+
while (particlesCount < this.maxParticles && this._emitCounter > rate) {
|
|
38
|
+
count++;
|
|
39
|
+
this._emitCounter -= rate;
|
|
40
|
+
}
|
|
41
|
+
return count;
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(StandardEmission.prototype, "emissionRate", {
|
|
44
|
+
get: function () {
|
|
45
|
+
return this._emissionRate;
|
|
46
|
+
},
|
|
47
|
+
set: function (value) {
|
|
48
|
+
this._emissionRate = Math.max(0, value);
|
|
49
|
+
},
|
|
50
|
+
enumerable: false,
|
|
51
|
+
configurable: true
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(StandardEmission.prototype, "maxParticles", {
|
|
54
|
+
get: function () {
|
|
55
|
+
return this._maxParticles;
|
|
56
|
+
},
|
|
57
|
+
set: function (value) {
|
|
58
|
+
this._maxParticles = Math.max(0, value);
|
|
59
|
+
},
|
|
60
|
+
enumerable: false,
|
|
61
|
+
configurable: true
|
|
62
|
+
});
|
|
63
|
+
return StandardEmission;
|
|
64
|
+
}(index_1.AbstractEmission));
|
|
65
|
+
exports.default = StandardEmission;
|
|
66
66
|
//# sourceMappingURL=StandardEmission.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { AbstractEmission } from './index';
|
|
2
|
-
export default class UniformEmission extends AbstractEmission {
|
|
3
|
-
_maxParticles: number;
|
|
4
|
-
_maxLife: number;
|
|
5
|
-
_emitPerSecond: number;
|
|
6
|
-
_frames: number;
|
|
7
|
-
howMany(deltaTime: number, particlesCount: number): number;
|
|
8
|
-
refresh(): void;
|
|
9
|
-
set maxLife(value: number);
|
|
10
|
-
set maxParticles(value: number);
|
|
11
|
-
get emitPerSecond(): number;
|
|
12
|
-
set emitPerSecond(value: number);
|
|
13
|
-
getName: () => string;
|
|
14
|
-
}
|
|
1
|
+
import { AbstractEmission } from './index';
|
|
2
|
+
export default class UniformEmission extends AbstractEmission {
|
|
3
|
+
_maxParticles: number;
|
|
4
|
+
_maxLife: number;
|
|
5
|
+
_emitPerSecond: number;
|
|
6
|
+
_frames: number;
|
|
7
|
+
howMany(deltaTime: number, particlesCount: number): number;
|
|
8
|
+
refresh(): void;
|
|
9
|
+
set maxLife(value: number);
|
|
10
|
+
set maxParticles(value: number);
|
|
11
|
+
get emitPerSecond(): number;
|
|
12
|
+
set emitPerSecond(value: number);
|
|
13
|
+
getName: () => string;
|
|
14
|
+
}
|