Selaa lähdekoodia

Merge pull request #781 from jbousquie/fix.SPS

removed useless particles double-link
Raanan Weber 9 vuotta sitten
vanhempi
commit
cdeb65a052

+ 0 - 2
src/Particles/babylon.solidParticle.ts

@@ -13,8 +13,6 @@ module BABYLON {
         public _pos: number;                    // index of this particle in the global "positions" array
         public _model: ModelShape;              // model shape reference
         public shapeId: number;                 // model shape id
-        public previous: SolidParticle;         // pointer to the previous particle in the global particles array
-        public next: SolidParticle;             // pointer to the next particle in the global particles array
         public idxInShape: number;              // index of the particle in its shape id
 
         constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number) {

+ 2 - 8
src/Particles/babylon.solidParticleSystem.ts

@@ -204,15 +204,9 @@ module BABYLON {
             return shapeUV;
         }
 
-        // adds a new particle object in the particles array and double links the particle (next/previous)
+        // adds a new particle object in the particles array
         private _addParticle(p: number, idxpos: number, model: ModelShape, shapeId: number, idxInShape: number): void {
-            this._particle = new SolidParticle(p, idxpos, model, shapeId, idxInShape);
-            this.particles.push(this._particle);
-            this._particle.previous = this._previousParticle;
-            if (this._previousParticle) {
-                this._previousParticle.next = this._particle;
-            }
-            this._previousParticle = this._particle;
+            this.particles.push(new SolidParticle(p, idxpos, model, shapeId, idxInShape));
         }
 
         // add solid particles from a shape model in the particles array