diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-12-13 10:33:35 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-12-13 10:33:35 +0300 |
commit | ef2aecf2db981b5344e0d14e7f074f1742b0b2f7 (patch) | |
tree | d016e95050f10eda7bc44e1bdfa2f7c4fc0fc024 /intern/moto/include/MT_Matrix3x3.inl | |
parent | cf8980559fdc2e9731d9229512a554212173ea4f (diff) | |
parent | d9ee88d126ddb59b68d2561694b522a99e4923b6 (diff) |
Merge branch 'master' into GPencil_Editing_Stage3GPencil_Editing_Stage3
Diffstat (limited to 'intern/moto/include/MT_Matrix3x3.inl')
-rw-r--r-- | intern/moto/include/MT_Matrix3x3.inl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/intern/moto/include/MT_Matrix3x3.inl b/intern/moto/include/MT_Matrix3x3.inl index c581640ebfe..088c4b098c8 100644 --- a/intern/moto/include/MT_Matrix3x3.inl +++ b/intern/moto/include/MT_Matrix3x3.inl @@ -7,11 +7,11 @@ GEN_INLINE MT_Quaternion MT_Matrix3x3::getRotation() const { MT_Scalar trace = m_el[0][0] + m_el[1][1] + m_el[2][2]; - if (trace > 0.0) + if (trace > 0.0f) { - MT_Scalar s = sqrt(trace + MT_Scalar(1.0)); - result[3] = s * MT_Scalar(0.5); - s = MT_Scalar(0.5) / s; + MT_Scalar s = sqrt(trace + MT_Scalar(1.0f)); + result[3] = s * MT_Scalar(0.5f); + s = MT_Scalar(0.5f) / s; result[0] = (m_el[2][1] - m_el[1][2]) * s; result[1] = (m_el[0][2] - m_el[2][0]) * s; @@ -28,11 +28,11 @@ GEN_INLINE MT_Quaternion MT_Matrix3x3::getRotation() const { int j = next[i]; int k = next[j]; - MT_Scalar s = sqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + MT_Scalar(1.0)); + MT_Scalar s = sqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + MT_Scalar(1.0f)); - result[i] = s * MT_Scalar(0.5); + result[i] = s * MT_Scalar(0.5f); - s = MT_Scalar(0.5) / s; + s = MT_Scalar(0.5f) / s; result[3] = (m_el[k][j] - m_el[j][k]) * s; result[j] = (m_el[j][i] + m_el[i][j]) * s; @@ -80,7 +80,7 @@ GEN_INLINE MT_Matrix3x3 MT_Matrix3x3::inverse() const { MT_Vector3 co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1)); MT_Scalar det = MT_dot((*this)[0], co); MT_assert(!MT_fuzzyZero2(det)); - MT_Scalar s = MT_Scalar(1.0) / det; + MT_Scalar s = MT_Scalar(1.0f) / det; return MT_Matrix3x3(co[0] * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s, co[1] * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s, |