瀏覽代碼

only detatch control for non-vr cameras

Trevor Baron 7 年之前
父節點
當前提交
edb47d3205

+ 2 - 2
src/Behaviors/Mesh/babylon.pointerDragBehavior.ts

@@ -163,7 +163,7 @@ module BABYLON {
                             targetPosition.copyFrom((<Mesh>this._attachedNode).absolutePosition)
                             targetPosition.copyFrom((<Mesh>this._attachedNode).absolutePosition)
 
 
                             // Detatch camera controls
                             // Detatch camera controls
-                            if(this.detachCameraControls && this._scene.activeCamera){
+                            if(this.detachCameraControls && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                                 if(this._scene.activeCamera.inputs.attachedElement){
                                 if(this._scene.activeCamera.inputs.attachedElement){
                                     attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                     attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                     this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
                                     this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
@@ -178,7 +178,7 @@ module BABYLON {
                         this.releaseDrag();
                         this.releaseDrag();
 
 
                         // Reattach camera controls
                         // Reattach camera controls
-                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera){
+                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                             this._scene.activeCamera.attachControl(attachedElement, true);
                             this._scene.activeCamera.attachControl(attachedElement, true);
                         }
                         }
                     }
                     }

+ 2 - 2
src/Behaviors/Mesh/babylon.sixDofDragBehavior.ts

@@ -107,7 +107,7 @@ module BABYLON {
                         this.currentDraggingPointerID = (<PointerEvent>pointerInfo.event).pointerId;
                         this.currentDraggingPointerID = (<PointerEvent>pointerInfo.event).pointerId;
 
 
                         // Detatch camera controls
                         // Detatch camera controls
-                        if(this.detachCameraControls && this._scene.activeCamera){
+                        if(this.detachCameraControls && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                             if(this._scene.activeCamera.inputs.attachedElement){
                             if(this._scene.activeCamera.inputs.attachedElement){
                                 attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                 attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                 this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
                                 this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
@@ -125,7 +125,7 @@ module BABYLON {
                         this._virtualOriginMesh.removeChild(this._virtualDragMesh);
                         this._virtualOriginMesh.removeChild(this._virtualDragMesh);
                         
                         
                         // Reattach camera controls
                         // Reattach camera controls
-                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera){
+                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                             this._scene.activeCamera.attachControl(attachedElement, true);
                             this._scene.activeCamera.attachControl(attachedElement, true);
                         }
                         }
                     }
                     }