Browse Source

Legacy fallback if worker not built

If the worker is (for some reason) not built legacy mode will be
triggered
Raanan Weber 10 years ago
parent
commit
838743eca3
2 changed files with 4 additions and 4 deletions
  1. 2 2
      Babylon/babylon.scene.js
  2. 2 2
      Babylon/babylon.scene.ts

+ 2 - 2
Babylon/babylon.scene.js

@@ -141,8 +141,8 @@ var BABYLON;
             this.mainSoundTrack = new BABYLON.SoundTrack(this, { mainTrack: true });
             //simplification queue
             this.simplificationQueue = new BABYLON.SimplificationQueue();
-            //collision coordinator initialization - if worker not enabled the legacy collision detection will be initialized.
-            this.workerCollisions = !!Worker;
+            //collision coordinator initialization.
+            this.workerCollisions = (!!Worker && !!BABYLON.CollisionWorker);
         }
         Object.defineProperty(Scene, "FOGMODE_NONE", {
             get: function () {

+ 2 - 2
Babylon/babylon.scene.ts

@@ -291,8 +291,8 @@
 
             //simplification queue
             this.simplificationQueue = new SimplificationQueue();
-            //collision coordinator initialization - if worker not enabled the legacy collision detection will be initialized.
-            this.workerCollisions = !!Worker;
+            //collision coordinator initialization.
+            this.workerCollisions = (!!Worker && !!BABYLON.CollisionWorker);
         }
 
         // Properties