Selaa lähdekoodia

SPS : Added loop skipping for dead solid particles

jbousquie 8 vuotta sitten
vanhempi
commit
8a0f53dcff
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 9 0
      src/Particles/babylon.solidParticleSystem.ts

+ 9 - 0
src/Particles/babylon.solidParticleSystem.ts

@@ -658,6 +658,15 @@
                 // call to custom user function to update the particle properties
                 this.updateParticle(this._particle);
                 
+                if (!this._particle.alive) {
+                    // increment indexes for the next particle
+                    pt = this._shape.length;
+                    index += pt * 3;
+                    colorIndex += pt * 4;
+                    uvIndex += pt * 2;
+                    continue;
+                }
+
                 if (this._particle.isVisible) {
 
                     // particle rotation matrix