5#ifndef SAPPHIRE_MATHS_TRANSFORM_TRS_MATRIX_FUNCTOR_GUARD
6#define SAPPHIRE_MATHS_TRANSFORM_TRS_MATRIX_FUNCTOR_GUARD
36 template <
typename T,
template <
typename>
typename... TrArgs>
41 if constexpr (TrHasComponent<TrScale>() && TrHasComponent<TrUScale>())
42 return _tr.scale * _tr.uScale;
43 else if constexpr (TrHasComponent<TrScale>())
45 else if constexpr (TrHasComponent<TrUScale>())
125 template <
typename T,
template <
typename>
typename... TrArgs>
130 const Vec3<T> scale = ComputeScale(_tr);
131 constexpr bool bHasScale = TrHasComponent<TrScale>() || TrHasComponent<TrUScale>();
133 if constexpr (TrHasComponent<TrRotation>())
137 if constexpr (bHasScale)
138 ApplyScaleToRotation(scale, out);
140 else if constexpr (bHasScale)
147 if constexpr (TrHasComponent<TrPosition>())
148 ApplyTranslation(_tr.position, out);
Matrix 4x4 type implementation.
Compute TRS Matrix from Transform. Order is applied from right to left: (T * (R * S))....
Definition TransformTRSMatrixFunctor.hpp:35
Mat4< T > operator()(const Tr< T, TrArgs... > &_tr)
Compute matrix from input transform. Functor implementation.
Definition TransformTRSMatrixFunctor.hpp:126
Matrix 4x4 Sapphire-Maths class.
Definition Matrix4.hpp:68
static Mat4 MakeRotation(const Quat< T > &_rot) noexcept
Make rotation matrix from quaternion.
static Mat4 MakeScale(const Vec3< T > &_scale) noexcept
Make scale matrix from vector3.
Transform Sapphire's class.
Definition Transform.hpp:33
Vector 3 Sapphire-Maths class.
Definition Vector3.hpp:43
T z
Vector's Z component (axis value).
Definition Vector3.hpp:54
T y
Vector's Y component (axis value).
Definition Vector3.hpp:51
T x
Vector's X component (axis value).
Definition Vector3.hpp:48