Explorar el Código

Nightly build

David Catuhe hace 9 años
padre
commit
8fa003b4bc

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 10 - 10
dist/preview release/babylon.core.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 855 - 848
dist/preview release/babylon.d.ts


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 18 - 18
dist/preview release/babylon.js


+ 82 - 112
dist/preview release/babylon.max.js

@@ -12889,6 +12889,19 @@ var BABYLON;
             return null;
         };
         /**
+         * get a particle system by id
+         * @param id {number} the particle system id
+         * @return {BABYLON.ParticleSystem|null} the corresponding system or null if none found.
+         */
+        Scene.prototype.getParticleSystemByID = function (id) {
+            for (var index = 0; index < this.particleSystems.length; index++) {
+                if (this.particleSystems[index].id === id) {
+                    return this.particleSystems[index];
+                }
+            }
+            return null;
+        };
+        /**
          * get a geometry using its ID
          * @param {string} the geometry's id
          * @return {BABYLON.Geometry|null} the geometry or null if none found.
@@ -21220,7 +21233,14 @@ var BABYLON;
         };
         ParticleSystem.prototype.serialize = function () {
             var serializationObject = {};
-            serializationObject.emitterId = this.emitter.id;
+            serializationObject.name = this.name;
+            if (this.emitter.position) {
+                serializationObject.emitterId = this.emitter.id;
+            }
+            else {
+                serializationObject.emitter = this.emitter.asArray();
+                ;
+            }
             serializationObject.capacity = this.getCapacity();
             if (this.particleTexture) {
                 serializationObject.textureName = this.particleTexture.name;
@@ -21229,6 +21249,8 @@ var BABYLON;
             serializationObject.maxAngularSpeed = this.maxAngularSpeed;
             serializationObject.minSize = this.minSize;
             serializationObject.maxSize = this.maxSize;
+            serializationObject.minEmitPower = this.minEmitPower;
+            serializationObject.maxEmitPower = this.maxEmitPower;
             serializationObject.minLifeTime = this.minLifeTime;
             serializationObject.maxLifeTime = this.maxLifeTime;
             serializationObject.emitRate = this.emitRate;
@@ -21247,19 +21269,26 @@ var BABYLON;
             return serializationObject;
         };
         ParticleSystem.Parse = function (parsedParticleSystem, scene, rootUrl) {
-            var emitter = scene.getLastMeshByID(parsedParticleSystem.emitterId);
-            var particleSystem = new ParticleSystem("particles#" + emitter.name, parsedParticleSystem.capacity, scene);
+            var name = parsedParticleSystem.name;
+            var particleSystem = new ParticleSystem(name, parsedParticleSystem.capacity, scene);
             if (parsedParticleSystem.textureName) {
                 particleSystem.particleTexture = new BABYLON.Texture(rootUrl + parsedParticleSystem.textureName, scene);
                 particleSystem.particleTexture.name = parsedParticleSystem.textureName;
             }
+            if (parsedParticleSystem.emitterId) {
+                particleSystem.emitter = scene.getLastMeshByID(parsedParticleSystem.emitterId);
+            }
+            else {
+                particleSystem.emitter = BABYLON.Vector3.FromArray(parsedParticleSystem.emitter);
+            }
             particleSystem.minAngularSpeed = parsedParticleSystem.minAngularSpeed;
             particleSystem.maxAngularSpeed = parsedParticleSystem.maxAngularSpeed;
             particleSystem.minSize = parsedParticleSystem.minSize;
             particleSystem.maxSize = parsedParticleSystem.maxSize;
             particleSystem.minLifeTime = parsedParticleSystem.minLifeTime;
             particleSystem.maxLifeTime = parsedParticleSystem.maxLifeTime;
-            particleSystem.emitter = emitter;
+            particleSystem.minEmitPower = parsedParticleSystem.minEmitPower;
+            particleSystem.maxEmitPower = parsedParticleSystem.maxEmitPower;
             particleSystem.emitRate = parsedParticleSystem.emitRate;
             particleSystem.minEmitBox = BABYLON.Vector3.FromArray(parsedParticleSystem.minEmitBox);
             particleSystem.maxEmitBox = BABYLON.Vector3.FromArray(parsedParticleSystem.maxEmitBox);
@@ -21270,7 +21299,7 @@ var BABYLON;
             particleSystem.color2 = BABYLON.Color4.FromArray(parsedParticleSystem.color2);
             particleSystem.colorDead = BABYLON.Color4.FromArray(parsedParticleSystem.colorDead);
             particleSystem.updateSpeed = parsedParticleSystem.updateSpeed;
-            particleSystem.targetStopDuration = parsedParticleSystem.targetStopFrame;
+            particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration;
             particleSystem.textureMask = BABYLON.Color4.FromArray(parsedParticleSystem.textureMask);
             particleSystem.blendMode = parsedParticleSystem.blendMode;
             particleSystem.start();
@@ -22945,120 +22974,54 @@ var BABYLON;
             }
         };
         VertexData.prototype.merge = function (other) {
-            var index;
             if (other.indices) {
                 if (!this.indices) {
                     this.indices = [];
                 }
                 var offset = this.positions ? this.positions.length / 3 : 0;
-                for (index = 0; index < other.indices.length; index++) {
+                for (var index = 0; index < other.indices.length; index++) {
                     //TODO check type - if Int32Array!
                     this.indices.push(other.indices[index] + offset);
                 }
             }
-            if (other.positions) {
-                if (!this.positions) {
-                    this.positions = [];
-                }
-                for (index = 0; index < other.positions.length; index++) {
-                    this.positions.push(other.positions[index]);
-                }
-            }
-            if (other.normals) {
-                if (!this.normals) {
-                    this.normals = [];
-                }
-                for (index = 0; index < other.normals.length; index++) {
-                    this.normals.push(other.normals[index]);
-                }
-            }
-            if (other.uvs) {
-                if (!this.uvs) {
-                    this.uvs = [];
-                }
-                for (index = 0; index < other.uvs.length; index++) {
-                    this.uvs.push(other.uvs[index]);
-                }
-            }
-            if (other.uvs2) {
-                if (!this.uvs2) {
-                    this.uvs2 = [];
-                }
-                for (index = 0; index < other.uvs2.length; index++) {
-                    this.uvs2.push(other.uvs2[index]);
-                }
-            }
-            if (other.uvs3) {
-                if (!this.uvs3) {
-                    this.uvs3 = [];
-                }
-                for (index = 0; index < other.uvs3.length; index++) {
-                    this.uvs3.push(other.uvs3[index]);
-                }
-            }
-            if (other.uvs4) {
-                if (!this.uvs4) {
-                    this.uvs4 = [];
-                }
-                for (index = 0; index < other.uvs4.length; index++) {
-                    this.uvs4.push(other.uvs4[index]);
-                }
-            }
-            if (other.uvs5) {
-                if (!this.uvs5) {
-                    this.uvs5 = [];
-                }
-                for (index = 0; index < other.uvs5.length; index++) {
-                    this.uvs5.push(other.uvs5[index]);
-                }
-            }
-            if (other.uvs6) {
-                if (!this.uvs6) {
-                    this.uvs6 = [];
-                }
-                for (index = 0; index < other.uvs6.length; index++) {
-                    this.uvs6.push(other.uvs6[index]);
-                }
-            }
-            if (other.matricesIndices) {
-                if (!this.matricesIndices) {
-                    this.matricesIndices = [];
-                }
-                for (index = 0; index < other.matricesIndices.length; index++) {
-                    this.matricesIndices.push(other.matricesIndices[index]);
-                }
-            }
-            if (other.matricesWeights) {
-                if (!this.matricesWeights) {
-                    this.matricesWeights = [];
-                }
-                for (index = 0; index < other.matricesWeights.length; index++) {
-                    this.matricesWeights.push(other.matricesWeights[index]);
-                }
-            }
-            if (other.matricesIndicesExtra) {
-                if (!this.matricesIndicesExtra) {
-                    this.matricesIndicesExtra = [];
-                }
-                for (index = 0; index < other.matricesIndicesExtra.length; index++) {
-                    this.matricesIndicesExtra.push(other.matricesIndicesExtra[index]);
-                }
-            }
-            if (other.matricesWeightsExtra) {
-                if (!this.matricesWeightsExtra) {
-                    this.matricesWeightsExtra = [];
-                }
-                for (index = 0; index < other.matricesWeightsExtra.length; index++) {
-                    this.matricesWeightsExtra.push(other.matricesWeightsExtra[index]);
-                }
+            this.positions = this._mergeElement(this.positions, other.positions);
+            this.normals = this._mergeElement(this.normals, other.normals);
+            this.uvs = this._mergeElement(this.uvs, other.uvs);
+            this.uvs2 = this._mergeElement(this.uvs2, other.uvs2);
+            this.uvs3 = this._mergeElement(this.uvs3, other.uvs3);
+            this.uvs4 = this._mergeElement(this.uvs4, other.uvs4);
+            this.uvs5 = this._mergeElement(this.uvs5, other.uvs5);
+            this.uvs6 = this._mergeElement(this.uvs6, other.uvs6);
+            this.colors = this._mergeElement(this.colors, other.colors);
+            this.matricesIndices = this._mergeElement(this.matricesIndices, other.matricesIndices);
+            this.matricesWeights = this._mergeElement(this.matricesWeights, other.matricesWeights);
+            this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, other.matricesIndicesExtra);
+            this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, other.matricesWeightsExtra);
+        };
+        VertexData.prototype._mergeElement = function (source, other) {
+            if (!other)
+                return source;
+            if (!source)
+                return other;
+            var len = other.length + source.length;
+            var isSrcTypedArray = source instanceof Float32Array;
+            var isOthTypedArray = other instanceof Float32Array;
+            // use non-loop method when the source is Float32Array
+            if (isSrcTypedArray) {
+                var ret32 = new Float32Array(len);
+                ret32.set(source);
+                ret32.set(other, source.length);
+                return ret32;
+            }
+            else if (!isOthTypedArray) {
+                return source.concat(other);
             }
-            if (other.colors) {
-                if (!this.colors) {
-                    this.colors = [];
-                }
-                for (index = 0; index < other.colors.length; index++) {
-                    this.colors.push(other.colors[index]);
+            else {
+                var ret = source.slice(0); // copy source to a separate array
+                for (var i = 0, len = other.length; i < len; i++) {
+                    ret.push(other[i]);
                 }
+                return ret;
             }
         };
         VertexData.prototype.serialize = function () {
@@ -23097,6 +23060,13 @@ var BABYLON;
             if (this.matricesWeights) {
                 serializationObject.matricesWeights = this.matricesWeights;
             }
+            if (this.matricesIndicesExtra) {
+                serializationObject.matricesIndicesExtra = this.matricesIndicesExtra;
+                serializationObject.matricesIndicesExtra._isExpanded = true;
+            }
+            if (this.matricesWeightsExtra) {
+                serializationObject.matricesWeightsExtra = this.matricesWeightsExtra;
+            }
             serializationObject.indices = this.indices;
             return serializationObject;
         };
@@ -23255,7 +23225,7 @@ var BABYLON;
                     vTotalDistance[i] = dist;
                 }
             }
-            // uvs            
+            // uvs
             var u;
             var v;
             for (p = 0; p < pathArray.length; p++) {
@@ -23271,7 +23241,7 @@ var BABYLON;
             var l1 = lg[p] - 1; // path1 length
             var l2 = lg[p + 1] - 1; // path2 length
             var min = (l1 < l2) ? l1 : l2; // current path stop index
-            var shft = idx[1] - idx[0]; // shift 
+            var shft = idx[1] - idx[0]; // shift
             var path1nb = closeArray ? lg.length : lg.length - 1; // number of path1 to iterate	on
             while (pi <= min && p < path1nb) {
                 // draw two triangles between path1 (p1) and path2 (p2) : (p1.pi, p2.pi, p1.pi+1) and (p2.pi+1, p1.pi+1, p2.pi) clockwise
@@ -23469,7 +23439,7 @@ var BABYLON;
             vertexData.uvs = uvs;
             return vertexData;
         };
-        // Cylinder and cone 
+        // Cylinder and cone
         VertexData.CreateCylinder = function (options) {
             var height = options.height || 2;
             var diameterTop = (options.diameterTop === 0) ? 0 : options.diameterTop || options.diameter || 1;
@@ -24557,7 +24527,7 @@ var BABYLON;
                     }
                     break;
                 case BABYLON.Mesh.DOUBLESIDE:
-                    // positions 
+                    // positions
                     var lp = positions.length;
                     var l = lp / 3;
                     for (var p = 0; p < lp; p++) {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 17 - 17
dist/preview release/babylon.noworker.js


+ 48 - 107
src/Mesh/babylon.mesh.vertexData.js

@@ -171,120 +171,54 @@ var BABYLON;
             }
         };
         VertexData.prototype.merge = function (other) {
-            var index;
             if (other.indices) {
                 if (!this.indices) {
                     this.indices = [];
                 }
                 var offset = this.positions ? this.positions.length / 3 : 0;
-                for (index = 0; index < other.indices.length; index++) {
+                for (var index = 0; index < other.indices.length; index++) {
                     //TODO check type - if Int32Array!
                     this.indices.push(other.indices[index] + offset);
                 }
             }
-            if (other.positions) {
-                if (!this.positions) {
-                    this.positions = [];
-                }
-                for (index = 0; index < other.positions.length; index++) {
-                    this.positions.push(other.positions[index]);
-                }
-            }
-            if (other.normals) {
-                if (!this.normals) {
-                    this.normals = [];
-                }
-                for (index = 0; index < other.normals.length; index++) {
-                    this.normals.push(other.normals[index]);
-                }
-            }
-            if (other.uvs) {
-                if (!this.uvs) {
-                    this.uvs = [];
-                }
-                for (index = 0; index < other.uvs.length; index++) {
-                    this.uvs.push(other.uvs[index]);
-                }
-            }
-            if (other.uvs2) {
-                if (!this.uvs2) {
-                    this.uvs2 = [];
-                }
-                for (index = 0; index < other.uvs2.length; index++) {
-                    this.uvs2.push(other.uvs2[index]);
-                }
-            }
-            if (other.uvs3) {
-                if (!this.uvs3) {
-                    this.uvs3 = [];
-                }
-                for (index = 0; index < other.uvs3.length; index++) {
-                    this.uvs3.push(other.uvs3[index]);
-                }
-            }
-            if (other.uvs4) {
-                if (!this.uvs4) {
-                    this.uvs4 = [];
-                }
-                for (index = 0; index < other.uvs4.length; index++) {
-                    this.uvs4.push(other.uvs4[index]);
-                }
-            }
-            if (other.uvs5) {
-                if (!this.uvs5) {
-                    this.uvs5 = [];
-                }
-                for (index = 0; index < other.uvs5.length; index++) {
-                    this.uvs5.push(other.uvs5[index]);
-                }
-            }
-            if (other.uvs6) {
-                if (!this.uvs6) {
-                    this.uvs6 = [];
-                }
-                for (index = 0; index < other.uvs6.length; index++) {
-                    this.uvs6.push(other.uvs6[index]);
-                }
-            }
-            if (other.matricesIndices) {
-                if (!this.matricesIndices) {
-                    this.matricesIndices = [];
-                }
-                for (index = 0; index < other.matricesIndices.length; index++) {
-                    this.matricesIndices.push(other.matricesIndices[index]);
-                }
-            }
-            if (other.matricesWeights) {
-                if (!this.matricesWeights) {
-                    this.matricesWeights = [];
-                }
-                for (index = 0; index < other.matricesWeights.length; index++) {
-                    this.matricesWeights.push(other.matricesWeights[index]);
-                }
-            }
-            if (other.matricesIndicesExtra) {
-                if (!this.matricesIndicesExtra) {
-                    this.matricesIndicesExtra = [];
-                }
-                for (index = 0; index < other.matricesIndicesExtra.length; index++) {
-                    this.matricesIndicesExtra.push(other.matricesIndicesExtra[index]);
-                }
-            }
-            if (other.matricesWeightsExtra) {
-                if (!this.matricesWeightsExtra) {
-                    this.matricesWeightsExtra = [];
-                }
-                for (index = 0; index < other.matricesWeightsExtra.length; index++) {
-                    this.matricesWeightsExtra.push(other.matricesWeightsExtra[index]);
-                }
+            this.positions = this._mergeElement(this.positions, other.positions);
+            this.normals = this._mergeElement(this.normals, other.normals);
+            this.uvs = this._mergeElement(this.uvs, other.uvs);
+            this.uvs2 = this._mergeElement(this.uvs2, other.uvs2);
+            this.uvs3 = this._mergeElement(this.uvs3, other.uvs3);
+            this.uvs4 = this._mergeElement(this.uvs4, other.uvs4);
+            this.uvs5 = this._mergeElement(this.uvs5, other.uvs5);
+            this.uvs6 = this._mergeElement(this.uvs6, other.uvs6);
+            this.colors = this._mergeElement(this.colors, other.colors);
+            this.matricesIndices = this._mergeElement(this.matricesIndices, other.matricesIndices);
+            this.matricesWeights = this._mergeElement(this.matricesWeights, other.matricesWeights);
+            this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, other.matricesIndicesExtra);
+            this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, other.matricesWeightsExtra);
+        };
+        VertexData.prototype._mergeElement = function (source, other) {
+            if (!other)
+                return source;
+            if (!source)
+                return other;
+            var len = other.length + source.length;
+            var isSrcTypedArray = source instanceof Float32Array;
+            var isOthTypedArray = other instanceof Float32Array;
+            // use non-loop method when the source is Float32Array
+            if (isSrcTypedArray) {
+                var ret32 = new Float32Array(len);
+                ret32.set(source);
+                ret32.set(other, source.length);
+                return ret32;
+            }
+            else if (!isOthTypedArray) {
+                return source.concat(other);
             }
-            if (other.colors) {
-                if (!this.colors) {
-                    this.colors = [];
-                }
-                for (index = 0; index < other.colors.length; index++) {
-                    this.colors.push(other.colors[index]);
+            else {
+                var ret = source.slice(0); // copy source to a separate array
+                for (var i = 0, len = other.length; i < len; i++) {
+                    ret.push(other[i]);
                 }
+                return ret;
             }
         };
         VertexData.prototype.serialize = function () {
@@ -323,6 +257,13 @@ var BABYLON;
             if (this.matricesWeights) {
                 serializationObject.matricesWeights = this.matricesWeights;
             }
+            if (this.matricesIndicesExtra) {
+                serializationObject.matricesIndicesExtra = this.matricesIndicesExtra;
+                serializationObject.matricesIndicesExtra._isExpanded = true;
+            }
+            if (this.matricesWeightsExtra) {
+                serializationObject.matricesWeightsExtra = this.matricesWeightsExtra;
+            }
             serializationObject.indices = this.indices;
             return serializationObject;
         };
@@ -481,7 +422,7 @@ var BABYLON;
                     vTotalDistance[i] = dist;
                 }
             }
-            // uvs            
+            // uvs
             var u;
             var v;
             for (p = 0; p < pathArray.length; p++) {
@@ -497,7 +438,7 @@ var BABYLON;
             var l1 = lg[p] - 1; // path1 length
             var l2 = lg[p + 1] - 1; // path2 length
             var min = (l1 < l2) ? l1 : l2; // current path stop index
-            var shft = idx[1] - idx[0]; // shift 
+            var shft = idx[1] - idx[0]; // shift
             var path1nb = closeArray ? lg.length : lg.length - 1; // number of path1 to iterate	on
             while (pi <= min && p < path1nb) {
                 // draw two triangles between path1 (p1) and path2 (p2) : (p1.pi, p2.pi, p1.pi+1) and (p2.pi+1, p1.pi+1, p2.pi) clockwise
@@ -695,7 +636,7 @@ var BABYLON;
             vertexData.uvs = uvs;
             return vertexData;
         };
-        // Cylinder and cone 
+        // Cylinder and cone
         VertexData.CreateCylinder = function (options) {
             var height = options.height || 2;
             var diameterTop = (options.diameterTop === 0) ? 0 : options.diameterTop || options.diameter || 1;
@@ -1783,7 +1724,7 @@ var BABYLON;
                     }
                     break;
                 case BABYLON.Mesh.DOUBLESIDE:
-                    // positions 
+                    // positions
                     var lp = positions.length;
                     var l = lp / 3;
                     for (var p = 0; p < lp; p++) {

+ 28 - 28
src/Mesh/babylon.mesh.vertexData.ts

@@ -1,7 +1,7 @@
 module BABYLON {
     export interface IGetSetVerticesData {
         isVerticesDataPresent(kind: string): boolean;
-        getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Int32Array |Float32Array;
+        getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Int32Array | Float32Array;
         getIndices(copyWhenShared?: boolean): number[] | Int32Array;
         setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean): void;
         updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean, makeItUnique?: boolean): void;
@@ -244,43 +244,43 @@
             }
 
             this.positions = this._mergeElement(this.positions, other.positions);
-            this.normals   = this._mergeElement(this.normals  , other.normals  );
-            this.uvs       = this._mergeElement(this.uvs      , other.uvs      );
-            this.uvs2      = this._mergeElement(this.uvs2     , other.uvs2     );
-            this.uvs3      = this._mergeElement(this.uvs3     , other.uvs3     );
-            this.uvs4      = this._mergeElement(this.uvs4     , other.uvs4     );
-            this.uvs5      = this._mergeElement(this.uvs5     , other.uvs5     );
-            this.uvs6      = this._mergeElement(this.uvs6     , other.uvs6     );
-            this.colors    = this._mergeElement(this.colors   , other.colors   );
-            this.matricesIndices      = this._mergeElement(this.matricesIndices     , other.matricesIndices     );
-            this.matricesWeights      = this._mergeElement(this.matricesWeights     , other.matricesWeights     );
+            this.normals = this._mergeElement(this.normals, other.normals);
+            this.uvs = this._mergeElement(this.uvs, other.uvs);
+            this.uvs2 = this._mergeElement(this.uvs2, other.uvs2);
+            this.uvs3 = this._mergeElement(this.uvs3, other.uvs3);
+            this.uvs4 = this._mergeElement(this.uvs4, other.uvs4);
+            this.uvs5 = this._mergeElement(this.uvs5, other.uvs5);
+            this.uvs6 = this._mergeElement(this.uvs6, other.uvs6);
+            this.colors = this._mergeElement(this.colors, other.colors);
+            this.matricesIndices = this._mergeElement(this.matricesIndices, other.matricesIndices);
+            this.matricesWeights = this._mergeElement(this.matricesWeights, other.matricesWeights);
             this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, other.matricesIndicesExtra);
             this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, other.matricesWeightsExtra);
         }
 
-        private _mergeElement(source : number[] | Float32Array, other : number[] | Float32Array) : number[] | Float32Array{
-            if (!other ) return source;
+        private _mergeElement(source: number[] | Float32Array, other: number[] | Float32Array): number[] | Float32Array {
+            if (!other) return source;
             if (!source) return other;
 
             var len = other.length + source.length;
             var isSrcTypedArray = source instanceof Float32Array;
-            var isOthTypedArray = other  instanceof Float32Array;
+            var isOthTypedArray = other instanceof Float32Array;
 
             // use non-loop method when the source is Float32Array
-            if(isSrcTypedArray) {
-               var ret32 = new Float32Array(len);
-               ret32.set(source);
-               ret32.set(other, source.length);
-               return ret32;
+            if (isSrcTypedArray) {
+                var ret32 = new Float32Array(len);
+                ret32.set(source);
+                ret32.set(other, source.length);
+                return ret32;
 
-            // source is number[], when other is also use concat
-            }else if (!isOthTypedArray) {
-                return (<number[]> source).concat(<number[]> other);
+                // source is number[], when other is also use concat
+            } else if (!isOthTypedArray) {
+                return (<number[]>source).concat(<number[]>other);
 
-            // source is a number[], but other is a Float32Array, loop required
+                // source is a number[], but other is a Float32Array, loop required
             } else {
-                var ret = (<number[]> source).slice(0); // copy source to a separate array
-                for (var i = 0, len = other.length; i < len; i++){
+                var ret = (<number[]>source).slice(0); // copy source to a separate array
+                for (var i = 0, len = other.length; i < len; i++) {
                     ret.push(other[i]);
                 }
                 return ret;
@@ -1493,7 +1493,7 @@
             // vertex for uv have aliased position, not for UV
             var vertices_unalias_id = [
                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
-            // vertex alias
+                // vertex alias
                 0,  // 12: 0 + 12
                 2,  // 13: 2 + 11
                 3,  // 14: 3 + 11
@@ -1514,7 +1514,7 @@
                 5, 1, 3, 1, 6, 4, 0, 0,  // v0-3
                 5, 3, 4, 2, 2, 2, 4, 0,  // v4-7
                 2, 0, 1, 1, 6, 0, 6, 2,  // v8-11
-            // vertex alias (for same vertex on different faces)
+                // vertex alias (for same vertex on different faces)
                 0, 4, // 12: 0 + 12
                 3, 3, // 13: 2 + 11
                 4, 4, // 14: 3 + 11
@@ -2164,4 +2164,4 @@
             geometry.setAllVerticesData(vertexData, parsedVertexData.updatable);
         }
     }
-}
+}

+ 11 - 4
src/Particles/babylon.particleSystem.js

@@ -334,8 +334,10 @@ var BABYLON;
             serializationObject.name = this.name;
             if (this.emitter.position) {
                 serializationObject.emitterId = this.emitter.id;
-            } else {
+            }
+            else {
                 serializationObject.emitter = this.emitter.asArray();
+                ;
             }
             serializationObject.capacity = this.getCapacity();
             if (this.particleTexture) {
@@ -345,6 +347,8 @@ var BABYLON;
             serializationObject.maxAngularSpeed = this.maxAngularSpeed;
             serializationObject.minSize = this.minSize;
             serializationObject.maxSize = this.maxSize;
+            serializationObject.minEmitPower = this.minEmitPower;
+            serializationObject.maxEmitPower = this.maxEmitPower;
             serializationObject.minLifeTime = this.minLifeTime;
             serializationObject.maxLifeTime = this.maxLifeTime;
             serializationObject.emitRate = this.emitRate;
@@ -371,8 +375,9 @@ var BABYLON;
             }
             if (parsedParticleSystem.emitterId) {
                 particleSystem.emitter = scene.getLastMeshByID(parsedParticleSystem.emitterId);
-            } else {
-                particleSystem.emitter = Vector3.FromArray(parsedParticleSystem.emitter);
+            }
+            else {
+                particleSystem.emitter = BABYLON.Vector3.FromArray(parsedParticleSystem.emitter);
             }
             particleSystem.minAngularSpeed = parsedParticleSystem.minAngularSpeed;
             particleSystem.maxAngularSpeed = parsedParticleSystem.maxAngularSpeed;
@@ -380,6 +385,8 @@ var BABYLON;
             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.minEmitBox = BABYLON.Vector3.FromArray(parsedParticleSystem.minEmitBox);
             particleSystem.maxEmitBox = BABYLON.Vector3.FromArray(parsedParticleSystem.maxEmitBox);
@@ -390,7 +397,7 @@ var BABYLON;
             particleSystem.color2 = BABYLON.Color4.FromArray(parsedParticleSystem.color2);
             particleSystem.colorDead = BABYLON.Color4.FromArray(parsedParticleSystem.colorDead);
             particleSystem.updateSpeed = parsedParticleSystem.updateSpeed;
-            particleSystem.targetStopDuration = parsedParticleSystem.targetStopFrame;
+            particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration;
             particleSystem.textureMask = BABYLON.Color4.FromArray(parsedParticleSystem.textureMask);
             particleSystem.blendMode = parsedParticleSystem.blendMode;
             particleSystem.start();

+ 1 - 0
src/Particles/babylon.particleSystem.ts

@@ -525,3 +525,4 @@
         }
     }
 }  
+

+ 1 - 2
src/babylon.scene.ts

@@ -2503,5 +2503,4 @@
             return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach));
         }
     }
-} 
-
+}