浏览代码

Fixed a bug with camera inputs serialization
Fixed a bug with camera.attachControl

David Catuhe 9 年之前
父节点
当前提交
a05dabd999

文件差异内容过多而无法显示
+ 4 - 4
dist/preview release/babylon.core.js


文件差异内容过多而无法显示
+ 667 - 667
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 4 - 4
dist/preview release/babylon.js


+ 6 - 6
dist/preview release/babylon.max.js

@@ -11137,7 +11137,7 @@ var BABYLON;
             BABYLON.serializeAsVector3()
         ], Camera.prototype, "position", void 0);
         __decorate([
-            BABYLON.serialize()
+            BABYLON.serializeAsVector3()
         ], Camera.prototype, "upVector", void 0);
         __decorate([
             BABYLON.serialize()
@@ -11328,7 +11328,7 @@ var BABYLON;
         }
         FreeCameraMouseInput.prototype.attachControl = function (element, noPreventDefault) {
             var _this = this;
-            if (this._onMouseDown === undefined) {
+            if (!this._onMouseDown) {
                 var camera = this.camera;
                 var engine = this.camera.getEngine();
                 this._onMouseDown = function (evt) {
@@ -11423,7 +11423,7 @@ var BABYLON;
         }
         FreeCameraKeyboardMoveInput.prototype.attachControl = function (element, noPreventDefault) {
             var _this = this;
-            if (this._onKeyDown === undefined) {
+            if (!this._onKeyDown) {
                 this._onKeyDown = function (evt) {
                     if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
                         _this.keysDown.indexOf(evt.keyCode) !== -1 ||
@@ -12074,6 +12074,9 @@ var BABYLON;
             var cacheSoloPointer; // cache pointer object for better perf on camera rotation
             var pointers = new BABYLON.SmartCollection();
             var previousPinchDistance = 0;
+            this._onContextMenu = function (evt) {
+                evt.preventDefault();
+            };
             if (!this.camera._useCtrlForPanning) {
                 element.addEventListener("contextmenu", this._onContextMenu, false);
             }
@@ -12111,9 +12114,6 @@ var BABYLON;
                     evt.preventDefault();
                 }
             };
-            this._onContextMenu = function (evt) {
-                evt.preventDefault();
-            };
             this._onPointerMove = function (evt) {
                 if (!noPreventDefault) {
                     evt.preventDefault();

文件差异内容过多而无法显示
+ 4 - 4
dist/preview release/babylon.noworker.js


+ 3 - 3
src/Cameras/Inputs/babylon.arcrotatecamera.input.pointers.js

@@ -23,6 +23,9 @@ var BABYLON;
             var cacheSoloPointer; // cache pointer object for better perf on camera rotation
             var pointers = new BABYLON.SmartCollection();
             var previousPinchDistance = 0;
+            this._onContextMenu = function (evt) {
+                evt.preventDefault();
+            };
             if (!this.camera._useCtrlForPanning) {
                 element.addEventListener("contextmenu", this._onContextMenu, false);
             }
@@ -60,9 +63,6 @@ var BABYLON;
                     evt.preventDefault();
                 }
             };
-            this._onContextMenu = function (evt) {
-                evt.preventDefault();
-            };
             this._onPointerMove = function (evt) {
                 if (!noPreventDefault) {
                     evt.preventDefault();

+ 4 - 4
src/Cameras/Inputs/babylon.arcrotatecamera.input.pointers.ts

@@ -38,6 +38,10 @@ module BABYLON {
             var pointers = new SmartCollection();
             var previousPinchDistance = 0;
 
+            this._onContextMenu = evt => {
+                evt.preventDefault();
+            };
+
             if (!this.camera._useCtrlForPanning) {
                 element.addEventListener("contextmenu", this._onContextMenu, false);
             }
@@ -84,10 +88,6 @@ module BABYLON {
                 }
             };
 
-            this._onContextMenu = evt => {
-                evt.preventDefault();
-            };
-
             this._onPointerMove = evt => {
                 if (!noPreventDefault) {
                     evt.preventDefault();

+ 1 - 1
src/Cameras/Inputs/babylon.freecamera.input.keyboard.js

@@ -16,7 +16,7 @@ var BABYLON;
         }
         FreeCameraKeyboardMoveInput.prototype.attachControl = function (element, noPreventDefault) {
             var _this = this;
-            if (this._onKeyDown === undefined) {
+            if (!this._onKeyDown) {
                 this._onKeyDown = function (evt) {
                     if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
                         _this.keysDown.indexOf(evt.keyCode) !== -1 ||

+ 1 - 1
src/Cameras/Inputs/babylon.freecamera.input.keyboard.ts

@@ -18,7 +18,7 @@ module BABYLON {
         public keysRight = [39];
 
         attachControl(element : HTMLElement, noPreventDefault?: boolean) {
-            if (this._onKeyDown === undefined) {
+            if (!this._onKeyDown) {
 
                 this._onKeyDown = evt => {
                     if (this.keysUp.indexOf(evt.keyCode) !== -1 ||

+ 1 - 1
src/Cameras/Inputs/babylon.freecamera.input.mouse.js

@@ -12,7 +12,7 @@ var BABYLON;
         }
         FreeCameraMouseInput.prototype.attachControl = function (element, noPreventDefault) {
             var _this = this;
-            if (this._onMouseDown === undefined) {
+            if (!this._onMouseDown) {
                 var camera = this.camera;
                 var engine = this.camera.getEngine();
                 this._onMouseDown = function (evt) {

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

@@ -12,7 +12,7 @@ module BABYLON {
         private previousPosition: { x: number, y: number };
 
         attachControl(element: HTMLElement, noPreventDefault?: boolean){                     
-            if (this._onMouseDown === undefined) {
+            if (!this._onMouseDown) {
                 var camera = this.camera;
                 var engine = this.camera.getEngine();
                 

+ 1 - 1
src/Cameras/babylon.camera.js

@@ -586,7 +586,7 @@ var BABYLON;
             BABYLON.serializeAsVector3()
         ], Camera.prototype, "position", void 0);
         __decorate([
-            BABYLON.serialize()
+            BABYLON.serializeAsVector3()
         ], Camera.prototype, "upVector", void 0);
         __decorate([
             BABYLON.serialize()

+ 1 - 1
src/Cameras/babylon.camera.ts

@@ -62,7 +62,7 @@
         @serializeAsVector3()
         public position: Vector3;
 
-        @serialize()
+        @serializeAsVector3()
         public upVector = Vector3.Up();
 
         @serialize()