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.

90 lines
2.3 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2005-12-21
  5. // Updated : 2009-04-29
  6. // Licence : This source is under MIT License
  7. // File : glm/gtx/transform.inl
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. namespace glm
  10. {
  11. template <typename T>
  12. GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate(
  13. T x, T y, T z)
  14. {
  15. return translate(
  16. detail::tmat4x4<T>(1.0f),
  17. detail::tvec3<T>(x, y , z));
  18. }
  19. template <typename T>
  20. GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate(
  21. detail::tmat4x4<T> const & m,
  22. T x, T y, T z)
  23. {
  24. return translate(
  25. m, detail::tvec3<T>(x, y , z));
  26. }
  27. template <typename T>
  28. GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate(
  29. detail::tvec3<T> const & v)
  30. {
  31. return translate(
  32. detail::tmat4x4<T>(1.0f), v);
  33. }
  34. template <typename T>
  35. GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate(
  36. T angle,
  37. T x, T y, T z)
  38. {
  39. return rotate(
  40. detail::tmat4x4<T>(1), angle, detail::tvec3<T>(x, y, z));
  41. }
  42. template <typename T>
  43. GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate(
  44. T angle,
  45. detail::tvec3<T> const & v)
  46. {
  47. return rotate(
  48. detail::tmat4x4<T>(1), angle, v);
  49. }
  50. template <typename T>
  51. GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate(
  52. detail::tmat4x4<T> const & m,
  53. T angle,
  54. T x, T y, T z)
  55. {
  56. return rotate(
  57. m, angle, detail::tvec3<T>(x, y, z));
  58. }
  59. template <typename T>
  60. GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale(T x, T y, T z)
  61. {
  62. return scale(
  63. detail::tmat4x4<T>(1), detail::tvec3<T>(x, y, z));
  64. }
  65. template <typename T>
  66. GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale(
  67. detail::tmat4x4<T> const & m,
  68. T x, T y, T z)
  69. {
  70. return scale(
  71. m, detail::tvec3<T>(x, y, z));
  72. }
  73. template <typename T>
  74. GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale(
  75. detail::tvec3<T> const & v)
  76. {
  77. return scale(
  78. detail::tmat4x4<T>(1.0f), v);
  79. }
  80. }//namespace glm