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.

156 lines
5.3 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. /// THE SOFTWARE.
  22. ///
  23. /// @ref gtx_euler_angles
  24. /// @file glm/gtx/euler_angles.hpp
  25. /// @date 2005-12-21 / 2011-06-07
  26. /// @author Christophe Riccio
  27. ///
  28. /// @see core (dependence)
  29. /// @see gtc_half_float (dependence)
  30. ///
  31. /// @defgroup gtx_euler_angles GLM_GTX_euler_angles
  32. /// @ingroup gtx
  33. ///
  34. /// @brief Build matrices from Euler angles.
  35. ///
  36. /// <glm/gtx/euler_angles.hpp> need to be included to use these functionalities.
  37. ///////////////////////////////////////////////////////////////////////////////////
  38. #ifndef GLM_GTX_euler_angles
  39. #define GLM_GTX_euler_angles GLM_VERSION
  40. // Dependency:
  41. #include "../glm.hpp"
  42. #include "../gtc/half_float.hpp"
  43. #if(defined(GLM_MESSAGES) && !defined(glm_ext))
  44. # pragma message("GLM: GLM_GTX_euler_angles extension included")
  45. #endif
  46. namespace glm
  47. {
  48. /// @addtogroup gtx_euler_angles
  49. /// @{
  50. /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X.
  51. /// @see gtx_euler_angles
  52. template <typename valType>
  53. detail::tmat4x4<valType> eulerAngleX(
  54. valType const & angleX);
  55. /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y.
  56. /// @see gtx_euler_angles
  57. template <typename valType>
  58. detail::tmat4x4<valType> eulerAngleY(
  59. valType const & angleY);
  60. /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z.
  61. /// @see gtx_euler_angles
  62. template <typename valType>
  63. detail::tmat4x4<valType> eulerAngleZ(
  64. valType const & angleZ);
  65. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y).
  66. /// @see gtx_euler_angles
  67. template <typename valType>
  68. detail::tmat4x4<valType> eulerAngleXY(
  69. valType const & angleX,
  70. valType const & angleY);
  71. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X).
  72. /// @see gtx_euler_angles
  73. template <typename valType>
  74. detail::tmat4x4<valType> eulerAngleYX(
  75. valType const & angleY,
  76. valType const & angleX);
  77. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z).
  78. /// @see gtx_euler_angles
  79. template <typename valType>
  80. detail::tmat4x4<valType> eulerAngleXZ(
  81. valType const & angleX,
  82. valType const & angleZ);
  83. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X).
  84. /// @see gtx_euler_angles
  85. template <typename valType>
  86. detail::tmat4x4<valType> eulerAngleZX(
  87. valType const & angleZ,
  88. valType const & angleX);
  89. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z).
  90. /// @see gtx_euler_angles
  91. template <typename valType>
  92. detail::tmat4x4<valType> eulerAngleYZ(
  93. valType const & angleY,
  94. valType const & angleZ);
  95. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y).
  96. /// @see gtx_euler_angles
  97. template <typename valType>
  98. detail::tmat4x4<valType> eulerAngleZY(
  99. valType const & angleZ,
  100. valType const & angleY);
  101. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
  102. /// @see gtx_euler_angles
  103. template <typename valType>
  104. detail::tmat4x4<valType> eulerAngleYXZ(
  105. valType const & yaw,
  106. valType const & pitch,
  107. valType const & roll);
  108. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
  109. /// @see gtx_euler_angles
  110. template <typename valType>
  111. detail::tmat4x4<valType> yawPitchRoll(
  112. valType const & yaw,
  113. valType const & pitch,
  114. valType const & roll);
  115. /// Creates a 2D 2 * 2 rotation matrix from an euler angle.
  116. /// @see gtx_euler_angles
  117. template <typename T>
  118. detail::tmat2x2<T> orientate2(T const & angle);
  119. /// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle.
  120. /// @see gtx_euler_angles
  121. template <typename T>
  122. detail::tmat3x3<T> orientate3(T const & angle);
  123. /// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z).
  124. /// @see gtx_euler_angles
  125. template <typename T>
  126. detail::tmat3x3<T> orientate3(detail::tvec3<T> const & angles);
  127. /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
  128. /// @see gtx_euler_angles
  129. template <typename T>
  130. detail::tmat4x4<T> orientate4(detail::tvec3<T> const & angles);
  131. /// @}
  132. }//namespace glm
  133. #include "euler_angles.inl"
  134. #endif//GLM_GTX_euler_angles