0.9.9 API documentation
rotate_vector.hpp
Go to the documentation of this file.
1 
14 #pragma once
15 
16 // Dependency:
17 #include "../gtx/transform.hpp"
18 #include "../gtc/epsilon.hpp"
19 #include "../ext/vector_relational.hpp"
20 #include "../glm.hpp"
21 
22 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
23 # ifndef GLM_ENABLE_EXPERIMENTAL
24 # pragma message("GLM: GLM_GTX_rotate_vector 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.")
25 # else
26 # pragma message("GLM: GLM_GTX_rotate_vector extension included")
27 # endif
28 #endif
29 
30 namespace glm
31 {
34 
42  template<typename T, qualifier Q>
43  GLM_FUNC_DECL vec<3, T, Q> slerp(
44  vec<3, T, Q> const& x,
45  vec<3, T, Q> const& y,
46  T const& a);
47 
50  template<typename T, qualifier Q>
51  GLM_FUNC_DECL vec<2, T, Q> rotate(
52  vec<2, T, Q> const& v,
53  T const& angle);
54 
57  template<typename T, qualifier Q>
58  GLM_FUNC_DECL vec<3, T, Q> rotate(
59  vec<3, T, Q> const& v,
60  T const& angle,
61  vec<3, T, Q> const& normal);
62 
65  template<typename T, qualifier Q>
66  GLM_FUNC_DECL vec<4, T, Q> rotate(
67  vec<4, T, Q> const& v,
68  T const& angle,
69  vec<3, T, Q> const& normal);
70 
73  template<typename T, qualifier Q>
74  GLM_FUNC_DECL vec<3, T, Q> rotateX(
75  vec<3, T, Q> const& v,
76  T const& angle);
77 
80  template<typename T, qualifier Q>
81  GLM_FUNC_DECL vec<3, T, Q> rotateY(
82  vec<3, T, Q> const& v,
83  T const& angle);
84 
87  template<typename T, qualifier Q>
88  GLM_FUNC_DECL vec<3, T, Q> rotateZ(
89  vec<3, T, Q> const& v,
90  T const& angle);
91 
94  template<typename T, qualifier Q>
95  GLM_FUNC_DECL vec<4, T, Q> rotateX(
96  vec<4, T, Q> const& v,
97  T const& angle);
98 
101  template<typename T, qualifier Q>
102  GLM_FUNC_DECL vec<4, T, Q> rotateY(
103  vec<4, T, Q> const& v,
104  T const& angle);
105 
108  template<typename T, qualifier Q>
109  GLM_FUNC_DECL vec<4, T, Q> rotateZ(
110  vec<4, T, Q> const& v,
111  T const& angle);
112 
115  template<typename T, qualifier Q>
116  GLM_FUNC_DECL mat<4, 4, T, Q> orientation(
117  vec<3, T, Q> const& Normal,
118  vec<3, T, Q> const& Up);
119 
121 }//namespace glm
122 
123 #include "rotate_vector.inl"
GLM_FUNC_DECL T angle(qua< T, Q > const &x)
Returns the quaternion rotation angle.
GLM_FUNC_DECL vec< 4, T, Q > rotateZ(vec< 4, T, Q > const &v, T const &angle)
Rotate a four dimensional vector around the Z axis.
GLM_FUNC_DECL vec< 4, T, Q > rotateY(vec< 4, T, Q > const &v, T const &angle)
Rotate a four dimensional vector around the Y axis.
GLM_FUNC_DECL vec< 4, T, Q > rotateX(vec< 4, T, Q > const &v, T const &angle)
Rotate a four dimensional vector around the X axis.
GLM_FUNC_DECL vec< 3, T, Q > slerp(vec< 3, T, Q > const &x, vec< 3, T, Q > const &y, T const &a)
Returns Spherical interpolation between two vectors.
GLM_FUNC_DECL mat< 4, 4, T, Q > orientation(vec< 3, T, Q > const &Normal, vec< 3, T, Q > const &Up)
Build a rotation matrix from a normal and a up vector.
GLM_FUNC_DECL vec< 4, T, Q > rotate(vec< 4, T, Q > const &v, T const &angle, vec< 3, T, Q > const &normal)
Rotate a four dimensional vector around an axis.
Definition: common.hpp:20