Code: Select all
inline quaternion& quaternion::operator=(const matrix4& m)
{
const f32 diag = m(0,0) + m(1,1) + m(2,2) + 1;
if( diag > 0.0f && !irr::core::equals(diag, 0.0f))
I used irr::core::equals to make sure it's not too close to 0 and that seemed to fix the issue.