Tony-LunarG | b0b195d | 2015-05-13 15:01:06 -0600 | [diff] [blame] | 1 | /////////////////////////////////////////////////////////////////////////////////// |
| 2 | /// OpenGL Mathematics (glm.g-truc.net) |
| 3 | /// |
| 4 | /// Copyright (c) 2005 - 2014 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 | |
| 39 | #ifndef GLM_GTX_transform2 |
| 40 | #define GLM_GTX_transform2 |
| 41 | |
| 42 | // Dependency: |
| 43 | #include "../glm.hpp" |
| 44 | #include "../gtx/transform.hpp" |
| 45 | |
| 46 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) |
| 47 | # pragma message("GLM: GLM_GTX_transform2 extension included") |
| 48 | #endif |
| 49 | |
| 50 | namespace glm |
| 51 | { |
| 52 | /// @addtogroup gtx_transform2 |
| 53 | /// @{ |
| 54 | |
| 55 | //! Transforms a matrix with a shearing on X axis. |
| 56 | //! From GLM_GTX_transform2 extension. |
| 57 | template <typename T, precision P> |
| 58 | GLM_FUNC_DECL detail::tmat3x3<T, P> shearX2D( |
| 59 | detail::tmat3x3<T, P> const & m, |
| 60 | T y); |
| 61 | |
| 62 | //! Transforms a matrix with a shearing on Y axis. |
| 63 | //! From GLM_GTX_transform2 extension. |
| 64 | template <typename T, precision P> |
| 65 | GLM_FUNC_DECL detail::tmat3x3<T, P> shearY2D( |
| 66 | detail::tmat3x3<T, P> const & m, |
| 67 | T x); |
| 68 | |
| 69 | //! Transforms a matrix with a shearing on X axis |
| 70 | //! From GLM_GTX_transform2 extension. |
| 71 | template <typename T, precision P> |
| 72 | GLM_FUNC_DECL detail::tmat4x4<T, P> shearX3D( |
| 73 | const detail::tmat4x4<T, P> & m, |
| 74 | T y, |
| 75 | T z); |
| 76 | |
| 77 | //! Transforms a matrix with a shearing on Y axis. |
| 78 | //! From GLM_GTX_transform2 extension. |
| 79 | template <typename T, precision P> |
| 80 | GLM_FUNC_DECL detail::tmat4x4<T, P> shearY3D( |
| 81 | const detail::tmat4x4<T, P> & m, |
| 82 | T x, |
| 83 | T z); |
| 84 | |
| 85 | //! Transforms a matrix with a shearing on Z axis. |
| 86 | //! From GLM_GTX_transform2 extension. |
| 87 | template <typename T, precision P> |
| 88 | GLM_FUNC_DECL detail::tmat4x4<T, P> shearZ3D( |
| 89 | const detail::tmat4x4<T, P> & m, |
| 90 | T x, |
| 91 | T y); |
| 92 | |
| 93 | //template <typename T> GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> shear(const detail::tmat4x4<T, P> & m, shearPlane, planePoint, angle) |
| 94 | // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 |
| 95 | // - dot(PointOnPlane, normal) * OnPlaneVector 1 |
| 96 | |
| 97 | // Reflect functions seem to don't work |
| 98 | //template <typename T> detail::tmat3x3<T, P> reflect2D(const detail::tmat3x3<T, P> & m, const detail::tvec3<T, P>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) |
| 99 | //template <typename T> detail::tmat4x4<T, P> reflect3D(const detail::tmat4x4<T, P> & m, const detail::tvec3<T, P>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) |
| 100 | |
| 101 | //! Build planar projection matrix along normal axis. |
| 102 | //! From GLM_GTX_transform2 extension. |
| 103 | template <typename T, precision P> |
| 104 | GLM_FUNC_DECL detail::tmat3x3<T, P> proj2D( |
| 105 | const detail::tmat3x3<T, P> & m, |
| 106 | const detail::tvec3<T, P>& normal); |
| 107 | |
| 108 | //! Build planar projection matrix along normal axis. |
| 109 | //! From GLM_GTX_transform2 extension. |
| 110 | template <typename T, precision P> |
| 111 | GLM_FUNC_DECL detail::tmat4x4<T, P> proj3D( |
| 112 | const detail::tmat4x4<T, P> & m, |
| 113 | const detail::tvec3<T, P>& normal); |
| 114 | |
| 115 | //! Build a scale bias matrix. |
| 116 | //! From GLM_GTX_transform2 extension. |
| 117 | template <typename valType, precision P> |
| 118 | GLM_FUNC_DECL detail::tmat4x4<valType, P> scaleBias( |
| 119 | valType scale, |
| 120 | valType bias); |
| 121 | |
| 122 | //! Build a scale bias matrix. |
| 123 | //! From GLM_GTX_transform2 extension. |
| 124 | template <typename valType, precision P> |
| 125 | GLM_FUNC_DECL detail::tmat4x4<valType, P> scaleBias( |
| 126 | detail::tmat4x4<valType, P> const & m, |
| 127 | valType scale, |
| 128 | valType bias); |
| 129 | |
| 130 | /// @} |
| 131 | }// namespace glm |
| 132 | |
| 133 | #include "transform2.inl" |
| 134 | |
| 135 | #endif//GLM_GTX_transform2 |