Преглед на файлове

Code comments for Mesh class

David Catuhe преди 7 години
родител
ревизия
f7b5393896

Файловите разлики са ограничени, защото са твърде много
+ 8726 - 8576
dist/preview release/babylon.d.ts


Файловите разлики са ограничени, защото са твърде много
+ 0 - 1321
dist/preview release/typedocValidationBaseline.json


Файловите разлики са ограничени, защото са твърде много
+ 572 - 452
src/Mesh/babylon.mesh.ts


+ 1 - 1
src/Mesh/babylon.meshBuilder.ts

@@ -970,7 +970,7 @@
                 var normal: Vector3;
                 var rotated: Vector3;
                 var rotationMatrix: Matrix = Tmp.Matrix[0];
-                var index = (cap === Mesh._NO_CAP || cap === Mesh.CAP_END) ? 0 : 2;
+                var index = (cap === Mesh.NO_CAP || cap === Mesh.CAP_END) ? 0 : 2;
                 for (var i = 0; i < path.length; i++) {
                     rad = radiusFunctionFinal(i, distances[i]); // current radius
                     circlePath = Array<Vector3>();              // current circle array

+ 6 - 5
src/Mesh/babylon.meshSimplificationSceneComponent.ts

@@ -32,11 +32,12 @@
     export interface Mesh {
         /**
          * Simplify the mesh according to the given array of settings.
-         * Function will return immediately and will simplify async. It returns the Mesh.  
-         * @param settings a collection of simplification settings.
-         * @param parallelProcessing should all levels calculate parallel or one after the other.
-         * @param type the type of simplification to run.
-         * @param successCallback optional success callback to be called after the simplification finished processing all settings.
+         * Function will return immediately and will simplify async
+         * @param settings a collection of simplification settings
+         * @param parallelProcessing should all levels calculate parallel or one after the other
+         * @param simplificationType the type of simplification to run
+         * @param successCallback optional success callback to be called after the simplification finished processing all settings
+         * @returns the current mesh
          */
         simplify(settings: Array<ISimplificationSettings>, parallelProcessing?: boolean, simplificationType?: SimplificationType, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): Mesh;
     }

+ 42 - 0
src/Particles/babylon.particleSystemComponent.ts

@@ -67,4 +67,46 @@
             effectCreationOption.concat(uniformsNames),
             samplers, defines, fallbacks, onCompiled, onError);
     }
+
+    export interface Mesh {
+        /**
+         * Returns an array populated with IParticleSystem objects whose the mesh is the emitter
+         * @returns an array of IParticleSystem
+         */
+        getEmittedParticleSystems(): IParticleSystem[];
+    
+        /**
+         * Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter
+         * @returns an array of IParticleSystem
+         */
+        getHierarchyEmittedParticleSystems(): IParticleSystem[];
+    }
+
+    Mesh.prototype.getEmittedParticleSystems = function(): IParticleSystem[] {
+        var results = new Array<IParticleSystem>();
+        for (var index = 0; index < this.getScene().particleSystems.length; index++) {
+            var particleSystem = this.getScene().particleSystems[index];
+            if (particleSystem.emitter === this) {
+                results.push(particleSystem);
+            }
+        }
+        return results;
+    }
+
+    Mesh.prototype.getHierarchyEmittedParticleSystems = function(): IParticleSystem[] {
+        var results = new Array<IParticleSystem>();
+        var descendants = this.getDescendants();
+        descendants.push(this);
+
+        for (var index = 0; index < this.getScene().particleSystems.length; index++) {
+            var particleSystem = this.getScene().particleSystems[index];
+            let emitter: any = particleSystem.emitter;
+
+            if (emitter.position && descendants.indexOf(emitter) !== -1) {
+                results.push(particleSystem);
+            }
+        }
+
+        return results;
+    }
 }