gtx_easing.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. static void _test_easing()
  9. {
  10. T a = static_cast<T>(0.5);
  11. T r;
  12. r = glm::linearInterpolation(a);
  13. (void)r;
  14. r = glm::quadraticEaseIn(a);
  15. (void)r;
  16. r = glm::quadraticEaseOut(a);
  17. (void)r;
  18. r = glm::quadraticEaseInOut(a);
  19. (void)r;
  20. r = glm::cubicEaseIn(a);
  21. (void)r;
  22. r = glm::cubicEaseOut(a);
  23. (void)r;
  24. r = glm::cubicEaseInOut(a);
  25. (void)r;
  26. r = glm::quarticEaseIn(a);
  27. (void)r;
  28. r = glm::quarticEaseOut(a);
  29. (void)r;
  30. r = glm::quinticEaseInOut(a);
  31. (void)r;
  32. r = glm::sineEaseIn(a);
  33. (void)r;
  34. r = glm::sineEaseOut(a);
  35. (void)r;
  36. r = glm::sineEaseInOut(a);
  37. (void)r;
  38. r = glm::circularEaseIn(a);
  39. (void)r;
  40. r = glm::circularEaseOut(a);
  41. (void)r;
  42. r = glm::circularEaseInOut(a);
  43. (void)r;
  44. r = glm::exponentialEaseIn(a);
  45. (void)r;
  46. r = glm::exponentialEaseOut(a);
  47. (void)r;
  48. r = glm::exponentialEaseInOut(a);
  49. (void)r;
  50. r = glm::elasticEaseIn(a);
  51. (void)r;
  52. r = glm::elasticEaseOut(a);
  53. (void)r;
  54. r = glm::elasticEaseInOut(a);
  55. (void)r;
  56. r = glm::backEaseIn(a);
  57. (void)r;
  58. r = glm::backEaseOut(a);
  59. (void)r;
  60. r = glm::backEaseInOut(a);
  61. (void)r;
  62. r = glm::bounceEaseIn(a);
  63. (void)r;
  64. r = glm::bounceEaseOut(a);
  65. (void)r;
  66. r = glm::bounceEaseInOut(a);
  67. (void)r;
  68. }
  69. }
  70. int main()
  71. {
  72. int Error = 0;
  73. _test_easing<float>();
  74. _test_easing<double>();
  75. return Error;
  76. }