Browse Source

Fix GPUParticles.isReady

David Catuhe 7 years ago
parent
commit
7149a2ecec

File diff suppressed because it is too large
+ 7773 - 7773
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 16 - 16
dist/preview release/babylon.js


+ 6 - 2
dist/preview release/babylon.max.js

@@ -53506,8 +53506,12 @@ var BABYLON;
          * @return true if the system is ready
          */
         GPUParticleSystem.prototype.isReady = function () {
-            if (!this.emitter || !this._updateEffect || !this._renderEffect ||
-                !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
+            if (!this._updateEffect) {
+                this._recreateUpdateEffect();
+                this._recreateRenderEffect();
+                return false;
+            }
+            if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
                 return false;
             }
             return true;

File diff suppressed because it is too large
+ 16 - 16
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 1971 - 1971
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


+ 6 - 2
dist/preview release/es6.js

@@ -53479,8 +53479,12 @@ var BABYLON;
          * @return true if the system is ready
          */
         GPUParticleSystem.prototype.isReady = function () {
-            if (!this.emitter || !this._updateEffect || !this._renderEffect ||
-                !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
+            if (!this._updateEffect) {
+                this._recreateUpdateEffect();
+                this._recreateRenderEffect();
+                return false;
+            }
+            if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
                 return false;
             }
             return true;

File diff suppressed because it is too large
+ 3 - 3
dist/preview release/viewer/babylon.viewer.js


+ 6 - 2
dist/preview release/viewer/babylon.viewer.max.js

@@ -53589,8 +53589,12 @@ var BABYLON;
          * @return true if the system is ready
          */
         GPUParticleSystem.prototype.isReady = function () {
-            if (!this.emitter || !this._updateEffect || !this._renderEffect ||
-                !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
+            if (!this._updateEffect) {
+                this._recreateUpdateEffect();
+                this._recreateRenderEffect();
+                return false;
+            }
+            if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
                 return false;
             }
             return true;

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

@@ -262,8 +262,14 @@
          * @return true if the system is ready
          */
         public isReady(): boolean {
-            if (!this.emitter || !this._updateEffect || !this._renderEffect || 
-                !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
+            if (!this._updateEffect) {
+                this._recreateUpdateEffect();
+                this._recreateRenderEffect();
+                return false;
+            }
+
+
+            if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
                 return false;
             }