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_euler_angles
24 /// @file glm/gtx/euler_angles.hpp
25 /// @date 2005-12-21 / 2011-06-07
26 /// @author Christophe Riccio
27 ///
28 /// @see core (dependence)
29 /// @see gtc_half_float (dependence)
30 ///
31 /// @defgroup gtx_euler_angles GLM_GTX_euler_angles
32 /// @ingroup gtx
33 ///
34 /// @brief Build matrices from Euler angles.
35 ///
36 /// <glm/gtx/euler_angles.hpp> need to be included to use these functionalities.
37 ///////////////////////////////////////////////////////////////////////////////////
38 
39 #ifndef GLM_GTX_euler_angles
40 #define GLM_GTX_euler_angles
41 
42 // Dependency:
43 #include "../glm.hpp"
44 
45 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
46 #	pragma message("GLM: GLM_GTX_euler_angles extension included")
47 #endif
48 
49 namespace glm
50 {
51 	/// @addtogroup gtx_euler_angles
52 	/// @{
53 
54 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X.
55 	/// @see gtx_euler_angles
56 	template <typename T>
57 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleX(
58 		T const & angleX);
59 
60 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y.
61 	/// @see gtx_euler_angles
62 	template <typename T>
63 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleY(
64 		T const & angleY);
65 
66 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z.
67 	/// @see gtx_euler_angles
68 	template <typename T>
69 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleZ(
70 		T const & angleZ);
71 
72 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y).
73 	/// @see gtx_euler_angles
74 	template <typename T>
75 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleXY(
76 		T const & angleX,
77 		T const & angleY);
78 
79 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X).
80 	/// @see gtx_euler_angles
81 	template <typename T>
82 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleYX(
83 		T const & angleY,
84 		T const & angleX);
85 
86 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z).
87 	/// @see gtx_euler_angles
88 	template <typename T>
89 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleXZ(
90 		T const & angleX,
91 		T const & angleZ);
92 
93 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X).
94 	/// @see gtx_euler_angles
95 	template <typename T>
96 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleZX(
97 		T const & angle,
98 		T const & angleX);
99 
100 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z).
101 	/// @see gtx_euler_angles
102 	template <typename T>
103 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleYZ(
104 		T const & angleY,
105 		T const & angleZ);
106 
107 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y).
108 	/// @see gtx_euler_angles
109 	template <typename T>
110 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleZY(
111 		T const & angleZ,
112 		T const & angleY);
113 
114 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
115 	/// @see gtx_euler_angles
116 	template <typename T>
117 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleYXZ(
118 		T const & yaw,
119 		T const & pitch,
120 		T const & roll);
121 
122 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
123 	/// @see gtx_euler_angles
124 	template <typename T>
125 	GLM_FUNC_DECL detail::tmat4x4<T, defaultp> yawPitchRoll(
126 		T const & yaw,
127 		T const & pitch,
128 		T const & roll);
129 
130 	/// Creates a 2D 2 * 2 rotation matrix from an euler angle.
131 	/// @see gtx_euler_angles
132 	template <typename T>
133 	GLM_FUNC_DECL detail::tmat2x2<T, defaultp> orientate2(T const & angle);
134 
135 	/// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle.
136 	/// @see gtx_euler_angles
137 	template <typename T>
138 	GLM_FUNC_DECL detail::tmat3x3<T, defaultp> orientate3(T const & angle);
139 
140 	/// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z).
141 	/// @see gtx_euler_angles
142 	template <typename T, precision P>
143 	GLM_FUNC_DECL detail::tmat3x3<T, P> orientate3(detail::tvec3<T, P> const & angles);
144 
145 	/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
146 	/// @see gtx_euler_angles
147 	template <typename T, precision P>
148 	GLM_FUNC_DECL detail::tmat4x4<T, P> orientate4(detail::tvec3<T, P> const & angles);
149 
150 	/// @}
151 }//namespace glm
152 
153 #include "euler_angles.inl"
154 
155 #endif//GLM_GTX_euler_angles
156