1.9 KB、60行 生 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#endif
22
23#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
24# pragma message("GLM: GLM_GTX_matrix_interpolation extension included")
25#endif
26
27namespace glm
28{
29 /// @addtogroup gtx_matrix_interpolation
30 /// @{
31
32 /// Get the axis and angle of the rotation from a matrix.
33 /// From GLM_GTX_matrix_interpolation extension.
34 template<typename T, qualifier Q>
35 GLM_FUNC_DECL void axisAngle(
36 mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle);
37
38 /// Build a matrix from axis and angle.
39 /// From GLM_GTX_matrix_interpolation extension.
40 template<typename T, qualifier Q>
41 GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix(
42 vec<3, T, Q> const& Axis, T const Angle);
43
44 /// Extracts the rotation part of a matrix.
45 /// From GLM_GTX_matrix_interpolation extension.
46 template<typename T, qualifier Q>
47 GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation(
48 mat<4, 4, T, Q> const& Mat);
49
50 /// Build a interpolation of 4 * 4 matrixes.
51 /// From GLM_GTX_matrix_interpolation extension.
52 /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results.
53 template<typename T, qualifier Q>
54 GLM_FUNC_DECL mat<4, 4, T, Q> interpolate(
55 mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta);
56
57 /// @}
58}//namespace glm
59
60#include "matrix_interpolation.inl"