| 1 | /// @ref gtx_transform2 |
| 2 | /// @file glm/gtx/transform2.hpp |
| 3 | /// |
| 4 | /// @see core (dependence) |
| 5 | /// @see gtx_transform (dependence) |
| 6 | /// |
| 7 | /// @defgroup gtx_transform2 GLM_GTX_transform2 |
| 8 | /// @ingroup gtx |
| 9 | /// |
| 10 | /// Include <glm/gtx/transform2.hpp> to use the features of this extension. |
| 11 | /// |
| 12 | /// Add extra transformation matrices |
| 13 | |
| 14 | #pragma once |
| 15 | |
| 16 | // Dependency: |
| 17 | #include "../glm.hpp" |
| 18 | #include "../gtx/transform.hpp" |
| 19 | |
| 20 | #ifndef GLM_ENABLE_EXPERIMENTAL |
| 21 | # error "GLM: GLM_GTX_transform2 is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." |
| 22 | #endif |
| 23 | |
| 24 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) |
| 25 | # pragma message("GLM: GLM_GTX_transform2 extension included") |
| 26 | #endif |
| 27 | |
| 28 | namespace glm |
| 29 | { |
| 30 | /// @addtogroup gtx_transform2 |
| 31 | /// @{ |
| 32 | |
| 33 | //! Transforms a matrix with a shearing on X axis. |
| 34 | //! From GLM_GTX_transform2 extension. |
| 35 | template<typename T, qualifier Q> |
| 36 | GLM_FUNC_DECL mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T y); |
| 37 | |
| 38 | //! Transforms a matrix with a shearing on Y axis. |
| 39 | //! From GLM_GTX_transform2 extension. |
| 40 | template<typename T, qualifier Q> |
| 41 | GLM_FUNC_DECL mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T x); |
| 42 | |
| 43 | //! Transforms a matrix with a shearing on X axis |
| 44 | //! From GLM_GTX_transform2 extension. |
| 45 | template<typename T, qualifier Q> |
| 46 | GLM_FUNC_DECL mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T y, T z); |
| 47 | |
| 48 | //! Transforms a matrix with a shearing on Y axis. |
| 49 | //! From GLM_GTX_transform2 extension. |
| 50 | template<typename T, qualifier Q> |
| 51 | GLM_FUNC_DECL mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T x, T z); |
| 52 | |
| 53 | //! Transforms a matrix with a shearing on Z axis. |
| 54 | //! From GLM_GTX_transform2 extension. |
| 55 | template<typename T, qualifier Q> |
| 56 | GLM_FUNC_DECL mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T x, T y); |
| 57 | |
| 58 | //template<typename T> GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(const mat<4, 4, T, Q> & m, shearPlane, planePoint, angle) |
| 59 | // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 |
| 60 | // - dot(PointOnPlane, normal) * OnPlaneVector 1 |
| 61 | |
| 62 | // Reflect functions seem to don't work |
| 63 | //template<typename T> mat<3, 3, T, Q> reflect2D(const mat<3, 3, T, Q> & m, const vec<3, T, Q>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) |
| 64 | //template<typename T> mat<4, 4, T, Q> reflect3D(const mat<4, 4, T, Q> & m, const vec<3, T, Q>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) |
| 65 | |
| 66 | //! Build planar projection matrix along normal axis. |
| 67 | //! From GLM_GTX_transform2 extension. |
| 68 | template<typename T, qualifier Q> |
| 69 | GLM_FUNC_DECL mat<3, 3, T, Q> proj2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal); |
| 70 | |
| 71 | //! Build planar projection matrix along normal axis. |
| 72 | //! From GLM_GTX_transform2 extension. |
| 73 | template<typename T, qualifier Q> |
| 74 | GLM_FUNC_DECL mat<4, 4, T, Q> proj3D(mat<4, 4, T, Q> const & m, vec<3, T, Q> const& normal); |
| 75 | |
| 76 | //! Build a scale bias matrix. |
| 77 | //! From GLM_GTX_transform2 extension. |
| 78 | template<typename T, qualifier Q> |
| 79 | GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(T scale, T bias); |
| 80 | |
| 81 | //! Build a scale bias matrix. |
| 82 | //! From GLM_GTX_transform2 extension. |
| 83 | template<typename T, qualifier Q> |
| 84 | GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias); |
| 85 | |
| 86 | /// @} |
| 87 | }// namespace glm |
| 88 | |
| 89 | #include "transform2.inl" |