ext_matrix_transform.cpp 561 B

1234567891011121314151617181920212223242526272829
  1. #include <glm/ext/matrix_relational.hpp>
  2. #include <glm/ext/matrix_transform.hpp>
  3. #include <glm/ext/matrix_float4x4.hpp>
  4. #include <glm/ext/vector_relational.hpp>
  5. #include <glm/ext/vector_float4.hpp>
  6. #include <glm/ext/vector_float3.hpp>
  7. static int test_translate()
  8. {
  9. int Error = 0;
  10. glm::mat4 const M(1.0f);
  11. glm::vec3 const V(1.0f);
  12. glm::mat4 const T = glm::translate(M, V);
  13. Error += glm::all(glm::equal(T[3], glm::vec4(1.0f), glm::epsilon<float>())) ? 0 : 1;
  14. return Error;
  15. }
  16. int main()
  17. {
  18. int Error = 0;
  19. Error += test_translate();
  20. return Error;
  21. }