소스 검색

Merge pull request #1362 from abow/master

a better fix for freecamera pointer unlock issue
David Catuhe 9 년 전
부모
커밋
a541c162b4
1개의 변경된 파일2개의 추가작업 그리고 12개의 파일을 삭제
  1. 2 12
      src/Cameras/Inputs/babylon.freecamera.input.mouse.ts

+ 2 - 12
src/Cameras/Inputs/babylon.freecamera.input.mouse.ts

@@ -10,8 +10,7 @@ module BABYLON {
         private _observer: Observer<PointerInfo>;
 
         private previousPosition: { x: number, y: number };
-        private _isPointerLock = false;
-
+        
         constructor(public touchEnabled = true) {
         }
 
@@ -26,12 +25,6 @@ module BABYLON {
                         return;
                     }
 
-                    if (this._isPointerLock && !engine.isPointerLock) {
-						this.previousPosition = null;
-					}
-					
-					this._isPointerLock = engine.isPointerLock;
-
                     if (p.type === PointerEventTypes.POINTERDOWN) {
                         try {
                             evt.srcElement.setPointerCapture(evt.pointerId);
@@ -106,10 +99,7 @@ module BABYLON {
                 
                 camera.cameraRotation.x += offsetY / this.angularSensibility;
 
-                this.previousPosition = {
-                    x: evt.clientX,
-                    y: evt.clientY
-                };
+                this.previousPosition = null;
                 
                 if (!noPreventDefault) {
                     evt.preventDefault();