diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index ff610980..f062b0a6 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -603,17 +603,17 @@ namespace detail T qwy(q.w * q.y); T qwz(q.w * q.z); - Result[0][0] = 1 - 2 * (qyy + qzz); - Result[0][1] = 2 * (qxy + qwz); - Result[0][2] = 2 * (qxz - qwy); + Result[0][0] = T(1) - T(2) * (qyy + qzz); + Result[0][1] = T(2) * (qxy + qwz); + Result[0][2] = T(2) * (qxz - qwy); - Result[1][0] = 2 * (qxy - qwz); - Result[1][1] = 1 - 2 * (qxx + qzz); - Result[1][2] = 2 * (qyz + qwx); + Result[1][0] = T(2) * (qxy - qwz); + Result[1][1] = T(1) - T(2) * (qxx + qzz); + Result[1][2] = T(2) * (qyz + qwx); - Result[2][0] = 2 * (qxz + qwy); - Result[2][1] = 2 * (qyz - qwx); - Result[2][2] = 1 - 2 * (qxx + qyy); + Result[2][0] = T(2) * (qxz + qwy); + Result[2][1] = T(2) * (qyz - qwx); + Result[2][2] = T(1) - T(2) * (qxx + qyy); return Result; } diff --git a/readme.md b/readme.md index b08a4448..5b8391d1 100644 --- a/readme.md +++ b/readme.md @@ -104,6 +104,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed strict aliasing warnings #473 - Fixed missing vec1 overload to length2 and distance2 functions #431 - Fixed GLM test '/fp:fast' and '/Za' command-line options are incompatible +- Fixed quaterion to mat3 cast function mat3_cast from GTC_quaternion #542 ##### Deprecation: - Removed GLM_FORCE_SIZE_FUNC define