• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /// @brief Add extra transformation matrices
11 ///
12 /// <glm/gtx/transform2.hpp> need to be included to use these functionalities.
13 
14 #pragma once
15 
16 // Dependency:
17 #include "../glm.hpp"
18 #include "../gtx/transform.hpp"
19 
20 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
21 #	pragma message("GLM: GLM_GTX_transform2 extension included")
22 #endif
23 
24 namespace glm
25 {
26 	/// @addtogroup gtx_transform2
27 	/// @{
28 
29 	//! Transforms a matrix with a shearing on X axis.
30 	//! From GLM_GTX_transform2 extension.
31 	template <typename T, precision P>
32 	GLM_FUNC_DECL tmat3x3<T, P> shearX2D(
33 		tmat3x3<T, P> const & m,
34 		T y);
35 
36 	//! Transforms a matrix with a shearing on Y axis.
37 	//! From GLM_GTX_transform2 extension.
38 	template <typename T, precision P>
39 	GLM_FUNC_DECL tmat3x3<T, P> shearY2D(
40 		tmat3x3<T, P> const & m,
41 		T x);
42 
43 	//! Transforms a matrix with a shearing on X axis
44 	//! From GLM_GTX_transform2 extension.
45 	template <typename T, precision P>
46 	GLM_FUNC_DECL tmat4x4<T, P> shearX3D(
47 		const tmat4x4<T, P> & m,
48 		T y,
49 		T z);
50 
51 	//! Transforms a matrix with a shearing on Y axis.
52 	//! From GLM_GTX_transform2 extension.
53 	template <typename T, precision P>
54 	GLM_FUNC_DECL tmat4x4<T, P> shearY3D(
55 		const tmat4x4<T, P> & m,
56 		T x,
57 		T z);
58 
59 	//! Transforms a matrix with a shearing on Z axis.
60 	//! From GLM_GTX_transform2 extension.
61 	template <typename T, precision P>
62 	GLM_FUNC_DECL tmat4x4<T, P> shearZ3D(
63 		const tmat4x4<T, P> & m,
64 		T x,
65 		T y);
66 
67 	//template <typename T> GLM_FUNC_QUALIFIER tmat4x4<T, P> shear(const tmat4x4<T, P> & m, shearPlane, planePoint, angle)
68 	// Identity + tan(angle) * cross(Normal, OnPlaneVector)     0
69 	// - dot(PointOnPlane, normal) * OnPlaneVector              1
70 
71 	// Reflect functions seem to don't work
72 	//template <typename T> tmat3x3<T, P> reflect2D(const tmat3x3<T, P> & m, const tvec3<T, P>& normal){return reflect2DGTX(m, normal);}									//!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
73 	//template <typename T> tmat4x4<T, P> reflect3D(const tmat4x4<T, P> & m, const tvec3<T, P>& normal){return reflect3DGTX(m, normal);}									//!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
74 
75 	//! Build planar projection matrix along normal axis.
76 	//! From GLM_GTX_transform2 extension.
77 	template <typename T, precision P>
78 	GLM_FUNC_DECL tmat3x3<T, P> proj2D(
79 		const tmat3x3<T, P> & m,
80 		const tvec3<T, P>& normal);
81 
82 	//! Build planar projection matrix along normal axis.
83 	//! From GLM_GTX_transform2 extension.
84 	template <typename T, precision P>
85 	GLM_FUNC_DECL tmat4x4<T, P> proj3D(
86 		const tmat4x4<T, P> & m,
87 		const tvec3<T, P>& normal);
88 
89 	//! Build a scale bias matrix.
90 	//! From GLM_GTX_transform2 extension.
91 	template <typename valType, precision P>
92 	GLM_FUNC_DECL tmat4x4<valType, P> scaleBias(
93 		valType scale,
94 		valType bias);
95 
96 	//! Build a scale bias matrix.
97 	//! From GLM_GTX_transform2 extension.
98 	template <typename valType, precision P>
99 	GLM_FUNC_DECL tmat4x4<valType, P> scaleBias(
100 		tmat4x4<valType, P> const & m,
101 		valType scale,
102 		valType bias);
103 
104 	/// @}
105 }// namespace glm
106 
107 #include "transform2.inl"
108