0.9.9 API documenation
Functions
GLM_GTX_rotate_vector

Function to directly rotate a vector. More...

Functions

template<typename T , qualifier P>
GLM_FUNC_DECL mat< 4, 4, T, P > orientation (vec< 3, T, P > const &Normal, vec< 3, T, P > const &Up)
 Build a rotation matrix from a normal and a up vector. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 2, T, P > rotate (vec< 2, T, P > const &v, T const &angle)
 Rotate a two dimensional vector. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 3, T, P > rotate (vec< 3, T, P > const &v, T const &angle, vec< 3, T, P > const &normal)
 Rotate a three dimensional vector around an axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 4, T, P > rotate (vec< 4, T, P > const &v, T const &angle, vec< 3, T, P > const &normal)
 Rotate a four dimensional vector around an axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 3, T, P > rotateX (vec< 3, T, P > const &v, T const &angle)
 Rotate a three dimensional vector around the X axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 4, T, P > rotateX (vec< 4, T, P > const &v, T const &angle)
 Rotate a four dimensional vector around the X axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 3, T, P > rotateY (vec< 3, T, P > const &v, T const &angle)
 Rotate a three dimensional vector around the Y axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 4, T, P > rotateY (vec< 4, T, P > const &v, T const &angle)
 Rotate a four dimensional vector around the Y axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 3, T, P > rotateZ (vec< 3, T, P > const &v, T const &angle)
 Rotate a three dimensional vector around the Z axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 4, T, P > rotateZ (vec< 4, T, P > const &v, T const &angle)
 Rotate a four dimensional vector around the Z axis. More...
 
template<typename T , qualifier P>
GLM_FUNC_DECL vec< 3, T, P > slerp (vec< 3, T, P > const &x, vec< 3, T, P > const &y, T const &a)
 Returns Spherical interpolation between two vectors. More...
 

Detailed Description

Function to directly rotate a vector.

<glm/gtx/rotate_vector.hpp> need to be included to use these functionalities.

Function Documentation

GLM_FUNC_DECL mat<4, 4, T, P> glm::orientation ( vec< 3, T, P > const &  Normal,
vec< 3, T, P > const &  Up 
)

Build a rotation matrix from a normal and a up vector.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<2, T, P> glm::rotate ( vec< 2, T, P > const &  v,
T const &  angle 
)

Rotate a two dimensional vector.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<3, T, P> glm::rotate ( vec< 3, T, P > const &  v,
T const &  angle,
vec< 3, T, P > const &  normal 
)

Rotate a three dimensional vector around an axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<4, T, P> glm::rotate ( vec< 4, T, P > const &  v,
T const &  angle,
vec< 3, T, P > const &  normal 
)

Rotate a four dimensional vector around an axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<3, T, P> glm::rotateX ( vec< 3, T, P > const &  v,
T const &  angle 
)

Rotate a three dimensional vector around the X axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<4, T, P> glm::rotateX ( vec< 4, T, P > const &  v,
T const &  angle 
)

Rotate a four dimensional vector around the X axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<3, T, P> glm::rotateY ( vec< 3, T, P > const &  v,
T const &  angle 
)

Rotate a three dimensional vector around the Y axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<4, T, P> glm::rotateY ( vec< 4, T, P > const &  v,
T const &  angle 
)

Rotate a four dimensional vector around the Y axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<3, T, P> glm::rotateZ ( vec< 3, T, P > const &  v,
T const &  angle 
)

Rotate a three dimensional vector around the Z axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<4, T, P> glm::rotateZ ( vec< 4, T, P > const &  v,
T const &  angle 
)

Rotate a four dimensional vector around the Z axis.

From GLM_GTX_rotate_vector extension.

GLM_FUNC_DECL vec<3, T, P> glm::slerp ( vec< 3, T, P > const &  x,
vec< 3, T, P > const &  y,
T const &  a 
)

Returns Spherical interpolation between two vectors.

Parameters
xA first vector
yA second vector
aInterpolation factor. The interpolation is defined beyond the range [0, 1].
See also
GLM_GTX_rotate_vector