diff --git a/test/gtc/gtc_matrix_inverse.cpp b/test/gtc/gtc_matrix_inverse.cpp index d9615d5b..88225a26 100644 --- a/test/gtc/gtc_matrix_inverse.cpp +++ b/test/gtc/gtc_matrix_inverse.cpp @@ -30,10 +30,53 @@ /////////////////////////////////////////////////////////////////////////////////// #include +#include + +int test_affine() +{ + int Error = 0; + + { + glm::mat3 const M( + 2.f, 0.f, 0.f, + 0.f, 2.f, 0.f, + 0.f, 0.f, 1.f); + + glm::mat3 const A = glm::affineInverse(M); + glm::mat3 const I = glm::inverse(M); + + glm::mat3 const R = glm::affineInverse(A); + + Error += M != A; + Error += M == R; + Error += A == I; + } + + { + glm::mat4 const M( + 2.f, 0.f, 0.f, 0.f, + 0.f, 2.f, 0.f, 0.f, + 0.f, 0.f, 2.f, 0.f, + 0.f, 0.f, 0.f, 1.f); + + glm::mat4 const A = glm::affineInverse(M); + glm::mat4 const I = glm::inverse(M); + + glm::mat4 const R = glm::affineInverse(A); + + Error += M != A; + Error += M == R; + Error += A == I; + } + + return Error; +} int main() { int Error = 0; + Error += test_affine(); + return Error; }