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.

131 lines
4.9 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_transform
  24. /// @file glm/gtx/transform.hpp
  25. /// @date 2005-12-21 / 2011-06-07
  26. /// @author Christophe Riccio
  27. ///
  28. /// @see core (dependence)
  29. /// @see gtc_matrix_transform (dependence)
  30. /// @see gtx_transform
  31. /// @see gtx_transform2
  32. ///
  33. /// @defgroup gtx_transform GLM_GTX_transform
  34. /// @ingroup gtx
  35. ///
  36. /// @brief Add transformation matrices
  37. ///
  38. /// <glm/gtx/transform.hpp> need to be included to use these functionalities.
  39. ///////////////////////////////////////////////////////////////////////////////////
  40. #ifndef GLM_GTX_transform
  41. #define GLM_GTX_transform GLM_VERSION
  42. // Dependency:
  43. #include "../glm.hpp"
  44. #include "../gtc/matrix_transform.hpp"
  45. #if(defined(GLM_MESSAGES) && !defined(glm_ext))
  46. # pragma message("GLM: GLM_GTX_transform extension included")
  47. #endif
  48. namespace glm
  49. {
  50. /// @addtogroup gtx_transform
  51. /// @{
  52. //! Builds a translation 4 * 4 matrix created from 3 scalars.
  53. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  54. // - See also: \link glm::translate GLM_GTC_matrix_transform \endlink
  55. template <typename T>
  56. detail::tmat4x4<T> translate(
  57. T x, T y, T z);
  58. //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.
  59. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  60. // - See also: \link glm::translate GLM_GTC_matrix_transform \endlink
  61. template <typename T>
  62. detail::tmat4x4<T> translate(
  63. detail::tmat4x4<T> const & m,
  64. T x, T y, T z);
  65. //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.
  66. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  67. // - See also: \link glm::translate GLM_GTC_matrix_transform \endlink
  68. template <typename T>
  69. detail::tmat4x4<T> translate(
  70. detail::tvec3<T> const & v);
  71. //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
  72. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  73. // - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink
  74. template <typename T>
  75. detail::tmat4x4<T> rotate(
  76. T angle,
  77. T x, T y, T z);
  78. //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
  79. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  80. // - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink
  81. template <typename T>
  82. detail::tmat4x4<T> rotate(
  83. T angle,
  84. detail::tvec3<T> const & v);
  85. //! Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
  86. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  87. // - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink
  88. template <typename T>
  89. detail::tmat4x4<T> rotate(
  90. detail::tmat4x4<T> const & m,
  91. T angle,
  92. T x, T y, T z);
  93. //! Builds a scale 4 * 4 matrix created from 3 scalars.
  94. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  95. // - See also: \link glm::scale GLM_GTC_matrix_transform \endlink
  96. template <typename T>
  97. detail::tmat4x4<T> scale(
  98. T x, T y, T z);
  99. //! Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars.
  100. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  101. // - See also: \link glm::scale GLM_GTC_matrix_transform \endlink
  102. template <typename T>
  103. detail::tmat4x4<T> scale(
  104. detail::tmat4x4<T> const & m,
  105. T x, T y, T z);
  106. //! Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components.
  107. //! - From \link gtx_transform GLM_GTX_transform \endlink extension
  108. // - See also: \link glm::scale GLM_GTC_matrix_transform \endlink
  109. template <typename T>
  110. detail::tmat4x4<T> scale(
  111. detail::tvec3<T> const & v);
  112. /// @}
  113. }// namespace glm
  114. #include "transform.inl"
  115. #endif//GLM_GTX_transform