Community
Participate
Working Groups
First, the matrix inversion algorithm in Math3DMatrix4f#invert() does not check whether the matrix is invertible (determinant != 0) beforehand. It also uses a shorthand method that only works in special cases (see wikipedia). For cases in which the special method fails, the general algorithm has to be used (divide matrix of cofactors by own determinant).
Fixed: Firstly the determinant is calculated. Then, block wise inversion is used, testing whether the block matrices are correctly invertible. If they are not, a general but slower algorithm is used. This may be optimized, e.g., for general algorithm could be replaced by the Gauß-Jordan algorithm.