Преглед изворни кода

Fix issue with world matrix determinant caching

Gary Hsu пре 7 година
родитељ
комит
20b0c00dde
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      src/Mesh/babylon.transformNode.ts

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

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