0.9.9 API documenation
rotate_vector.hpp
Go to the documentation of this file.
1 
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_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."
22 #endif
23 
24 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
25 # pragma message("GLM: GLM_GTX_rotate_vector extension included")
26 #endif
27 
28 namespace glm
29 {
32 
40  template<typename T, qualifier Q>
41  GLM_FUNC_DECL vec<3, T, Q> slerp(
42  vec<3, T, Q> const& x,
43  vec<3, T, Q> const& y,
44  T const& a);
45 
48  template<typename T, qualifier Q>
49  GLM_FUNC_DECL vec<2, T, Q> rotate(
50  vec<2, T, Q> const& v,
51  T const& angle);
52 
55  template<typename T, qualifier Q>
56  GLM_FUNC_DECL vec<3, T, Q> rotate(
57  vec<3, T, Q> const& v,
58  T const& angle,
59  vec<3, T, Q> const& normal);
60 
63  template<typename T, qualifier Q>
64  GLM_FUNC_DECL vec<4, T, Q> rotate(
65  vec<4, T, Q> const& v,
66  T const& angle,
67  vec<3, T, Q> const& normal);
68 
71  template<typename T, qualifier Q>
72  GLM_FUNC_DECL vec<3, T, Q> rotateX(
73  vec<3, T, Q> const& v,
74  T const& angle);
75 
78  template<typename T, qualifier Q>
79  GLM_FUNC_DECL vec<3, T, Q> rotateY(
80  vec<3, T, Q> const& v,
81  T const& angle);
82 
85  template<typename T, qualifier Q>
86  GLM_FUNC_DECL vec<3, T, Q> rotateZ(
87  vec<3, T, Q> const& v,
88  T const& angle);
89 
92  template<typename T, qualifier Q>
93  GLM_FUNC_DECL vec<4, T, Q> rotateX(
94  vec<4, T, Q> const& v,
95  T const& angle);
96 
99  template<typename T, qualifier Q>
100  GLM_FUNC_DECL vec<4, T, Q> rotateY(
101  vec<4, T, Q> const& v,
102  T const& angle);
103 
106  template<typename T, qualifier Q>
107  GLM_FUNC_DECL vec<4, T, Q> rotateZ(
108  vec<4, T, Q> const& v,
109  T const& angle);
110 
113  template<typename T, qualifier Q>
114  GLM_FUNC_DECL mat<4, 4, T, Q> orientation(
115  vec<3, T, Q> const& Normal,
116  vec<3, T, Q> const& Up);
117 
119 }//namespace glm
120 
121 #include "rotate_vector.inl"
GLM_FUNC_DECL T angle(tquat< T, Q > const &x)
Returns the quaternion rotation angle.
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.
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.
Definition: common.hpp:20
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< 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 vec< 4, T, Q > rotateY(vec< 4, T, Q > const &v, T const &angle)
Rotate a four dimensional vector around the Y axis.