36 using Float = std::remove_cvref_t<decltype(std::declval<Vec2>().X)>;
41 [[nodiscard]]
static JPL_INLINE
constexpr Mat2 Identity() noexcept {
return {
Vec2{ 1, 0 },
Vec2{ 0, 1 } }; }
42 [[nodiscard]]
static JPL_INLINE
constexpr Mat2 FromColumns(
const Vec2& l1,
const Vec2& l2)
noexcept {
return { l1, l2 }; }
47 [[nodiscard]] JPL_INLINE
constexpr Float Det() const noexcept{
return CrossProduct(
C0,
C1); }
64 const Vec2 R0 = r0 * inv, R1 = r1 * inv;
89 [[nodiscard]]
static JPL_INLINE
constexpr Mat3 Identity() noexcept {
return { Vec3{1, 0, 0}, Vec3{0, 1, 0}, Vec3{0, 0, 1} }; }
90 [[nodiscard]]
static JPL_INLINE
constexpr Mat3 FromColumns(
const Vec3& l1,
const Vec3& l2,
const Vec3& l3)
noexcept {
return { l1, l2, l3 }; }
94 [[nodiscard]] JPL_INLINE
constexpr Float Det()
const {
return DotProduct(
C0, CrossProduct(
C1,
C2)); }
99 const Vec3 v1 = CrossProduct(
C1,
C2);
100 const Vec3 v2 = CrossProduct(
C2,
C0);
101 const Vec3 v3 = CrossProduct(
C0,
C1);
102 const Float det = DotProduct(
C0, v1);
108 const Float inv = 1.0f / det;
110 const Vec3 R0 = v1 * inv;
111 const Vec3 R1 = v2 * inv;
112 const Vec3 R2 = v3 * inv;
#define JPL_ENSURE(inExpression,...)
Define ENSURE.
Definition ErrorReporting.h:94
std::remove_cvref_t< decltype(GetX(std::declval< Vec3 >()))> FloatOf
Definition Vec3Math.h:36
JPL_INLINE constexpr auto Abs(const T &value) noexcept
Standard abs is not constexpr in C++20.
Definition Math.h:87
JPL_INLINE auto GetX(const Vec3Type &v) noexcept
Definition Vec3Traits.h:35
JPL_INLINE auto GetZ(const Vec3Type &v) noexcept
Definition Vec3Traits.h:37
JPL_INLINE auto GetY(const Vec3Type &v) noexcept
Definition Vec3Traits.h:36
Minimal 2x2 matrix interface.
Definition MinimalMat.h:35
constexpr bool TryInverse(Mat2 &out, Float eps=Float(1e-6)) const
Definition MinimalMat.h:51
static JPL_INLINE constexpr Mat2 FromColumns(const Vec2 &l1, const Vec2 &l2) noexcept
Definition MinimalMat.h:42
JPL_INLINE constexpr bool IsInvertible(Float eps=Float(1e-6)) const noexcept
Definition MinimalMat.h:48
std::remove_cvref_t< decltype(std::declval< Vec2 >().X)> Float
Definition MinimalMat.h:36
static JPL_INLINE constexpr Mat2 Identity() noexcept
Definition MinimalMat.h:41
Vec2 C1
Definition MinimalMat.h:39
Vec2 C0
Definition MinimalMat.h:39
JPL_INLINE constexpr Vec2 Transform(const Vec2 &p) const noexcept
Definition MinimalMat.h:45
JPL_INLINE constexpr Mat2 Inversed(Float eps=Float(1e-6)) const
Definition MinimalMat.h:72
JPL_INLINE constexpr Float Det() const noexcept
Definition MinimalMat.h:47
Minimal 3x3 matrix interface.
Definition MinimalMat.h:83
Internal::FloatOf< Vec3 > Float
Definition MinimalMat.h:84
Vec3 C0
Definition MinimalMat.h:87
JPL_INLINE constexpr Float Det() const
Definition MinimalMat.h:94
JPL_INLINE constexpr Vec3 Transform(const Vec3 &v) const noexcept
Definition MinimalMat.h:92
static JPL_INLINE constexpr Mat3 FromColumns(const Vec3 &l1, const Vec3 &l2, const Vec3 &l3) noexcept
Definition MinimalMat.h:90
JPL_INLINE constexpr Mat3 Inversed(Float eps=Float(1e-6)) const
Definition MinimalMat.h:121
JPL_INLINE constexpr bool IsInvertible(Float eps=Float(1e-6)) const noexcept
Definition MinimalMat.h:95
Vec3 C2
Definition MinimalMat.h:87
constexpr bool TryInverse(Mat3 &out, Float eps=Float(1e-6)) const
Definition MinimalMat.h:97
Vec3 C1
Definition MinimalMat.h:87
static JPL_INLINE constexpr Mat3 Identity() noexcept
Definition MinimalMat.h:89
Definition MinimalVec2.h:29
float X
Definition MinimalVec2.h:30
float Y
Definition MinimalVec2.h:31