Go to the documentation of this file. 1 #ifndef EAGINE_MATH_MATRIX_SCALE_HPP
9 #define EAGINE_MATH_MATRIX_SCALE_HPP
20 template <
typename T,
int N,
bool RM,
bool V>
21 struct is_matrix_constructor<
scale<matrix<T, N, N, RM, V>>> : std::true_type {};
28 template <
typename T,
bool RM,
bool V>
31 constexpr
scale(vect::data_t<T, 3, V> v) noexcept
38 constexpr
scale(T vx, T vy, T vz) noexcept
44 {{_v[0], T(0), T(0), T(0)},
45 {T(0), _v[1], T(0), T(0)},
46 {T(0), T(0), _v[2], T(0)},
47 {T(0), T(0), T(0), T(1)}}};
52 -> scale<matrix<T, 4, 4, !RM, V>> {
57 vect::data_t<T, 3, V> _v;
61 template <
typename T,
int N,
bool RM1,
bool RM2,
bool V>
63 const scale<matrix<T, N, N, RM1, V>>& a,
64 const scale<matrix<T, N, N, RM2, V>>& b) noexcept
65 -> scale<matrix<T, N, N, RM1, V>> {
74 template <
typename T,
int N,
bool RM,
bool V>
75 struct is_matrix_constructor<uniform_scale<matrix<T, N, N, RM, V>>>
83 template <
typename T,
bool RM,
bool V>
84 class uniform_scale<
matrix<T, 4, 4, RM, V>> {
94 {{_v, T(0), T(0), T(0)},
95 {T(0), _v, T(0), T(0)},
96 {T(0), T(0), _v, T(0)},
97 {T(0), T(0), T(0), T(1)}}};
100 friend constexpr
auto
102 -> uniform_scale<matrix<T, 4, 4, !RM, V>> {
111 template <
typename T,
int N,
bool RM1,
bool RM2,
bool V>
113 const uniform_scale<matrix<T, N, N, RM1, V>>& a,
114 const uniform_scale<matrix<T, N, N, RM2, V>>& b) noexcept
115 -> uniform_scale<matrix<T, N, N, RM1, V>> {
116 return {a._v * b._v};
126 template <
typename T,
bool V>
140 template <
typename T,
bool V>
146 #endif // EAGINE_MATH_MATRIX_SCALE_HPP
convertible_matrix_constructor< scale< matrix< T, 4, 4, true, V > >> matrix_scale
Alias for constructor of scale transformation matrix.
Definition: matrix_scale.hpp:128
static auto scale(std::shared_ptr< generator > gen, std::array< float, 3 > s) noexcept
Constructs instances of scaled_gen modifier.
Definition: scaled.hpp:41
Math-related code is placed in this namespace.
Definition: eagine.hpp:48
constexpr scale(T vx, T vy, T vz) noexcept
Initializes the matrix constructor.
Definition: matrix_scale.hpp:38
Helper class used in matrix constructor implementation.
Definition: matrix_ctr.hpp:74
static auto multiply(const matrix< T, K, M, RM1, V > &m1, const matrix< T, N, K, RM2, V > &m2) noexcept -> matrix< T, N, M, RM1, V >
Matrix multiplication function.
Definition: matrix.hpp:529
constexpr auto operator()() const noexcept
Returns the constructed matrix.
Definition: matrix_scale.hpp:42
Basic RxC matrix implementation template.
Definition: fwd.hpp:25