Potential fix to #511

master
Tomasz Kapuściński 2015-07-18 02:02:38 +02:00
parent 25eaf8f72f
commit 1d69021e94
2 changed files with 6 additions and 2 deletions

View File

@ -422,7 +422,9 @@ void CGL21Device::SetTransform(TransformType type, const Math::Matrix &matrix)
// normal transform
Math::Matrix normalMat = matrix;
normalMat = normalMat.Inverse();
if (abs(normalMat.Det()) > 1e-6)
normalMat = normalMat.Inverse();
glUniformMatrix4fv(uni_NormalMatrix, 1, GL_TRUE, normalMat.Array());
}

View File

@ -449,7 +449,9 @@ void CGL33Device::SetTransform(TransformType type, const Math::Matrix &matrix)
// normal transform
Math::Matrix normalMat = matrix;
normalMat = normalMat.Inverse();
if (abs(normalMat.Det()) > 1e-6)
normalMat = normalMat.Inverse();
glUniformMatrix4fv(uni_NormalMatrix, 1, GL_TRUE, normalMat.Array());
}