2 KB、58行 生 Blame 履歴
1/// @ref gtx_matrix_interpolation
2/// @file glm/gtx/matrix_interpolation.hpp
3/// @author Ghenadii Ursachi (the.asteroth@gmail.com)
4///
5/// @see core (dependence)
6///
7/// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation
8/// @ingroup gtx
9///
10/// Include <glm/gtx/matrix_interpolation.hpp> to use the features of this extension.
11///
12/// Allows to directly interpolate two matrices.
13
14#pragma once
15
16// Dependency:
17#include "../glm.hpp"
18
19#ifndef GLM_ENABLE_EXPERIMENTAL
20# error "GLM: GLM_GTX_matrix_interpolation 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."
21#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
22# pragma message("GLM: GLM_GTX_matrix_interpolation extension included")
23#endif
24
25namespace glm
26{
27 /// @addtogroup gtx_matrix_interpolation
28 /// @{
29
30 /// Get the axis and angle of the rotation from a matrix.
31 /// From GLM_GTX_matrix_interpolation extension.
32 template<typename T, qualifier Q>
33 GLM_FUNC_DISCARD_DECL void axisAngle(
34 mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle);
35
36 /// Build a matrix from axis and angle.
37 /// From GLM_GTX_matrix_interpolation extension.
38 template<typename T, qualifier Q>
39 GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix(
40 vec<3, T, Q> const& Axis, T const Angle);
41
42 /// Extracts the rotation part of a matrix.
43 /// From GLM_GTX_matrix_interpolation extension.
44 template<typename T, qualifier Q>
45 GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation(
46 mat<4, 4, T, Q> const& Mat);
47
48 /// Build a interpolation of 4 * 4 matrixes.
49 /// From GLM_GTX_matrix_interpolation extension.
50 /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results.
51 template<typename T, qualifier Q>
52 GLM_FUNC_DECL mat<4, 4, T, Q> interpolate(
53 mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta);
54
55 /// @}
56}//namespace glm
57
58#include "matrix_interpolation.inl"