Skip to content

Commit

Permalink
Merge pull request #542 from patrikhuber/fix-quaternion-typeconversion
Browse files Browse the repository at this point in the history
Convert integers to type T in quaternion mat3_cast() #542
  • Loading branch information
Groovounet committed Aug 17, 2016
2 parents c947b33 + d08618c commit c54714d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions glm/gtc/quaternion.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c54714d

Please sign in to comment.