Explorar o código

SPS : Added loop skipping for dead solid particles

jbousquie %!s(int64=8) %!d(string=hai) anos
pai
achega
8a0f53dcff
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  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