Platformer in OpenGL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.2 KiB

5 years ago
  1. #define GLM_ENABLE_EXPERIMENTAL
  2. #include <glm/glm.hpp>
  3. #include <glm/gtx/quaternion.hpp>
  4. #include <glm/gtx/easing.hpp>
  5. namespace
  6. {
  7. template<typename T>
  8. void _test_easing()
  9. {
  10. T a = static_cast<T>(0.5);
  11. T r;
  12. r = glm::linearInterpolation(a);
  13. r = glm::quadraticEaseIn(a);
  14. r = glm::quadraticEaseOut(a);
  15. r = glm::quadraticEaseInOut(a);
  16. r = glm::cubicEaseIn(a);
  17. r = glm::cubicEaseOut(a);
  18. r = glm::cubicEaseInOut(a);
  19. r = glm::quarticEaseIn(a);
  20. r = glm::quarticEaseOut(a);
  21. r = glm::quinticEaseInOut(a);
  22. r = glm::sineEaseIn(a);
  23. r = glm::sineEaseOut(a);
  24. r = glm::sineEaseInOut(a);
  25. r = glm::circularEaseIn(a);
  26. r = glm::circularEaseOut(a);
  27. r = glm::circularEaseInOut(a);
  28. r = glm::exponentialEaseIn(a);;
  29. r = glm::exponentialEaseOut(a);
  30. r = glm::exponentialEaseInOut(a);
  31. r = glm::elasticEaseIn(a);
  32. r = glm::elasticEaseOut(a);
  33. r = glm::elasticEaseInOut(a);
  34. r = glm::backEaseIn(a);
  35. r = glm::backEaseOut(a);
  36. r = glm::backEaseInOut(a);
  37. r = glm::bounceEaseIn(a);;
  38. r = glm::bounceEaseOut(a);
  39. r = glm::bounceEaseInOut(a);
  40. }
  41. }
  42. int main()
  43. {
  44. int Error = 0;
  45. _test_easing<float>();
  46. _test_easing<double>();
  47. return Error;
  48. }