David Catuhe 10 years ago
parent
commit
a7ea31309c

+ 3 - 3
Babylon/Cameras/babylon.camera.js

@@ -226,9 +226,9 @@ var BABYLON;
         Camera.prototype._getViewMatrix = function () {
             return BABYLON.Matrix.Identity();
         };
-        Camera.prototype.getViewMatrix = function () {
-            this._computedViewMatrix = this._computeViewMatrix();
-            if (this.isSynchronized()) {
+        Camera.prototype.getViewMatrix = function (force) {
+            this._computedViewMatrix = this._computeViewMatrix(force);
+            if (!force && this._isSynchronizedViewMatrix()) {
                 return this._computedViewMatrix;
             }
             if (!this.parent || !this.parent.getWorldMatrix) {

+ 3 - 3
Babylon/Cameras/babylon.camera.ts

@@ -281,10 +281,10 @@
             return Matrix.Identity();
         }
 
-        public getViewMatrix(): Matrix {
-            this._computedViewMatrix = this._computeViewMatrix();
+        public getViewMatrix(force?: boolean): Matrix {
+            this._computedViewMatrix = this._computeViewMatrix(force);
 
-            if (this.isSynchronized()) {
+            if (!force && this._isSynchronizedViewMatrix()) {
                 return this._computedViewMatrix;
             }
 

+ 1 - 2
Babylon/Mesh/babylon.mesh.js

@@ -1483,5 +1483,4 @@ var BABYLON;
     })(BABYLON.AbstractMesh);
     BABYLON.Mesh = Mesh;
 })(BABYLON || (BABYLON = {}));
-
-//# sourceMappingURL=../Mesh/babylon.mesh.js.map
+//# sourceMappingURL=babylon.mesh.js.map

+ 5 - 5
Babylon/Mesh/babylon.mesh.ts

@@ -1216,13 +1216,13 @@
         }
 
         public static CreateDisc(name: string, radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
-           var disc = new Mesh(name, scene);
-           var vertexData = VertexData.CreateDisc(radius, tessellation, sideOrientation);
+            var disc = new Mesh(name, scene);
+            var vertexData = VertexData.CreateDisc(radius, tessellation, sideOrientation);
 
-           vertexData.applyToMesh(disc, updatable);
+            vertexData.applyToMesh(disc, updatable);
 
-           return disc;
-       }
+            return disc;
+        }
 
         public static CreateBox(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
             var box = new Mesh(name, scene);

+ 7 - 0
Babylon/babylon.engine.js

@@ -785,6 +785,13 @@ var BABYLON;
             this._renderingCanvas.width = width;
             this._renderingCanvas.height = height;
             this._canvasClientRect = this._renderingCanvas.getBoundingClientRect();
+            for (var index = 0; index < this.scenes.length; index++) {
+                var scene = this.scenes[index];
+                for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) {
+                    var cam = scene.cameras[camIndex];
+                    cam._currentRenderId = 0;
+                }
+            }
         };
         Engine.prototype.bindFramebuffer = function (texture) {
             this._currentRenderTarget = texture;

+ 10 - 0
Babylon/babylon.engine.ts

@@ -914,6 +914,16 @@
             this._renderingCanvas.height = height;
 
             this._canvasClientRect = this._renderingCanvas.getBoundingClientRect();
+
+            for (var index = 0; index < this.scenes.length; index++) {
+                var scene = this.scenes[index];
+
+                for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) {
+                    var cam = scene.cameras[camIndex];
+
+                    cam._currentRenderId = 0;
+                }
+            }
         }
 
         public bindFramebuffer(texture: WebGLTexture): void {

+ 10 - 3
babylon.2.1-beta.debug.js

@@ -4444,6 +4444,13 @@ var __extends = this.__extends || function (d, b) {
             this._renderingCanvas.width = width;
             this._renderingCanvas.height = height;
             this._canvasClientRect = this._renderingCanvas.getBoundingClientRect();
+            for (var index = 0; index < this.scenes.length; index++) {
+                var scene = this.scenes[index];
+                for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) {
+                    var cam = scene.cameras[camIndex];
+                    cam._currentRenderId = 0;
+                }
+            }
         };
         Engine.prototype.bindFramebuffer = function (texture) {
             this._currentRenderTarget = texture;
@@ -7132,9 +7139,9 @@ var BABYLON;
         Camera.prototype._getViewMatrix = function () {
             return BABYLON.Matrix.Identity();
         };
-        Camera.prototype.getViewMatrix = function () {
-            this._computedViewMatrix = this._computeViewMatrix();
-            if (this.isSynchronized()) {
+        Camera.prototype.getViewMatrix = function (force) {
+            this._computedViewMatrix = this._computeViewMatrix(force);
+            if (!force && this._isSynchronizedViewMatrix()) {
                 return this._computedViewMatrix;
             }
             if (!this.parent || !this.parent.getWorldMatrix) {

File diff suppressed because it is too large
+ 23 - 23
babylon.2.1-beta.js