+ fixes #0001418: Base::Matrix4d can't invert rotoinversion
This commit is contained in:
parent
81cbd2643f
commit
efdbe4659a
|
@ -341,7 +341,7 @@ PyObject* MatrixPy::invert(PyObject * args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (getMatrixPtr()->determinant() > DBL_EPSILON)
|
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON)
|
||||||
getMatrixPtr()->inverseGauss();
|
getMatrixPtr()->inverseGauss();
|
||||||
else {
|
else {
|
||||||
PyErr_SetString(PyExc_Exception, "Cannot invert singular matrix");
|
PyErr_SetString(PyExc_Exception, "Cannot invert singular matrix");
|
||||||
|
@ -359,7 +359,7 @@ PyObject* MatrixPy::inverse(PyObject * args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (getMatrixPtr()->determinant() > DBL_EPSILON) {
|
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
|
||||||
Base::Matrix4D m = *getMatrixPtr();
|
Base::Matrix4D m = *getMatrixPtr();
|
||||||
m.inverseGauss();
|
m.inverseGauss();
|
||||||
return new MatrixPy(m);
|
return new MatrixPy(m);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user