@galacean/engine-math 1.1.0-beta.14 → 1.1.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -2767,22 +2767,17 @@ function _create_class(Constructor, protoProps, staticProps) {
2767
2767
  var m11 = e[0];
2768
2768
  var m12 = e[1];
2769
2769
  var m13 = e[2];
2770
- var m14 = e[3];
2771
2770
  var m21 = e[4];
2772
2771
  var m22 = e[5];
2773
2772
  var m23 = e[6];
2774
- var m24 = e[7];
2775
2773
  var m31 = e[8];
2776
2774
  var m32 = e[9];
2777
2775
  var m33 = e[10];
2778
- var m34 = e[11];
2779
2776
  translation.set(e[12], e[13], e[14]);
2780
- var xs = Math.sign(m11 * m12 * m13 * m14) < 0 ? -1 : 1;
2781
- var ys = Math.sign(m21 * m22 * m23 * m24) < 0 ? -1 : 1;
2782
- var zs = Math.sign(m31 * m32 * m33 * m34) < 0 ? -1 : 1;
2783
- var sx = xs * Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);
2784
- var sy = ys * Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);
2785
- var sz = zs * Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);
2777
+ var sx = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);
2778
+ var sy = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);
2779
+ var sz = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);
2780
+ if (this.determinant() < 0) sx = -sx;
2786
2781
  scale.set(sx, sy, sz);
2787
2782
  if (Math.abs(sx) < MathUtil.zeroTolerance || Math.abs(sy) < MathUtil.zeroTolerance || Math.abs(sz) < MathUtil.zeroTolerance) {
2788
2783
  rotation.identity();