Преглед изворни кода

Merge pull request #509 from RaananW/worker-init-check

Check during workerCollision set
David Catuhe пре 10 година
родитељ
комит
12daf4b907
2 измењених фајлова са 4 додато и 1 уклоњено
  1. 1 1
      Babylon/babylon.scene.js
  2. 3 0
      Babylon/babylon.scene.ts

+ 1 - 1
Babylon/babylon.scene.js

@@ -185,6 +185,7 @@ var BABYLON;
                 return this._workerCollisions;
             },
             set: function (enabled) {
+                enabled = (enabled && !!Worker);
                 this._workerCollisions = enabled;
                 if (this.collisionCoordinator) {
                     this.collisionCoordinator.destroy();
@@ -1731,4 +1732,3 @@ var BABYLON;
     })();
     BABYLON.Scene = Scene;
 })(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.scene.js.map

+ 3 - 0
Babylon/babylon.scene.ts

@@ -302,6 +302,9 @@
         }
 
         public set workerCollisions(enabled: boolean) {
+        
+            enabled = (enabled && !!Worker)
+        
             this._workerCollisions = enabled;
             if (this.collisionCoordinator) {
                 this.collisionCoordinator.destroy();