소스 검색

Merge pull request #5345 from barroij/toNormalMatrixFix

fix Matrix.toNormalMatrix
David Catuhe 6 년 전
부모
커밋
de31926f42
2개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      dist/preview release/what's new.md
  2. 3 2
      src/Math/babylon.math.ts

+ 1 - 1
dist/preview release/what's new.md

@@ -51,7 +51,7 @@
 - Fixed a bug with particle systems being update once per camera instead of once per frame ([Deltakosh](https://github.com/deltakosh))
 - Handle properly the `LinesMesh` `intersectionThreshold` by using its value directly when the intersection against a `Ray` is checked, instead of extending the `BoundingInfo` accordingly ([barroij](https://github.com/barroij))
 - Fixed the `LineEdgesRenderer` used for edge rendering of `LinesMesh` handle properly LinesMesh made of disconnected lines + Make it work for instance of `LinesMesh` ([barroij](https://github.com/barroij))
-
+- Fixed `Matrix.toNormalMatrix`function ([barroij](https://github.com/barroij))
 ### Viewer
 
 ### Loaders

+ 3 - 2
src/Math/babylon.math.ts

@@ -4857,8 +4857,9 @@ module BABYLON {
          * @param ref matrix to store the result
          */
         public toNormalMatrix(ref: Matrix): void {
-            this.invertToRef(ref);
-            ref.transpose();
+            const tmp = MathTmp.Matrix[0];
+            this.invertToRef(tmp);
+            tmp.transposeToRef(ref);
             var m = ref.m;
             Matrix.FromValuesToRef(
                 m[0], m[1], m[2], 0,