Pārlūkot izejas kodu

Added camera.update to manually udpate camera info (for offscreen cameras)

David Catuhe 9 gadi atpakaļ
vecāks
revīzija
9e2255e778

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 15 - 15
dist/preview release/babylon.core.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 994 - 994
dist/preview release/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 30 - 30
dist/preview release/babylon.js


+ 7 - 3
dist/preview release/babylon.max.js

@@ -12084,7 +12084,7 @@ var BABYLON;
         };
         Camera.prototype._updateFromScene = function () {
             this.updateCache();
-            this._update();
+            this.update();
         };
         // Synchronized
         Camera.prototype._isSynchronized = function () {
@@ -12124,7 +12124,7 @@ var BABYLON;
         };
         Camera.prototype.detachControl = function (element) {
         };
-        Camera.prototype._update = function () {
+        Camera.prototype.update = function () {
             if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
                 this._updateRigCameras();
             }
@@ -12343,7 +12343,8 @@ var BABYLON;
                     break;
             }
             this._cascadePostProcessesToRigCams();
-            this._update();
+            this.
+                update();
         };
         Camera.prototype._getVRProjectionMatrix = function () {
             BABYLON.Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix);
@@ -13435,6 +13436,8 @@ var BABYLON;
                             _this.camera.inertialAlphaOffset -= offsetX / _this.angularSensibilityX;
                             _this.camera.inertialBetaOffset -= offsetY / _this.angularSensibilityY;
                         }
+                        console.log(_this.camera.name);
+                        console.log(_this.camera.inertialAlphaOffset);
                         cacheSoloPointer.x = evt.clientX;
                         cacheSoloPointer.y = evt.clientY;
                     }
@@ -14623,6 +14626,7 @@ var BABYLON;
                 return;
             }
             this.inputs.checkInputs();
+            console.log(this.name);
             // Inertia
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {
                 this.alpha += this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset;

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 30 - 30
dist/preview release/babylon.noworker.js


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

@@ -83,6 +83,8 @@ var BABYLON;
                             _this.camera.inertialAlphaOffset -= offsetX / _this.angularSensibilityX;
                             _this.camera.inertialBetaOffset -= offsetY / _this.angularSensibilityY;
                         }
+                        console.log(_this.camera.name);
+                        console.log(_this.camera.inertialAlphaOffset);
                         cacheSoloPointer.x = evt.clientX;
                         cacheSoloPointer.y = evt.clientY;
                     }

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

@@ -101,6 +101,10 @@ module BABYLON {
                             this.camera.inertialAlphaOffset -= offsetX / this.angularSensibilityX;
                             this.camera.inertialBetaOffset -= offsetY / this.angularSensibilityY;
                         }
+
+                        console.log(this.camera.name);
+                        console.log(this.camera.inertialAlphaOffset);
+
                         cacheSoloPointer.x = evt.clientX;
                         cacheSoloPointer.y = evt.clientY;
                     }

+ 1 - 0
src/Cameras/babylon.arcRotateCamera.js

@@ -280,6 +280,7 @@ var BABYLON;
                 return;
             }
             this.inputs.checkInputs();
+            console.log(this.name);
             // Inertia
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {
                 this.alpha += this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset;

+ 2 - 2
src/Cameras/babylon.arcRotateCamera.ts

@@ -282,8 +282,8 @@
                 return;
             }
 
-            this.inputs.checkInputs();            
-			
+            this.inputs.checkInputs();
+            console.log(this.name);
             // Inertia
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {
                 this.alpha += this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset;

+ 4 - 3
src/Cameras/babylon.camera.js

@@ -182,7 +182,7 @@ var BABYLON;
         };
         Camera.prototype._updateFromScene = function () {
             this.updateCache();
-            this._update();
+            this.update();
         };
         // Synchronized
         Camera.prototype._isSynchronized = function () {
@@ -222,7 +222,7 @@ var BABYLON;
         };
         Camera.prototype.detachControl = function (element) {
         };
-        Camera.prototype._update = function () {
+        Camera.prototype.update = function () {
             if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
                 this._updateRigCameras();
             }
@@ -441,7 +441,8 @@ var BABYLON;
                     break;
             }
             this._cascadePostProcessesToRigCams();
-            this._update();
+            this.
+                update();
         };
         Camera.prototype._getVRProjectionMatrix = function () {
             BABYLON.Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix);

+ 4 - 3
src/Cameras/babylon.camera.ts

@@ -217,7 +217,7 @@
 
         public _updateFromScene(): void {
             this.updateCache();
-            this._update();
+            this.update();
         }
 
         // Synchronized
@@ -268,7 +268,7 @@
         public detachControl(element: HTMLElement): void {
         }
 
-        public _update(): void {
+        public update(): void {
             if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
                 this._updateRigCameras();
             }
@@ -536,7 +536,8 @@
             }
 
             this._cascadePostProcessesToRigCams();
-            this._update();
+            this.
+                update();
         }
 
         private _getVRProjectionMatrix(): Matrix {