Added tests for affineInverse #192

master
Christophe Riccio ago%!(EXTRA string=10 years)
parent e37fe66d5e
commit f384e18a78
  1. 43
      test/gtc/gtc_matrix_inverse.cpp

@ -30,10 +30,53 @@
///////////////////////////////////////////////////////////////////////////////////
#include <glm/gtc/matrix_inverse.hpp>
#include <glm/gtc/epsilon.hpp>
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;
}

Loading…
Cancel
Save