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

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,