Преглед на файлове

Fixing WebVR matrix updates

David Catuhe преди 8 години
родител
ревизия
8bb3d03b94

Файловите разлики са ограничени, защото са твърде много
+ 1376 - 1377
dist/preview release/babylon.d.ts


Файловите разлики са ограничени, защото са твърде много
+ 17 - 17
dist/preview release/babylon.js


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

@@ -15227,10 +15227,6 @@ var BABYLON;
             this._cache.renderWidth = engine.getRenderWidth();
             this._cache.renderHeight = engine.getRenderHeight();
         };
-        Camera.prototype._updateFromScene = function () {
-            this.updateCache();
-            this.update();
-        };
         // Synchronized
         Camera.prototype._isSynchronized = function () {
             return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();
@@ -18818,6 +18814,7 @@ var BABYLON;
             // Camera
             this.resetCachedMaterial();
             this._renderId++;
+            this.activeCamera.update();
             this.updateTransformMatrix();
             if (camera._alternateCamera) {
                 this.updateAlternateTransformMatrix(camera._alternateCamera);
@@ -18953,7 +18950,7 @@ var BABYLON;
             // Finalize frame
             this.postProcessManager._finalizeFrame(camera.isIntermediate);
             // Update camera
-            this.activeCamera._updateFromScene();
+            this.activeCamera.updateCache();
             // Reset some special arrays
             this._renderTargets.reset();
             this._alternateRendering = false;
@@ -18965,14 +18962,15 @@ var BABYLON;
                 this._renderForCamera(camera);
                 return;
             }
+            // Update camera
+            this.activeCamera.update();
             // rig cameras
             for (var index = 0; index < camera._rigCameras.length; index++) {
                 this._renderForCamera(camera._rigCameras[index]);
             }
             this.activeCamera = camera;
             this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix());
-            // Update camera
-            this.activeCamera._updateFromScene();
+            this.activeCamera.updateCache();
         };
         Scene.prototype._checkIntersections = function () {
             for (var index = 0; index < this._meshesForIntersections.length; index++) {
@@ -52642,9 +52640,10 @@ var BABYLON;
                 if (!_this._loadedMeshInfo) {
                     return;
                 }
-                _this.attachToMesh(_this._loadedMeshInfo.rootNode);
+                _this._defaultModel = _this._loadedMeshInfo.rootNode;
+                _this.attachToMesh(_this._defaultModel);
                 if (meshLoaded) {
-                    meshLoaded(_this._loadedMeshInfo.rootNode);
+                    meshLoaded(_this._defaultModel);
                 }
             }, null, function (scene, message) {
                 BABYLON.Tools.Log(message);

Файловите разлики са ограничени, защото са твърде много
+ 1376 - 1377
dist/preview release/babylon.module.d.ts


Файловите разлики са ограничени, защото са твърде много
+ 17 - 17
dist/preview release/babylon.worker.js


Файловите разлики са ограничени, защото са твърде много
+ 2935 - 2936
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Файловите разлики са ограничени, защото са твърде много
+ 17 - 17
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 8 - 9
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -15227,10 +15227,6 @@ var BABYLON;
             this._cache.renderWidth = engine.getRenderWidth();
             this._cache.renderHeight = engine.getRenderHeight();
         };
-        Camera.prototype._updateFromScene = function () {
-            this.updateCache();
-            this.update();
-        };
         // Synchronized
         Camera.prototype._isSynchronized = function () {
             return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();
@@ -18818,6 +18814,7 @@ var BABYLON;
             // Camera
             this.resetCachedMaterial();
             this._renderId++;
+            this.activeCamera.update();
             this.updateTransformMatrix();
             if (camera._alternateCamera) {
                 this.updateAlternateTransformMatrix(camera._alternateCamera);
@@ -18953,7 +18950,7 @@ var BABYLON;
             // Finalize frame
             this.postProcessManager._finalizeFrame(camera.isIntermediate);
             // Update camera
-            this.activeCamera._updateFromScene();
+            this.activeCamera.updateCache();
             // Reset some special arrays
             this._renderTargets.reset();
             this._alternateRendering = false;
@@ -18965,14 +18962,15 @@ var BABYLON;
                 this._renderForCamera(camera);
                 return;
             }
+            // Update camera
+            this.activeCamera.update();
             // rig cameras
             for (var index = 0; index < camera._rigCameras.length; index++) {
                 this._renderForCamera(camera._rigCameras[index]);
             }
             this.activeCamera = camera;
             this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix());
-            // Update camera
-            this.activeCamera._updateFromScene();
+            this.activeCamera.updateCache();
         };
         Scene.prototype._checkIntersections = function () {
             for (var index = 0; index < this._meshesForIntersections.length; index++) {
@@ -52642,9 +52640,10 @@ var BABYLON;
                 if (!_this._loadedMeshInfo) {
                     return;
                 }
-                _this.attachToMesh(_this._loadedMeshInfo.rootNode);
+                _this._defaultModel = _this._loadedMeshInfo.rootNode;
+                _this.attachToMesh(_this._defaultModel);
                 if (meshLoaded) {
-                    meshLoaded(_this._loadedMeshInfo.rootNode);
+                    meshLoaded(_this._defaultModel);
                 }
             }, null, function (scene, message) {
                 BABYLON.Tools.Log(message);

Файловите разлики са ограничени, защото са твърде много
+ 2935 - 2936
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 0 - 5
src/Cameras/babylon.camera.ts

@@ -278,11 +278,6 @@
             this._cache.renderHeight = engine.getRenderHeight();
         }
 
-        public _updateFromScene(): void {
-            this.updateCache();
-            this.update();
-        }
-
         // Synchronized
         public _isSynchronized(): boolean {
             return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();

+ 2 - 1
src/Gamepad/Controllers/babylon.windowsMotionController.ts

@@ -40,6 +40,7 @@ module BABYLON {
         private readonly _mapping = {
             // Semantic button names
             buttons: ['thumbstick', 'trigger', 'grip', 'menu', 'trackpad'],
+            
             // A mapping of the button name to glTF model node name
             // that should be transformed by button value.
             buttonMeshNames: {
@@ -208,7 +209,7 @@ module BABYLON {
 
                 this._defaultModel = this._loadedMeshInfo.rootNode;
                 this.attachToMesh(this._defaultModel);
-                
+
                 if (meshLoaded) {
                     meshLoaded(this._defaultModel);
                 }

+ 8 - 6
src/babylon.scene.ts

@@ -2829,13 +2829,14 @@
                 throw new Error("Active camera not set");
 
             Tools.StartPerformanceCounter("Rendering camera " + this.activeCamera.name);
-
+           
             // Viewport
             engine.setViewport(this.activeCamera.viewport);
 
             // Camera
             this.resetCachedMaterial();
             this._renderId++;
+            this.activeCamera.update();
             this.updateTransformMatrix();
 
             if (camera._alternateCamera) {
@@ -3005,8 +3006,8 @@
             this.postProcessManager._finalizeFrame(camera.isIntermediate);
 
             // Update camera
-            this.activeCamera._updateFromScene();
-
+            this.activeCamera.updateCache();
+            
             // Reset some special arrays
             this._renderTargets.reset();
 
@@ -3023,6 +3024,9 @@
                 return;
             }
 
+            // Update camera
+            this.activeCamera.update();
+            
             // rig cameras
             for (var index = 0; index < camera._rigCameras.length; index++) {
                 this._renderForCamera(camera._rigCameras[index]);
@@ -3030,9 +3034,7 @@
 
             this.activeCamera = camera;
             this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix());
-
-            // Update camera
-            this.activeCamera._updateFromScene();
+            this.activeCamera.updateCache();
         }
 
         private _checkIntersections(): void {