gtx_functions.cpp 697 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #define GLM_ENABLE_EXPERIMENTAL
  2. #include <glm/gtx/functions.hpp>
  3. #include <glm/ext/vector_float2.hpp>
  4. #include <vector>
  5. static int test_gauss_1d()
  6. {
  7. int Error = 0;
  8. std::vector<float> Result(20);
  9. for(std::size_t i = 0, n = Result.size(); i < n; ++i)
  10. Result[i] = glm::gauss(static_cast<float>(i) * 0.1f, 0.0f, 1.0f);
  11. return Error;
  12. }
  13. static int test_gauss_2d()
  14. {
  15. int Error = 0;
  16. std::vector<float> Result(20);
  17. for(std::size_t i = 0, n = Result.size(); i < n; ++i)
  18. Result[i] = glm::gauss(glm::vec2(static_cast<float>(i)) * 0.1f, glm::vec2(0.0f), glm::vec2(1.0f));
  19. return Error;
  20. }
  21. int main()
  22. {
  23. int Error = 0;
  24. Error += test_gauss_1d();
  25. Error += test_gauss_2d();
  26. return Error;
  27. }