David Catuhe 7 years ago
parent
commit
c41e092f7d

File diff suppressed because it is too large
+ 3854 - 3833
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 25 - 25
dist/preview release/babylon.js


+ 79 - 7
dist/preview release/babylon.max.js

@@ -56594,9 +56594,11 @@ var BABYLON;
                         emitterType = new BABYLON.SphereDirectedParticleEmitter();
                         break;
                     case "ConeEmitter":
+                    case "ConeParticleEmitter":
                         emitterType = new BABYLON.ConeParticleEmitter();
                         break;
                     case "BoxEmitter":
+                    case "BoxParticleEmitter":
                     default:
                         emitterType = new BABYLON.BoxParticleEmitter();
                         break;
@@ -56749,11 +56751,11 @@ var BABYLON;
             return "#define BOXEMITTER";
         };
         /**
-         * Returns the string "BoxEmitter"
+         * Returns the string "BoxParticleEmitter"
          * @returns a string containing the class name
          */
         BoxParticleEmitter.prototype.getClassName = function () {
-            return "BoxEmitter";
+            return "BoxParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -56913,11 +56915,11 @@ var BABYLON;
             return "#define CONEEMITTER";
         };
         /**
-         * Returns the string "ConeEmitter"
+         * Returns the string "ConeParticleEmitter"
          * @returns a string containing the class name
          */
         ConeParticleEmitter.prototype.getClassName = function () {
-            return "ConeEmitter";
+            return "ConeParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -102576,6 +102578,12 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /** Internal class used to store shapes for emitters */
+    var ParticleSystemSetEmitterCreationOptions = /** @class */ (function () {
+        function ParticleSystemSetEmitterCreationOptions() {
+        }
+        return ParticleSystemSetEmitterCreationOptions;
+    }());
     /**
      * Represents a set of particle systems working together to create a specific effect
      */
@@ -102586,6 +102594,41 @@ var BABYLON;
              */
             this.systems = new Array();
         }
+        Object.defineProperty(ParticleSystemSet.prototype, "emitterMesh", {
+            /**
+             * Gets or set the emitter mesh used with this set
+             */
+            get: function () {
+                return this._emitterMesh;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        /**
+         * Creates a new emitter mesh as a sphere
+         * @param options defines the options used to create the sphere
+         * @param renderingGroupId defines the renderingGroupId to use for the sphere
+         * @param scene defines the hosting scene
+         */
+        ParticleSystemSet.prototype.setEmitterAsSphere = function (options, renderingGroupId, scene) {
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+            }
+            this._emitterCreationOptions = {
+                kind: "Sphere",
+                options: options,
+                renderingGroupId: renderingGroupId
+            };
+            this._emitterMesh = BABYLON.MeshBuilder.CreateSphere("emitterSphere", { diameter: options.diameter, segments: options.segments }, scene);
+            this._emitterMesh.renderingGroupId = renderingGroupId;
+            var material = new BABYLON.StandardMaterial("emitterSphereMaterial", scene);
+            material.emissiveColor = options.color;
+            this._emitterMesh.material = material;
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.emitter = this._emitterMesh;
+            }
+        };
         /**
          * Starts all particle systems of the set
          * @param emitter defines an optional mesh to use as emitter for the particle systems
@@ -102600,6 +102643,20 @@ var BABYLON;
             }
         };
         /**
+         * Release all associated resources
+         */
+        ParticleSystemSet.prototype.dispose = function () {
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.dispose();
+            }
+            this.systems = [];
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+                this._emitterMesh = null;
+            }
+        };
+        /**
          * Serialize the set into a JSON compatible object
          * @returns a JSON compatible representation of the set
          */
@@ -102610,6 +102667,9 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(system.serialize());
             }
+            if (this._emitterMesh) {
+                result.emitter = this._emitterCreationOptions;
+            }
             return result;
         };
         /**
@@ -102627,6 +102687,18 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(gpu ? BABYLON.GPUParticleSystem.Parse(system, scene, rootUrl) : BABYLON.ParticleSystem.Parse(system, scene, rootUrl));
             }
+            if (data.emitter) {
+                var options = data.emitter.options;
+                switch (data.emitter.kind) {
+                    case "Sphere":
+                        result.setEmitterAsSphere({
+                            diameter: options.diameter,
+                            segments: options.segments,
+                            color: BABYLON.Color3.FromArray(options.color)
+                        }, data.emitter.renderingGroupId, scene);
+                        break;
+                }
+            }
             return result;
         };
         return ParticleSystemSet;
@@ -102671,9 +102743,9 @@ var BABYLON;
             });
         };
         /**
-         * Static function used to export a particle system to a IParticleSystemData variable.
-         * Please note that texture file name is not exported and must be added manually
-         * @param system defines the particle system to export
+         * Static function used to export a particle system to a ParticleSystemSet variable.
+         * Please note that the emitter shape is not exported
+         * @param system defines the particle systems to export
          */
         ParticleHelper.ExportSet = function (systems) {
             var set = new BABYLON.ParticleSystemSet();

+ 79 - 7
dist/preview release/babylon.no-module.max.js

@@ -56561,9 +56561,11 @@ var BABYLON;
                         emitterType = new BABYLON.SphereDirectedParticleEmitter();
                         break;
                     case "ConeEmitter":
+                    case "ConeParticleEmitter":
                         emitterType = new BABYLON.ConeParticleEmitter();
                         break;
                     case "BoxEmitter":
+                    case "BoxParticleEmitter":
                     default:
                         emitterType = new BABYLON.BoxParticleEmitter();
                         break;
@@ -56716,11 +56718,11 @@ var BABYLON;
             return "#define BOXEMITTER";
         };
         /**
-         * Returns the string "BoxEmitter"
+         * Returns the string "BoxParticleEmitter"
          * @returns a string containing the class name
          */
         BoxParticleEmitter.prototype.getClassName = function () {
-            return "BoxEmitter";
+            return "BoxParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -56880,11 +56882,11 @@ var BABYLON;
             return "#define CONEEMITTER";
         };
         /**
-         * Returns the string "ConeEmitter"
+         * Returns the string "ConeParticleEmitter"
          * @returns a string containing the class name
          */
         ConeParticleEmitter.prototype.getClassName = function () {
-            return "ConeEmitter";
+            return "ConeParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -102543,6 +102545,12 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /** Internal class used to store shapes for emitters */
+    var ParticleSystemSetEmitterCreationOptions = /** @class */ (function () {
+        function ParticleSystemSetEmitterCreationOptions() {
+        }
+        return ParticleSystemSetEmitterCreationOptions;
+    }());
     /**
      * Represents a set of particle systems working together to create a specific effect
      */
@@ -102553,6 +102561,41 @@ var BABYLON;
              */
             this.systems = new Array();
         }
+        Object.defineProperty(ParticleSystemSet.prototype, "emitterMesh", {
+            /**
+             * Gets or set the emitter mesh used with this set
+             */
+            get: function () {
+                return this._emitterMesh;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        /**
+         * Creates a new emitter mesh as a sphere
+         * @param options defines the options used to create the sphere
+         * @param renderingGroupId defines the renderingGroupId to use for the sphere
+         * @param scene defines the hosting scene
+         */
+        ParticleSystemSet.prototype.setEmitterAsSphere = function (options, renderingGroupId, scene) {
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+            }
+            this._emitterCreationOptions = {
+                kind: "Sphere",
+                options: options,
+                renderingGroupId: renderingGroupId
+            };
+            this._emitterMesh = BABYLON.MeshBuilder.CreateSphere("emitterSphere", { diameter: options.diameter, segments: options.segments }, scene);
+            this._emitterMesh.renderingGroupId = renderingGroupId;
+            var material = new BABYLON.StandardMaterial("emitterSphereMaterial", scene);
+            material.emissiveColor = options.color;
+            this._emitterMesh.material = material;
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.emitter = this._emitterMesh;
+            }
+        };
         /**
          * Starts all particle systems of the set
          * @param emitter defines an optional mesh to use as emitter for the particle systems
@@ -102567,6 +102610,20 @@ var BABYLON;
             }
         };
         /**
+         * Release all associated resources
+         */
+        ParticleSystemSet.prototype.dispose = function () {
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.dispose();
+            }
+            this.systems = [];
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+                this._emitterMesh = null;
+            }
+        };
+        /**
          * Serialize the set into a JSON compatible object
          * @returns a JSON compatible representation of the set
          */
@@ -102577,6 +102634,9 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(system.serialize());
             }
+            if (this._emitterMesh) {
+                result.emitter = this._emitterCreationOptions;
+            }
             return result;
         };
         /**
@@ -102594,6 +102654,18 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(gpu ? BABYLON.GPUParticleSystem.Parse(system, scene, rootUrl) : BABYLON.ParticleSystem.Parse(system, scene, rootUrl));
             }
+            if (data.emitter) {
+                var options = data.emitter.options;
+                switch (data.emitter.kind) {
+                    case "Sphere":
+                        result.setEmitterAsSphere({
+                            diameter: options.diameter,
+                            segments: options.segments,
+                            color: BABYLON.Color3.FromArray(options.color)
+                        }, data.emitter.renderingGroupId, scene);
+                        break;
+                }
+            }
             return result;
         };
         return ParticleSystemSet;
@@ -102638,9 +102710,9 @@ var BABYLON;
             });
         };
         /**
-         * Static function used to export a particle system to a IParticleSystemData variable.
-         * Please note that texture file name is not exported and must be added manually
-         * @param system defines the particle system to export
+         * Static function used to export a particle system to a ParticleSystemSet variable.
+         * Please note that the emitter shape is not exported
+         * @param system defines the particle systems to export
          */
         ParticleHelper.ExportSet = function (systems) {
             var set = new BABYLON.ParticleSystemSet();

+ 79 - 7
dist/preview release/es6.js

@@ -56561,9 +56561,11 @@ var BABYLON;
                         emitterType = new BABYLON.SphereDirectedParticleEmitter();
                         break;
                     case "ConeEmitter":
+                    case "ConeParticleEmitter":
                         emitterType = new BABYLON.ConeParticleEmitter();
                         break;
                     case "BoxEmitter":
+                    case "BoxParticleEmitter":
                     default:
                         emitterType = new BABYLON.BoxParticleEmitter();
                         break;
@@ -56716,11 +56718,11 @@ var BABYLON;
             return "#define BOXEMITTER";
         };
         /**
-         * Returns the string "BoxEmitter"
+         * Returns the string "BoxParticleEmitter"
          * @returns a string containing the class name
          */
         BoxParticleEmitter.prototype.getClassName = function () {
-            return "BoxEmitter";
+            return "BoxParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -56880,11 +56882,11 @@ var BABYLON;
             return "#define CONEEMITTER";
         };
         /**
-         * Returns the string "ConeEmitter"
+         * Returns the string "ConeParticleEmitter"
          * @returns a string containing the class name
          */
         ConeParticleEmitter.prototype.getClassName = function () {
-            return "ConeEmitter";
+            return "ConeParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -102543,6 +102545,12 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /** Internal class used to store shapes for emitters */
+    var ParticleSystemSetEmitterCreationOptions = /** @class */ (function () {
+        function ParticleSystemSetEmitterCreationOptions() {
+        }
+        return ParticleSystemSetEmitterCreationOptions;
+    }());
     /**
      * Represents a set of particle systems working together to create a specific effect
      */
@@ -102553,6 +102561,41 @@ var BABYLON;
              */
             this.systems = new Array();
         }
+        Object.defineProperty(ParticleSystemSet.prototype, "emitterMesh", {
+            /**
+             * Gets or set the emitter mesh used with this set
+             */
+            get: function () {
+                return this._emitterMesh;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        /**
+         * Creates a new emitter mesh as a sphere
+         * @param options defines the options used to create the sphere
+         * @param renderingGroupId defines the renderingGroupId to use for the sphere
+         * @param scene defines the hosting scene
+         */
+        ParticleSystemSet.prototype.setEmitterAsSphere = function (options, renderingGroupId, scene) {
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+            }
+            this._emitterCreationOptions = {
+                kind: "Sphere",
+                options: options,
+                renderingGroupId: renderingGroupId
+            };
+            this._emitterMesh = BABYLON.MeshBuilder.CreateSphere("emitterSphere", { diameter: options.diameter, segments: options.segments }, scene);
+            this._emitterMesh.renderingGroupId = renderingGroupId;
+            var material = new BABYLON.StandardMaterial("emitterSphereMaterial", scene);
+            material.emissiveColor = options.color;
+            this._emitterMesh.material = material;
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.emitter = this._emitterMesh;
+            }
+        };
         /**
          * Starts all particle systems of the set
          * @param emitter defines an optional mesh to use as emitter for the particle systems
@@ -102567,6 +102610,20 @@ var BABYLON;
             }
         };
         /**
+         * Release all associated resources
+         */
+        ParticleSystemSet.prototype.dispose = function () {
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.dispose();
+            }
+            this.systems = [];
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+                this._emitterMesh = null;
+            }
+        };
+        /**
          * Serialize the set into a JSON compatible object
          * @returns a JSON compatible representation of the set
          */
@@ -102577,6 +102634,9 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(system.serialize());
             }
+            if (this._emitterMesh) {
+                result.emitter = this._emitterCreationOptions;
+            }
             return result;
         };
         /**
@@ -102594,6 +102654,18 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(gpu ? BABYLON.GPUParticleSystem.Parse(system, scene, rootUrl) : BABYLON.ParticleSystem.Parse(system, scene, rootUrl));
             }
+            if (data.emitter) {
+                var options = data.emitter.options;
+                switch (data.emitter.kind) {
+                    case "Sphere":
+                        result.setEmitterAsSphere({
+                            diameter: options.diameter,
+                            segments: options.segments,
+                            color: BABYLON.Color3.FromArray(options.color)
+                        }, data.emitter.renderingGroupId, scene);
+                        break;
+                }
+            }
             return result;
         };
         return ParticleSystemSet;
@@ -102638,9 +102710,9 @@ var BABYLON;
             });
         };
         /**
-         * Static function used to export a particle system to a IParticleSystemData variable.
-         * Please note that texture file name is not exported and must be added manually
-         * @param system defines the particle system to export
+         * Static function used to export a particle system to a ParticleSystemSet variable.
+         * Please note that the emitter shape is not exported
+         * @param system defines the particle systems to export
          */
         ParticleHelper.ExportSet = function (systems) {
             var set = new BABYLON.ParticleSystemSet();

File diff suppressed because it is too large
+ 25 - 25
dist/preview release/viewer/babylon.viewer.js


+ 79 - 7
dist/preview release/viewer/babylon.viewer.max.js

@@ -56682,9 +56682,11 @@ var BABYLON;
                         emitterType = new BABYLON.SphereDirectedParticleEmitter();
                         break;
                     case "ConeEmitter":
+                    case "ConeParticleEmitter":
                         emitterType = new BABYLON.ConeParticleEmitter();
                         break;
                     case "BoxEmitter":
+                    case "BoxParticleEmitter":
                     default:
                         emitterType = new BABYLON.BoxParticleEmitter();
                         break;
@@ -56837,11 +56839,11 @@ var BABYLON;
             return "#define BOXEMITTER";
         };
         /**
-         * Returns the string "BoxEmitter"
+         * Returns the string "BoxParticleEmitter"
          * @returns a string containing the class name
          */
         BoxParticleEmitter.prototype.getClassName = function () {
-            return "BoxEmitter";
+            return "BoxParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -57001,11 +57003,11 @@ var BABYLON;
             return "#define CONEEMITTER";
         };
         /**
-         * Returns the string "ConeEmitter"
+         * Returns the string "ConeParticleEmitter"
          * @returns a string containing the class name
          */
         ConeParticleEmitter.prototype.getClassName = function () {
-            return "ConeEmitter";
+            return "ConeParticleEmitter";
         };
         /**
          * Serializes the particle system to a JSON object.
@@ -102664,6 +102666,12 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /** Internal class used to store shapes for emitters */
+    var ParticleSystemSetEmitterCreationOptions = /** @class */ (function () {
+        function ParticleSystemSetEmitterCreationOptions() {
+        }
+        return ParticleSystemSetEmitterCreationOptions;
+    }());
     /**
      * Represents a set of particle systems working together to create a specific effect
      */
@@ -102674,6 +102682,41 @@ var BABYLON;
              */
             this.systems = new Array();
         }
+        Object.defineProperty(ParticleSystemSet.prototype, "emitterMesh", {
+            /**
+             * Gets or set the emitter mesh used with this set
+             */
+            get: function () {
+                return this._emitterMesh;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        /**
+         * Creates a new emitter mesh as a sphere
+         * @param options defines the options used to create the sphere
+         * @param renderingGroupId defines the renderingGroupId to use for the sphere
+         * @param scene defines the hosting scene
+         */
+        ParticleSystemSet.prototype.setEmitterAsSphere = function (options, renderingGroupId, scene) {
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+            }
+            this._emitterCreationOptions = {
+                kind: "Sphere",
+                options: options,
+                renderingGroupId: renderingGroupId
+            };
+            this._emitterMesh = BABYLON.MeshBuilder.CreateSphere("emitterSphere", { diameter: options.diameter, segments: options.segments }, scene);
+            this._emitterMesh.renderingGroupId = renderingGroupId;
+            var material = new BABYLON.StandardMaterial("emitterSphereMaterial", scene);
+            material.emissiveColor = options.color;
+            this._emitterMesh.material = material;
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.emitter = this._emitterMesh;
+            }
+        };
         /**
          * Starts all particle systems of the set
          * @param emitter defines an optional mesh to use as emitter for the particle systems
@@ -102688,6 +102731,20 @@ var BABYLON;
             }
         };
         /**
+         * Release all associated resources
+         */
+        ParticleSystemSet.prototype.dispose = function () {
+            for (var _i = 0, _a = this.systems; _i < _a.length; _i++) {
+                var system = _a[_i];
+                system.dispose();
+            }
+            this.systems = [];
+            if (this._emitterMesh) {
+                this._emitterMesh.dispose();
+                this._emitterMesh = null;
+            }
+        };
+        /**
          * Serialize the set into a JSON compatible object
          * @returns a JSON compatible representation of the set
          */
@@ -102698,6 +102755,9 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(system.serialize());
             }
+            if (this._emitterMesh) {
+                result.emitter = this._emitterCreationOptions;
+            }
             return result;
         };
         /**
@@ -102715,6 +102775,18 @@ var BABYLON;
                 var system = _a[_i];
                 result.systems.push(gpu ? BABYLON.GPUParticleSystem.Parse(system, scene, rootUrl) : BABYLON.ParticleSystem.Parse(system, scene, rootUrl));
             }
+            if (data.emitter) {
+                var options = data.emitter.options;
+                switch (data.emitter.kind) {
+                    case "Sphere":
+                        result.setEmitterAsSphere({
+                            diameter: options.diameter,
+                            segments: options.segments,
+                            color: BABYLON.Color3.FromArray(options.color)
+                        }, data.emitter.renderingGroupId, scene);
+                        break;
+                }
+            }
             return result;
         };
         return ParticleSystemSet;
@@ -102759,9 +102831,9 @@ var BABYLON;
             });
         };
         /**
-         * Static function used to export a particle system to a IParticleSystemData variable.
-         * Please note that texture file name is not exported and must be added manually
-         * @param system defines the particle system to export
+         * Static function used to export a particle system to a ParticleSystemSet variable.
+         * Please note that the emitter shape is not exported
+         * @param system defines the particle systems to export
          */
         ParticleHelper.ExportSet = function (systems) {
             var set = new BABYLON.ParticleSystemSet();