Explorar el Código

Merge pull request #3452 from bghgary/determinant-fix

Fix issue with world matrix determinant caching
David Catuhe hace 7 años
padre
commit
cd751c8b69
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      src/Mesh/babylon.transformNode.ts

+ 4 - 1
src/Mesh/babylon.transformNode.ts

@@ -119,7 +119,7 @@ module BABYLON {
          */
          */
         protected _getWorldMatrixDeterminant(): number {
         protected _getWorldMatrixDeterminant(): number {
             if (this._currentRenderId !== this.getScene().getRenderId()) {
             if (this._currentRenderId !== this.getScene().getRenderId()) {
-                this._worldMatrixDeterminant = this.computeWorldMatrix().determinant();
+                this.computeWorldMatrix();
             }
             }
             return this._worldMatrixDeterminant;
             return this._worldMatrixDeterminant;
         }
         }
@@ -835,6 +835,9 @@ module BABYLON {
                 this._poseMatrix = Matrix.Invert(this._worldMatrix);
                 this._poseMatrix = Matrix.Invert(this._worldMatrix);
             }
             }
 
 
+            // Cache the determinant
+            this._worldMatrixDeterminant = this._worldMatrix.determinant();
+
             return this._worldMatrix;
             return this._worldMatrix;
         }
         }