11#include <mv/math/detail/Matrix3Ops.hpp>
16 requires std::is_floating_point_v<T>
69 using Ops = detail::Matrix3Ops<T>;
70 if constexpr (Ops::HasNativeFromQuaternion)
72 const typename Ops::Rows
rows =
112 return RowVector(Rows_[0].X(), Rows_[1].X(), Rows_[2].X());
116 return RowVector(Rows_[0].Y(), Rows_[1].Y(), Rows_[2].Y());
118 return RowVector(Rows_[0].Z(), Rows_[1].Z(), Rows_[2].Z());
122 std::size_t
column)
const noexcept
144 const T a = Rows_[0].X();
145 const T b = Rows_[0].Y();
146 const T c = Rows_[0].Z();
147 const T d = Rows_[1].X();
148 const T e = Rows_[1].Y();
149 const T f = Rows_[1].Z();
150 const T g = Rows_[2].X();
151 const T h = Rows_[2].Y();
152 const T i = Rows_[2].Z();
153 return a * (
e *
i -
f *
h) -
b * (
d *
i -
f *
g) +
159 using Ops = detail::Matrix3Ops<T>;
160 if constexpr (Ops::HasNativeInverse)
166 const typename Ops::Rows
inverse = Ops::InverseUnchecked(
167 Rows_[0].Native_, Rows_[1].Native_, Rows_[2].Native_);
176 const T a = Rows_[0].X();
177 const T b = Rows_[0].Y();
178 const T c = Rows_[0].Z();
179 const T d = Rows_[1].X();
180 const T e = Rows_[1].Y();
181 const T f = Rows_[1].Z();
182 const T g = Rows_[2].X();
183 const T h = Rows_[2].Y();
184 const T i = Rows_[2].Z();
229 return std::isfinite(Rows_[0].X()) && std::isfinite(Rows_[0].Y()) &&
230 std::isfinite(Rows_[0].Z()) && std::isfinite(Rows_[1].X()) &&
231 std::isfinite(Rows_[1].Y()) && std::isfinite(Rows_[1].Z()) &&
232 std::isfinite(Rows_[2].X()) && std::isfinite(Rows_[2].Y()) &&
233 std::isfinite(Rows_[2].Z());
247 return Mat3(
right.TransformVector(Rows_[0]),
248 right.TransformVector(Rows_[1]),
249 right.TransformVector(Rows_[2]));
255 return left.Rows_[0] ==
right.Rows_[0] &&
264 template <
typename T>
265 requires std::is_floating_point_v<T>
280static_assert(std::is_trivially_copyable_v<mv::math::Mat3f>);
281static_assert(std::is_standard_layout_v<mv::math::Mat3f>);
Mat3(RowVector row0, RowVector row1, RowVector row2) noexcept
bool IsFinite() const noexcept
static Mat3 Identity() noexcept
Mat3 Transposed() const noexcept
Mat3(T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33) noexcept
std::optional< Mat3 > TryInverse() const noexcept
friend bool operator==(const Mat3 &left, const Mat3 &right) noexcept
RowVector TransformVector(const RowVector &vector) const noexcept
static Mat3 Scale(RowVector scale) noexcept
static Mat3 Zero() noexcept
RowVector Column(std::size_t index) const noexcept
T Element(std::size_t row, std::size_t column) const noexcept
T Determinant() const noexcept
Mat3 operator*(const Mat3 &right) const noexcept
const RowVector & Row(std::size_t index) const noexcept
static Mat3 FromRotation(const Rotation3< T > &rotation) noexcept
Vec3< T > operator*(const Vec3< T > &vector, const Mat3< T > &matrix) noexcept