Index: Matrix3f.java
--- Matrix3f.java Base (BASE)
+++ Matrix3f.java Locally Modified (Based On LOCAL)
@@ -846,7 +846,7 @@
if (store == null) store = new Matrix3f();
float det = determinant();
- if ( FastMath.abs(det) <= FastMath.FLT_EPSILON )
No newline at end of file
+ if ( FastMath.abs(det) <= 0 )
No newline at end of file
return store.zero();
store.m00 = m11*m22 - m12*m21;
Index: Matrix4f.java
--- Matrix4f.java Base (BASE)
+++ Matrix4f.java Locally Modified (Based On LOCAL)
@@ -1037,8 +1037,8 @@
float fB5 = m22*m33 - m23*m32;
float fDet = fA0*fB5-fA1*fB4+fA2*fB3+fA3*fB2-fA4*fB1+fA5*fB0;
- if ( FastMath.abs(fDet) <= FastMath.FLT_EPSILON )
- throw new ArithmeticException("This matrix cannot be inverted");
+ if ( FastMath.abs(fDet) <= 0 )
+ return store.zero();
store.m00 = + m11*fB5 - m12*fB4 + m13*fB3;
store.m10 = - m10*fB5 + m12*fB2 - m13*fB1;
As per the discussion: http://www.jmonkeyengine.com/jmeforum/index.php?topic=9223.0
I wonder why Matrix4f threw an error there, Matrix3f returns a zero matrix and so does Matrix4f in invertLocal...