|
@@ -50759,6 +50759,13 @@ var BABYLON;
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
|
|
+ /**
|
|
|
|
+ * Returns the string "ParticleSystem"
|
|
|
|
+ * @returns a string containing the class name
|
|
|
|
+ */
|
|
|
|
+ ParticleSystem.prototype.getClassName = function () {
|
|
|
|
+ return "ParticleSystem";
|
|
|
|
+ };
|
|
ParticleSystem.prototype._createIndexBuffer = function () {
|
|
ParticleSystem.prototype._createIndexBuffer = function () {
|
|
var indices = [];
|
|
var indices = [];
|
|
var index = 0;
|
|
var index = 0;
|
|
@@ -51252,6 +51259,10 @@ var BABYLON;
|
|
serializationObject.spriteCellWidth = this.spriteCellWidth;
|
|
serializationObject.spriteCellWidth = this.spriteCellWidth;
|
|
serializationObject.spriteCellHeight = this.spriteCellHeight;
|
|
serializationObject.spriteCellHeight = this.spriteCellHeight;
|
|
serializationObject.isAnimationSheetEnabled = this._isAnimationSheetEnabled;
|
|
serializationObject.isAnimationSheetEnabled = this._isAnimationSheetEnabled;
|
|
|
|
+ // Emitter
|
|
|
|
+ if (this.particleEmitterType) {
|
|
|
|
+ serializationObject.particleEmitterType = this.particleEmitterType.serialize();
|
|
|
|
+ }
|
|
return serializationObject;
|
|
return serializationObject;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -51428,6 +51439,40 @@ var BABYLON;
|
|
BoxParticleEmitter.prototype.getEffectDefines = function () {
|
|
BoxParticleEmitter.prototype.getEffectDefines = function () {
|
|
return "#define BOXEMITTER";
|
|
return "#define BOXEMITTER";
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Returns the string "BoxEmitter"
|
|
|
|
+ * @returns a string containing the class name
|
|
|
|
+ */
|
|
|
|
+ BoxParticleEmitter.prototype.getClassName = function () {
|
|
|
|
+ return "BoxEmitter";
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Serializes the particle system to a JSON object.
|
|
|
|
+ * @returns the JSON object
|
|
|
|
+ */
|
|
|
|
+ BoxParticleEmitter.prototype.serialize = function () {
|
|
|
|
+ var serializationObject = {};
|
|
|
|
+ serializationObject.type = this.getClassName();
|
|
|
|
+ serializationObject.direction1 = this.direction1.asArray();
|
|
|
|
+ ;
|
|
|
|
+ serializationObject.direction2 = this.direction2.asArray();
|
|
|
|
+ ;
|
|
|
|
+ serializationObject.minEmitBox = this.minEmitBox.asArray();
|
|
|
|
+ ;
|
|
|
|
+ serializationObject.maxEmitBox = this.maxEmitBox.asArray();
|
|
|
|
+ ;
|
|
|
|
+ return serializationObject;
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Parse properties from a JSON object
|
|
|
|
+ * @param serializationObject defines the JSON object
|
|
|
|
+ */
|
|
|
|
+ BoxParticleEmitter.prototype.parse = function (serializationObject) {
|
|
|
|
+ this.direction1.copyFrom(serializationObject.direction1);
|
|
|
|
+ this.direction2.copyFrom(serializationObject.direction2);
|
|
|
|
+ this.minEmitBox.copyFrom(serializationObject.minEmitBox);
|
|
|
|
+ this.maxEmitBox.copyFrom(serializationObject.maxEmitBox);
|
|
|
|
+ };
|
|
return BoxParticleEmitter;
|
|
return BoxParticleEmitter;
|
|
}());
|
|
}());
|
|
BABYLON.BoxParticleEmitter = BoxParticleEmitter;
|
|
BABYLON.BoxParticleEmitter = BoxParticleEmitter;
|
|
@@ -51445,8 +51490,8 @@ var BABYLON;
|
|
var ConeParticleEmitter = /** @class */ (function () {
|
|
var ConeParticleEmitter = /** @class */ (function () {
|
|
/**
|
|
/**
|
|
* Creates a new instance of @see ConeParticleEmitter
|
|
* Creates a new instance of @see ConeParticleEmitter
|
|
- * @param radius the radius of the emission cone
|
|
|
|
- * @param angles the cone base angle
|
|
|
|
|
|
+ * @param radius the radius of the emission cone (1 by default)
|
|
|
|
+ * @param angles the cone base angle (PI by default)
|
|
* @param directionRandomizer defines how much to randomize the particle direction [0-1]
|
|
* @param directionRandomizer defines how much to randomize the particle direction [0-1]
|
|
*/
|
|
*/
|
|
function ConeParticleEmitter(radius,
|
|
function ConeParticleEmitter(radius,
|
|
@@ -51458,6 +51503,8 @@ var BABYLON;
|
|
* The cone base angle.
|
|
* The cone base angle.
|
|
*/
|
|
*/
|
|
directionRandomizer) {
|
|
directionRandomizer) {
|
|
|
|
+ if (radius === void 0) { radius = 1; }
|
|
|
|
+ if (angle === void 0) { angle = Math.PI; }
|
|
if (directionRandomizer === void 0) { directionRandomizer = 0; }
|
|
if (directionRandomizer === void 0) { directionRandomizer = 0; }
|
|
this.angle = angle;
|
|
this.angle = angle;
|
|
this.directionRandomizer = directionRandomizer;
|
|
this.directionRandomizer = directionRandomizer;
|
|
@@ -51553,6 +51600,34 @@ var BABYLON;
|
|
ConeParticleEmitter.prototype.getEffectDefines = function () {
|
|
ConeParticleEmitter.prototype.getEffectDefines = function () {
|
|
return "#define CONEEMITTER";
|
|
return "#define CONEEMITTER";
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Returns the string "BoxEmitter"
|
|
|
|
+ * @returns a string containing the class name
|
|
|
|
+ */
|
|
|
|
+ ConeParticleEmitter.prototype.getClassName = function () {
|
|
|
|
+ return "ConeEmitter";
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Serializes the particle system to a JSON object.
|
|
|
|
+ * @returns the JSON object
|
|
|
|
+ */
|
|
|
|
+ ConeParticleEmitter.prototype.serialize = function () {
|
|
|
|
+ var serializationObject = {};
|
|
|
|
+ serializationObject.type = this.getClassName();
|
|
|
|
+ serializationObject.radius = this.radius;
|
|
|
|
+ serializationObject.angle = this.angle;
|
|
|
|
+ serializationObject.directionRandomizer = this.directionRandomizer;
|
|
|
|
+ return serializationObject;
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Parse properties from a JSON object
|
|
|
|
+ * @param serializationObject defines the JSON object
|
|
|
|
+ */
|
|
|
|
+ ConeParticleEmitter.prototype.parse = function (serializationObject) {
|
|
|
|
+ this.radius = serializationObject.radius;
|
|
|
|
+ this.angle = serializationObject.angle;
|
|
|
|
+ this.directionRandomizer = serializationObject.directionRandomizer;
|
|
|
|
+ };
|
|
return ConeParticleEmitter;
|
|
return ConeParticleEmitter;
|
|
}());
|
|
}());
|
|
BABYLON.ConeParticleEmitter = ConeParticleEmitter;
|
|
BABYLON.ConeParticleEmitter = ConeParticleEmitter;
|
|
@@ -51570,7 +51645,7 @@ var BABYLON;
|
|
var SphereParticleEmitter = /** @class */ (function () {
|
|
var SphereParticleEmitter = /** @class */ (function () {
|
|
/**
|
|
/**
|
|
* Creates a new instance of @see SphereParticleEmitter
|
|
* Creates a new instance of @see SphereParticleEmitter
|
|
- * @param radius the radius of the emission sphere
|
|
|
|
|
|
+ * @param radius the radius of the emission sphere (1 by default)
|
|
* @param directionRandomizer defines how much to randomize the particle direction [0-1]
|
|
* @param directionRandomizer defines how much to randomize the particle direction [0-1]
|
|
*/
|
|
*/
|
|
function SphereParticleEmitter(
|
|
function SphereParticleEmitter(
|
|
@@ -51582,6 +51657,7 @@ var BABYLON;
|
|
* How much to randomize the particle direction [0-1].
|
|
* How much to randomize the particle direction [0-1].
|
|
*/
|
|
*/
|
|
directionRandomizer) {
|
|
directionRandomizer) {
|
|
|
|
+ if (radius === void 0) { radius = 1; }
|
|
if (directionRandomizer === void 0) { directionRandomizer = 0; }
|
|
if (directionRandomizer === void 0) { directionRandomizer = 0; }
|
|
this.radius = radius;
|
|
this.radius = radius;
|
|
this.directionRandomizer = directionRandomizer;
|
|
this.directionRandomizer = directionRandomizer;
|
|
@@ -51642,6 +51718,32 @@ var BABYLON;
|
|
SphereParticleEmitter.prototype.getEffectDefines = function () {
|
|
SphereParticleEmitter.prototype.getEffectDefines = function () {
|
|
return "#define SPHEREEMITTER";
|
|
return "#define SPHEREEMITTER";
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Returns the string "SphereParticleEmitter"
|
|
|
|
+ * @returns a string containing the class name
|
|
|
|
+ */
|
|
|
|
+ SphereParticleEmitter.prototype.getClassName = function () {
|
|
|
|
+ return "SphereParticleEmitter";
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Serializes the particle system to a JSON object.
|
|
|
|
+ * @returns the JSON object
|
|
|
|
+ */
|
|
|
|
+ SphereParticleEmitter.prototype.serialize = function () {
|
|
|
|
+ var serializationObject = {};
|
|
|
|
+ serializationObject.type = this.getClassName();
|
|
|
|
+ serializationObject.radius = this.radius;
|
|
|
|
+ serializationObject.directionRandomizer = this.directionRandomizer;
|
|
|
|
+ return serializationObject;
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Parse properties from a JSON object
|
|
|
|
+ * @param serializationObject defines the JSON object
|
|
|
|
+ */
|
|
|
|
+ SphereParticleEmitter.prototype.parse = function (serializationObject) {
|
|
|
|
+ this.radius = serializationObject.radius;
|
|
|
|
+ this.directionRandomizer = serializationObject.directionRandomizer;
|
|
|
|
+ };
|
|
return SphereParticleEmitter;
|
|
return SphereParticleEmitter;
|
|
}());
|
|
}());
|
|
BABYLON.SphereParticleEmitter = SphereParticleEmitter;
|
|
BABYLON.SphereParticleEmitter = SphereParticleEmitter;
|
|
@@ -51653,9 +51755,9 @@ var BABYLON;
|
|
__extends(SphereDirectedParticleEmitter, _super);
|
|
__extends(SphereDirectedParticleEmitter, _super);
|
|
/**
|
|
/**
|
|
* Creates a new instance of @see SphereDirectedParticleEmitter
|
|
* Creates a new instance of @see SphereDirectedParticleEmitter
|
|
- * @param radius the radius of the emission sphere
|
|
|
|
- * @param direction1 the min limit of the emission direction
|
|
|
|
- * @param direction2 the max limit of the emission direction
|
|
|
|
|
|
+ * @param radius the radius of the emission sphere (1 by default)
|
|
|
|
+ * @param direction1 the min limit of the emission direction (up vector by default)
|
|
|
|
+ * @param direction2 the max limit of the emission direction (up vector by default)
|
|
*/
|
|
*/
|
|
function SphereDirectedParticleEmitter(radius,
|
|
function SphereDirectedParticleEmitter(radius,
|
|
/**
|
|
/**
|
|
@@ -51666,6 +51768,9 @@ var BABYLON;
|
|
* The max limit of the emission direction.
|
|
* The max limit of the emission direction.
|
|
*/
|
|
*/
|
|
direction2) {
|
|
direction2) {
|
|
|
|
+ if (radius === void 0) { radius = 1; }
|
|
|
|
+ if (direction1 === void 0) { direction1 = new BABYLON.Vector3(0, 1, 0); }
|
|
|
|
+ if (direction2 === void 0) { direction2 = new BABYLON.Vector3(0, 1, 0); }
|
|
var _this = _super.call(this, radius) || this;
|
|
var _this = _super.call(this, radius) || this;
|
|
_this.direction1 = direction1;
|
|
_this.direction1 = direction1;
|
|
_this.direction2 = direction2;
|
|
_this.direction2 = direction2;
|
|
@@ -51709,6 +51814,35 @@ var BABYLON;
|
|
SphereDirectedParticleEmitter.prototype.getEffectDefines = function () {
|
|
SphereDirectedParticleEmitter.prototype.getEffectDefines = function () {
|
|
return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER";
|
|
return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER";
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Returns the string "SphereDirectedParticleEmitter"
|
|
|
|
+ * @returns a string containing the class name
|
|
|
|
+ */
|
|
|
|
+ SphereDirectedParticleEmitter.prototype.getClassName = function () {
|
|
|
|
+ return "SphereDirectedParticleEmitter";
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Serializes the particle system to a JSON object.
|
|
|
|
+ * @returns the JSON object
|
|
|
|
+ */
|
|
|
|
+ SphereDirectedParticleEmitter.prototype.serialize = function () {
|
|
|
|
+ var serializationObject = _super.prototype.serialize.call(this);
|
|
|
|
+ ;
|
|
|
|
+ serializationObject.direction1 = this.direction1.asArray();
|
|
|
|
+ ;
|
|
|
|
+ serializationObject.direction2 = this.direction2.asArray();
|
|
|
|
+ ;
|
|
|
|
+ return serializationObject;
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Parse properties from a JSON object
|
|
|
|
+ * @param serializationObject defines the JSON object
|
|
|
|
+ */
|
|
|
|
+ SphereDirectedParticleEmitter.prototype.parse = function (serializationObject) {
|
|
|
|
+ _super.prototype.parse.call(this, serializationObject);
|
|
|
|
+ this.direction1.copyFrom(serializationObject.direction1);
|
|
|
|
+ this.direction2.copyFrom(serializationObject.direction2);
|
|
|
|
+ };
|
|
return SphereDirectedParticleEmitter;
|
|
return SphereDirectedParticleEmitter;
|
|
}(SphereParticleEmitter));
|
|
}(SphereParticleEmitter));
|
|
BABYLON.SphereDirectedParticleEmitter = SphereDirectedParticleEmitter;
|
|
BABYLON.SphereDirectedParticleEmitter = SphereDirectedParticleEmitter;
|
|
@@ -51754,7 +51888,7 @@ var BABYLON;
|
|
/**
|
|
/**
|
|
* The layer mask we are rendering the particles through.
|
|
* The layer mask we are rendering the particles through.
|
|
*/
|
|
*/
|
|
- this.layerMask = 0x0FFFFFFF; // TODO
|
|
|
|
|
|
+ this.layerMask = 0x0FFFFFFF;
|
|
this._updateVAO = new Array();
|
|
this._updateVAO = new Array();
|
|
this._renderVAO = new Array();
|
|
this._renderVAO = new Array();
|
|
this._targetIndex = 0;
|
|
this._targetIndex = 0;
|
|
@@ -51929,6 +52063,13 @@ var BABYLON;
|
|
this._currentActiveCount = 0;
|
|
this._currentActiveCount = 0;
|
|
this._targetIndex = 0;
|
|
this._targetIndex = 0;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Returns the string "GPUParticleSystem"
|
|
|
|
+ * @returns a string containing the class name
|
|
|
|
+ */
|
|
|
|
+ GPUParticleSystem.prototype.getClassName = function () {
|
|
|
|
+ return "GPUParticleSystem";
|
|
|
|
+ };
|
|
GPUParticleSystem.prototype._createUpdateVAO = function (source) {
|
|
GPUParticleSystem.prototype._createUpdateVAO = function (source) {
|
|
var updateVertexBuffers = {};
|
|
var updateVertexBuffers = {};
|
|
updateVertexBuffers["position"] = source.createVertexBuffer("position", 0, 3);
|
|
updateVertexBuffers["position"] = source.createVertexBuffer("position", 0, 3);
|
|
@@ -52159,7 +52300,6 @@ var BABYLON;
|
|
this.onDisposeObservable.notifyObservers(this);
|
|
this.onDisposeObservable.notifyObservers(this);
|
|
this.onDisposeObservable.clear();
|
|
this.onDisposeObservable.clear();
|
|
};
|
|
};
|
|
- //TODO: Clone / Parse / serialize
|
|
|
|
/**
|
|
/**
|
|
* Clones the particle system.
|
|
* Clones the particle system.
|
|
* @param name The name of the cloned object
|
|
* @param name The name of the cloned object
|
|
@@ -52167,7 +52307,16 @@ var BABYLON;
|
|
* @returns the cloned particle system
|
|
* @returns the cloned particle system
|
|
*/
|
|
*/
|
|
GPUParticleSystem.prototype.clone = function (name, newEmitter) {
|
|
GPUParticleSystem.prototype.clone = function (name, newEmitter) {
|
|
- return null;
|
|
|
|
|
|
+ var result = new GPUParticleSystem(name, { capacity: this._capacity, randomTextureSize: this._randomTextureSize }, this._scene);
|
|
|
|
+ BABYLON.Tools.DeepCopy(this, result);
|
|
|
|
+ if (newEmitter === undefined) {
|
|
|
|
+ newEmitter = this.emitter;
|
|
|
|
+ }
|
|
|
|
+ result.emitter = newEmitter;
|
|
|
|
+ if (this.particleTexture) {
|
|
|
|
+ result.particleTexture = new BABYLON.Texture(this.particleTexture.url, this._scene);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Serializes the particle system to a JSON object.
|
|
* Serializes the particle system to a JSON object.
|
|
@@ -52209,9 +52358,83 @@ var BABYLON;
|
|
serializationObject.updateSpeed = this.updateSpeed;
|
|
serializationObject.updateSpeed = this.updateSpeed;
|
|
serializationObject.targetStopDuration = this.targetStopDuration;
|
|
serializationObject.targetStopDuration = this.targetStopDuration;
|
|
serializationObject.blendMode = this.blendMode;
|
|
serializationObject.blendMode = this.blendMode;
|
|
- // Emitters
|
|
|
|
|
|
+ // Emitter
|
|
|
|
+ if (this.particleEmitterType) {
|
|
|
|
+ serializationObject.particleEmitterType = this.particleEmitterType.serialize();
|
|
|
|
+ }
|
|
return serializationObject;
|
|
return serializationObject;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Parses a JSON object to create a GPU particle system.
|
|
|
|
+ * @param parsedParticleSystem The JSON object to parse
|
|
|
|
+ * @param scene The scene to create the particle system in
|
|
|
|
+ * @param rootUrl The root url to use to load external dependencies like texture
|
|
|
|
+ * @returns the parsed GPU particle system
|
|
|
|
+ */
|
|
|
|
+ GPUParticleSystem.Parse = function (parsedParticleSystem, scene, rootUrl) {
|
|
|
|
+ var name = parsedParticleSystem.name;
|
|
|
|
+ var particleSystem = new GPUParticleSystem(name, { capacity: parsedParticleSystem.capacity, randomTextureSize: parsedParticleSystem.randomTextureSize }, scene);
|
|
|
|
+ if (parsedParticleSystem.id) {
|
|
|
|
+ particleSystem.id = parsedParticleSystem.id;
|
|
|
|
+ }
|
|
|
|
+ // Texture
|
|
|
|
+ if (parsedParticleSystem.textureName) {
|
|
|
|
+ particleSystem.particleTexture = new BABYLON.Texture(rootUrl + parsedParticleSystem.textureName, scene);
|
|
|
|
+ particleSystem.particleTexture.name = parsedParticleSystem.textureName;
|
|
|
|
+ }
|
|
|
|
+ // Emitter
|
|
|
|
+ if (parsedParticleSystem.emitterId) {
|
|
|
|
+ particleSystem.emitter = scene.getLastMeshByID(parsedParticleSystem.emitterId);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ particleSystem.emitter = BABYLON.Vector3.FromArray(parsedParticleSystem.emitter);
|
|
|
|
+ }
|
|
|
|
+ // Animations
|
|
|
|
+ if (parsedParticleSystem.animations) {
|
|
|
|
+ for (var animationIndex = 0; animationIndex < parsedParticleSystem.animations.length; animationIndex++) {
|
|
|
|
+ var parsedAnimation = parsedParticleSystem.animations[animationIndex];
|
|
|
|
+ particleSystem.animations.push(BABYLON.Animation.Parse(parsedAnimation));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Particle system
|
|
|
|
+ particleSystem.activeParticleCount = parsedParticleSystem.activeParticleCount;
|
|
|
|
+ particleSystem.minSize = parsedParticleSystem.minSize;
|
|
|
|
+ particleSystem.maxSize = parsedParticleSystem.maxSize;
|
|
|
|
+ particleSystem.minLifeTime = parsedParticleSystem.minLifeTime;
|
|
|
|
+ particleSystem.maxLifeTime = parsedParticleSystem.maxLifeTime;
|
|
|
|
+ particleSystem.minEmitPower = parsedParticleSystem.minEmitPower;
|
|
|
|
+ particleSystem.maxEmitPower = parsedParticleSystem.maxEmitPower;
|
|
|
|
+ particleSystem.emitRate = parsedParticleSystem.emitRate;
|
|
|
|
+ particleSystem.gravity = BABYLON.Vector3.FromArray(parsedParticleSystem.gravity);
|
|
|
|
+ particleSystem.color1 = BABYLON.Color4.FromArray(parsedParticleSystem.color1);
|
|
|
|
+ particleSystem.color2 = BABYLON.Color4.FromArray(parsedParticleSystem.color2);
|
|
|
|
+ particleSystem.colorDead = BABYLON.Color4.FromArray(parsedParticleSystem.colorDead);
|
|
|
|
+ particleSystem.updateSpeed = parsedParticleSystem.updateSpeed;
|
|
|
|
+ particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration;
|
|
|
|
+ particleSystem.blendMode = parsedParticleSystem.blendMode;
|
|
|
|
+ // Emitter
|
|
|
|
+ if (parsedParticleSystem.particleEmitterType) {
|
|
|
|
+ var emitterType = void 0;
|
|
|
|
+ switch (parsedParticleSystem.particleEmitterType.type) {
|
|
|
|
+ case "SphereEmitter":
|
|
|
|
+ emitterType = new BABYLON.SphereParticleEmitter();
|
|
|
|
+ break;
|
|
|
|
+ case "SphereDirectedParticleEmitter":
|
|
|
|
+ emitterType = new BABYLON.SphereDirectedParticleEmitter();
|
|
|
|
+ break;
|
|
|
|
+ case "ConeEmitter":
|
|
|
|
+ emitterType = new BABYLON.ConeParticleEmitter();
|
|
|
|
+ break;
|
|
|
|
+ case "BoxEmitter":
|
|
|
|
+ default:
|
|
|
|
+ emitterType = new BABYLON.BoxParticleEmitter();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ emitterType.parse(parsedParticleSystem.particleEmitterType);
|
|
|
|
+ particleSystem.particleEmitterType = emitterType;
|
|
|
|
+ }
|
|
|
|
+ return particleSystem;
|
|
|
|
+ };
|
|
return GPUParticleSystem;
|
|
return GPUParticleSystem;
|
|
}());
|
|
}());
|
|
BABYLON.GPUParticleSystem = GPUParticleSystem;
|
|
BABYLON.GPUParticleSystem = GPUParticleSystem;
|
|
@@ -61392,8 +61615,14 @@ var BABYLON;
|
|
if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {
|
|
if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {
|
|
for (index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {
|
|
for (index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {
|
|
var parsedParticleSystem = parsedData.particleSystems[index];
|
|
var parsedParticleSystem = parsedData.particleSystems[index];
|
|
- var ps = BABYLON.ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
|
|
|
|
- container.particleSystems.push(ps);
|
|
|
|
|
|
+ if (parsedParticleSystem.activeParticleCount) {
|
|
|
|
+ var ps = BABYLON.GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
|
|
|
|
+ container.particleSystems.push(ps);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ var ps = BABYLON.ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
|
|
|
|
+ container.particleSystems.push(ps);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// Lens flares
|
|
// Lens flares
|