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.

135 lines
4.7 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_transform2
  24. /// @file glm/gtx/transform2.hpp
  25. /// @date 2005-12-21 / 2011-06-07
  26. /// @author Christophe Riccio
  27. ///
  28. /// @see core (dependence)
  29. /// @see gtx_transform (dependence)
  30. ///
  31. /// @defgroup gtx_transform2 GLM_GTX_transform2
  32. /// @ingroup gtx
  33. ///
  34. /// @brief Add extra transformation matrices
  35. ///
  36. /// <glm/gtx/transform2.hpp> need to be included to use these functionalities.
  37. ///////////////////////////////////////////////////////////////////////////////////
  38. #ifndef GLM_GTX_transform2
  39. #define GLM_GTX_transform2 GLM_VERSION
  40. // Dependency:
  41. #include "../glm.hpp"
  42. #include "../gtx/transform.hpp"
  43. #if(defined(GLM_MESSAGES) && !defined(glm_ext))
  44. # pragma message("GLM: GLM_GTX_transform2 extension included")
  45. #endif
  46. namespace glm
  47. {
  48. /// @addtogroup gtx_transform2
  49. /// @{
  50. //! Transforms a matrix with a shearing on X axis.
  51. //! From GLM_GTX_transform2 extension.
  52. template <typename T>
  53. detail::tmat3x3<T> shearX2D(
  54. detail::tmat3x3<T> const & m,
  55. T y);
  56. //! Transforms a matrix with a shearing on Y axis.
  57. //! From GLM_GTX_transform2 extension.
  58. template <typename T>
  59. detail::tmat3x3<T> shearY2D(
  60. detail::tmat3x3<T> const & m,
  61. T x);
  62. //! Transforms a matrix with a shearing on X axis
  63. //! From GLM_GTX_transform2 extension.
  64. template <typename T>
  65. detail::tmat4x4<T> shearX3D(
  66. const detail::tmat4x4<T> & m,
  67. T y,
  68. T z);
  69. //! Transforms a matrix with a shearing on Y axis.
  70. //! From GLM_GTX_transform2 extension.
  71. template <typename T>
  72. detail::tmat4x4<T> shearY3D(
  73. const detail::tmat4x4<T> & m,
  74. T x,
  75. T z);
  76. //! Transforms a matrix with a shearing on Z axis.
  77. //! From GLM_GTX_transform2 extension.
  78. template <typename T>
  79. detail::tmat4x4<T> shearZ3D(
  80. const detail::tmat4x4<T> & m,
  81. T x,
  82. T y);
  83. //template <typename T> GLM_FUNC_QUALIFIER detail::tmat4x4<T> shear(const detail::tmat4x4<T> & m, shearPlane, planePoint, angle)
  84. // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0
  85. // - dot(PointOnPlane, normal) * OnPlaneVector 1
  86. // Reflect functions seem to don't work
  87. //template <typename T> detail::tmat3x3<T> reflect2D(const detail::tmat3x3<T> & m, const detail::tvec3<T>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
  88. //template <typename T> detail::tmat4x4<T> reflect3D(const detail::tmat4x4<T> & m, const detail::tvec3<T>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
  89. //! Build planar projection matrix along normal axis.
  90. //! From GLM_GTX_transform2 extension.
  91. template <typename T>
  92. detail::tmat3x3<T> proj2D(
  93. const detail::tmat3x3<T> & m,
  94. const detail::tvec3<T>& normal);
  95. //! Build planar projection matrix along normal axis.
  96. //! From GLM_GTX_transform2 extension.
  97. template <typename T>
  98. detail::tmat4x4<T> proj3D(
  99. const detail::tmat4x4<T> & m,
  100. const detail::tvec3<T>& normal);
  101. //! Build a scale bias matrix.
  102. //! From GLM_GTX_transform2 extension.
  103. template <typename valType>
  104. detail::tmat4x4<valType> scaleBias(
  105. valType scale,
  106. valType bias);
  107. //! Build a scale bias matrix.
  108. //! From GLM_GTX_transform2 extension.
  109. template <typename valType>
  110. detail::tmat4x4<valType> scaleBias(
  111. detail::tmat4x4<valType> const & m,
  112. valType scale,
  113. valType bias);
  114. /// @}
  115. }// namespace glm
  116. #include "transform2.inl"
  117. #endif//GLM_GTX_transform2