Browse Source

SPS : Added loop skipping for dead solid particles

jbousquie 8 năm trước cách đây
mục cha
commit
8a0f53dcff
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  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