Bläddra i källkod

Merge pull request #7812 from Popov72/fix-plane-transform

Fix bug in Plane.transform when matrix passed in is not a pure rotation
mergify[bot] 5 år sedan
förälder
incheckning
d27ebdf107
2 ändrade filer med 4 tillägg och 3 borttagningar
  1. 1 0
      dist/preview release/what's new.md
  2. 3 3
      src/Maths/math.plane.ts

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

@@ -61,5 +61,6 @@
 - Fix improper baking of transformed textures in `KHR_texture_transform` serializer. ([drigax](https://github.com/Drigax))
 - Fixed NME codegen: missing common properties for float-value input block. ([ycw](https://github.com/ycw))
 - Fixed missing options for MeshBuilder.CreateBox. ([ycw](https://github.com/ycw))
+- Fix bug in `Plane.transform` when matrix passed in is not a pure rotation ([Popov72](https://github.com/Popov72)
 
 ## Breaking changes

+ 3 - 3
src/Maths/math.plane.ts

@@ -78,9 +78,9 @@ export class Plane {
      * @returns a new Plane as the result of the transformation of the current Plane by the given matrix.
      */
     public transform(transformation: DeepImmutable<Matrix>): Plane {
-        const transposedMatrix = Plane._TmpMatrix;
-        Matrix.TransposeToRef(transformation, transposedMatrix);
-        const m = transposedMatrix.m;
+        const invertedMatrix = Plane._TmpMatrix;
+        transformation.invertToRef(invertedMatrix);
+        const m = invertedMatrix.m;
         var x = this.normal.x;
         var y = this.normal.y;
         var z = this.normal.z;