Browse Source

Fixing issue with picking when scene has no camera

David Catuhe 9 years ago
parent
commit
9ec1220602

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


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


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


+ 9 - 0
dist/preview release/babylon.max.js

@@ -12316,6 +12316,9 @@ var BABYLON;
                 return sprite.isPickable && sprite.actionManager && sprite.actionManager.hasPickTriggers;
             };
             this._onPointerMove = function (evt) {
+                if (!_this.cameraToUseForPointers && !_this.activeCamera) {
+                    return;
+                }
                 var canvas = _this._engine.getRenderingCanvas();
                 _this._updatePointerPosition(evt);
                 // Meshes
@@ -12348,6 +12351,9 @@ var BABYLON;
                 }
             };
             this._onPointerDown = function (evt) {
+                if (!_this.cameraToUseForPointers && !_this.activeCamera) {
+                    return;
+                }
                 _this._updatePointerPosition(evt);
                 var predicate = null;
                 // Meshes
@@ -12398,6 +12404,9 @@ var BABYLON;
                 }
             };
             this._onPointerUp = function (evt) {
+                if (!_this.cameraToUseForPointers && !_this.activeCamera) {
+                    return;
+                }
                 var predicate = null;
                 _this._updatePointerPosition(evt);
                 if (!_this.onPointerUp) {

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


+ 9 - 0
src/babylon.scene.js

@@ -319,6 +319,9 @@ var BABYLON;
                 return sprite.isPickable && sprite.actionManager && sprite.actionManager.hasPickTriggers;
             };
             this._onPointerMove = function (evt) {
+                if (!_this.cameraToUseForPointers && !_this.activeCamera) {
+                    return;
+                }
                 var canvas = _this._engine.getRenderingCanvas();
                 _this._updatePointerPosition(evt);
                 // Meshes
@@ -351,6 +354,9 @@ var BABYLON;
                 }
             };
             this._onPointerDown = function (evt) {
+                if (!_this.cameraToUseForPointers && !_this.activeCamera) {
+                    return;
+                }
                 _this._updatePointerPosition(evt);
                 var predicate = null;
                 // Meshes
@@ -401,6 +407,9 @@ var BABYLON;
                 }
             };
             this._onPointerUp = function (evt) {
+                if (!_this.cameraToUseForPointers && !_this.activeCamera) {
+                    return;
+                }
                 var predicate = null;
                 _this._updatePointerPosition(evt);
                 if (!_this.onPointerUp) {

File diff suppressed because it is too large
+ 2439 - 2429
src/babylon.scene.ts