+ fixes #0001418: Base::Matrix4d can't invert rotoinversion

This commit is contained in:
wmayer 2014-02-17 16:42:28 +01:00
parent 81cbd2643f
commit efdbe4659a

View File

@ -341,7 +341,7 @@ PyObject* MatrixPy::invert(PyObject * args)
return NULL;
PY_TRY {
if (getMatrixPtr()->determinant() > DBL_EPSILON)
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON)
getMatrixPtr()->inverseGauss();
else {
PyErr_SetString(PyExc_Exception, "Cannot invert singular matrix");
@ -359,7 +359,7 @@ PyObject* MatrixPy::inverse(PyObject * args)
return NULL;
PY_TRY {
if (getMatrixPtr()->determinant() > DBL_EPSILON) {
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
Base::Matrix4D m = *getMatrixPtr();
m.inverseGauss();
return new MatrixPy(m);