|
@@ -51245,7 +51245,6 @@ var BABYLON;
|
|
this._stopped = false;
|
|
this._stopped = false;
|
|
this._actualFrame = 0;
|
|
this._actualFrame = 0;
|
|
this._vertexBufferSize = 11;
|
|
this._vertexBufferSize = 11;
|
|
- this._isEmitting = false;
|
|
|
|
// start of sub system methods
|
|
// start of sub system methods
|
|
/**
|
|
/**
|
|
* "Recycles" one of the particle by copying it back to the "stock" of particles and removing it from the active list.
|
|
* "Recycles" one of the particle by copying it back to the "stock" of particles and removing it from the active list.
|
|
@@ -51270,21 +51269,6 @@ var BABYLON;
|
|
}
|
|
}
|
|
return particle;
|
|
return particle;
|
|
};
|
|
};
|
|
- // to be overriden by subSystems
|
|
|
|
- this._stoppedEmitting = function () {
|
|
|
|
- if (!_this._rootParticleSystem) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!_this.subEmitters || _this.subEmitters.length === 0) {
|
|
|
|
- _this._scene._toBeDisposed.push(_this);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- var index = _this._rootParticleSystem.activeSubSystems.indexOf(_this, 0);
|
|
|
|
- if (index > -1) {
|
|
|
|
- _this._rootParticleSystem.activeSubSystems.splice(index, 1);
|
|
|
|
- _this._scene._toBeDisposed.push(_this);
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
this._emitFromParticle = function (particle) {
|
|
this._emitFromParticle = function (particle) {
|
|
if (!_this.subEmitters || _this.subEmitters.length === 0) {
|
|
if (!_this.subEmitters || _this.subEmitters.length === 0) {
|
|
return;
|
|
return;
|
|
@@ -51575,23 +51559,27 @@ var BABYLON;
|
|
this._vertexData[offset + 11] = particle.cellIndex;
|
|
this._vertexData[offset + 11] = particle.cellIndex;
|
|
};
|
|
};
|
|
ParticleSystem.prototype._stopSubEmitters = function () {
|
|
ParticleSystem.prototype._stopSubEmitters = function () {
|
|
|
|
+ if (!this.activeSubSystems) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.activeSubSystems.forEach(function (subSystem) {
|
|
this.activeSubSystems.forEach(function (subSystem) {
|
|
subSystem.stop(true);
|
|
subSystem.stop(true);
|
|
- subSystem._stoppedEmitting();
|
|
|
|
});
|
|
});
|
|
this.activeSubSystems = new Array();
|
|
this.activeSubSystems = new Array();
|
|
};
|
|
};
|
|
|
|
+ ParticleSystem.prototype._removeFromRoot = function () {
|
|
|
|
+ if (!this._rootParticleSystem) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ var index = this._rootParticleSystem.activeSubSystems.indexOf(this);
|
|
|
|
+ if (index !== -1) {
|
|
|
|
+ this._rootParticleSystem.activeSubSystems.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
// end of sub system methods
|
|
// end of sub system methods
|
|
ParticleSystem.prototype._update = function (newParticles) {
|
|
ParticleSystem.prototype._update = function (newParticles) {
|
|
// Update current
|
|
// Update current
|
|
this._alive = this._particles.length > 0;
|
|
this._alive = this._particles.length > 0;
|
|
- if (this._alive) {
|
|
|
|
- this._isEmitting = true;
|
|
|
|
- }
|
|
|
|
- if (!this._alive && this._isEmitting) {
|
|
|
|
- this._isEmitting = false;
|
|
|
|
- this._stoppedEmitting();
|
|
|
|
- }
|
|
|
|
this.updateFunction(this._particles);
|
|
this.updateFunction(this._particles);
|
|
// Add new ones
|
|
// Add new ones
|
|
var worldMatrix;
|
|
var worldMatrix;
|
|
@@ -51731,6 +51719,9 @@ var BABYLON;
|
|
if (this._vertexBuffer) {
|
|
if (this._vertexBuffer) {
|
|
this._vertexBuffer.update(this._vertexData);
|
|
this._vertexBuffer.update(this._vertexData);
|
|
}
|
|
}
|
|
|
|
+ if (this.manualEmitCount === 0 && this.disposeOnStop) {
|
|
|
|
+ this.stop();
|
|
|
|
+ }
|
|
};
|
|
};
|
|
ParticleSystem.prototype._appenedParticleVertexesWithSheet = function (offset, particle) {
|
|
ParticleSystem.prototype._appenedParticleVertexesWithSheet = function (offset, particle) {
|
|
this._appendParticleVertexWithAnimation(offset++, particle, 0, 0);
|
|
this._appendParticleVertexWithAnimation(offset++, particle, 0, 0);
|
|
@@ -51817,6 +51808,7 @@ var BABYLON;
|
|
this.particleTexture.dispose();
|
|
this.particleTexture.dispose();
|
|
this.particleTexture = null;
|
|
this.particleTexture = null;
|
|
}
|
|
}
|
|
|
|
+ this._removeFromRoot();
|
|
// Remove from scene
|
|
// Remove from scene
|
|
var index = this._scene.particleSystems.indexOf(this);
|
|
var index = this._scene.particleSystems.indexOf(this);
|
|
if (index > -1) {
|
|
if (index > -1) {
|