master
ブランチ master
VulkanExample / dep / include / glm / ext / matrix_common.inl
1.2 KB、34行 生 Blame 履歴
1#include "../matrix.hpp"
2
3#include "_matrix_vectorize.hpp"
4
5namespace glm
6{
7 template<length_t C, length_t R, typename T, typename U, qualifier Q>
8 GLM_FUNC_QUALIFIER mat<C, R, T, Q> mix(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, U a)
9 {
10 return mat<C, R, U, Q>(x) * (static_cast<U>(1) - a) + mat<C, R, U, Q>(y) * a;
11 }
12
13 template<length_t C, length_t R, typename T, typename U, qualifier Q>
14 GLM_FUNC_QUALIFIER mat<C, R, T, Q> mix(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, mat<C, R, U, Q> const& a)
15 {
16 return matrixCompMult(mat<C, R, U, Q>(x), static_cast<U>(1) - a) + matrixCompMult(mat<C, R, U, Q>(y), a);
17 }
18
19 template<length_t C, length_t R, typename T, qualifier Q, bool Aligned>
20 struct compute_abs_matrix
21 {
22 GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<C, R, T, Q> call(mat<C, R, T, Q> const& x)
23 {
24 return detail::matrix_functor_1<mat, C, R, T, T, Q>::call(abs, x);
25 }
26 };
27
28 template<length_t C, length_t R, typename T, qualifier Q>
29 GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> abs(mat<C, R, T, Q> const& x)
30 {
31 return compute_abs_matrix<C, R, T, Q, detail::is_aligned<Q>::value>::call(x);
32 }
33
34}//namespace glm