Merge pull request #767 from jimvonmoon/extract_euler_angle_fix

Fixed potential narrowing conversion in extractEulerAngleXYZ #767
This commit is contained in:
Christophe 2018-05-28 09:44:27 +02:00 committed by GitHub
commit 20b3f4bd42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -700,12 +700,12 @@ namespace glm
T & t2,
T & t3)
{
float T1 = glm::atan2<T, defaultp>(M[2][1], M[2][2]);
float C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]);
float T2 = glm::atan2<T, defaultp>(-M[2][0], C2);
float S1 = glm::sin(T1);
float C1 = glm::cos(T1);
float T3 = glm::atan2<T, defaultp>(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]);
T T1 = glm::atan2<T, defaultp>(M[2][1], M[2][2]);
T C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]);
T T2 = glm::atan2<T, defaultp>(-M[2][0], C2);
T S1 = glm::sin(T1);
T C1 = glm::cos(T1);
T T3 = glm::atan2<T, defaultp>(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]);
t1 = -T1;
t2 = -T2;
t3 = -T3;