diff --git a/include/omath/Mat.hpp b/include/omath/Mat.hpp index 18907fa..1e717ab 100644 --- a/include/omath/Mat.hpp +++ b/include/omath/Mat.hpp @@ -70,13 +70,13 @@ namespace omath } [[nodiscard]] - static consteval size_t RowCount() noexcept + static constexpr size_t RowCount() noexcept { return Rows; } [[nodiscard]] - static consteval size_t ColumnsCount() noexcept + static constexpr size_t ColumnsCount() noexcept { return Columns; } @@ -133,9 +133,9 @@ namespace omath // Operator overloading for multiplication with another Mat template - constexpr Mat operator*(const Mat &other) const + constexpr Mat operator*(const Mat &other) const { - Mat result; + Mat result; for (size_t i = 0; i < Rows; ++i) for (size_t j = 0; j < OtherColumns; ++j) @@ -157,7 +157,7 @@ namespace omath } template - constexpr Mat operator*=(const Mat &other) + constexpr Mat operator*=(const Mat &other) { return *this = *this * other; } @@ -207,9 +207,9 @@ namespace omath } [[nodiscard]] - constexpr Mat Transposed() const noexcept + constexpr Mat Transposed() const noexcept { - Mat transposed; + Mat transposed; for (size_t i = 0; i < Rows; ++i) for (size_t j = 0; j < Columns; ++j) transposed.At(j, i) = At(i, j); @@ -240,9 +240,9 @@ namespace omath } [[nodiscard]] - constexpr Mat Minor(const size_t row, const size_t column) const + constexpr Mat Minor(const size_t row, const size_t column) const { - Mat result; + Mat result; for (size_t i = 0, m = 0; i < Rows; ++i) { if (i == row) @@ -288,6 +288,18 @@ namespace omath return oss.str(); } + [[nodiscard]] + bool operator==(const Mat & mat) const + { + return m_data == mat.m_data; + } + + [[nodiscard]] + bool operator!=(const Mat & mat) const + { + return !operator==(mat); + } + // Static methods that return fixed-size matrices [[nodiscard]] constexpr static Mat<4, 4> ToScreenMat(const Type &screenWidth, const Type &screenHeight) noexcept @@ -322,7 +334,7 @@ namespace omath {right.x, up.x, forward.x, 0}, {right.y, up.y, forward.y, 0}, {right.z, up.z, forward.z, 0}, - {0, 0, 0, 1}, + {0, 0, 0, 1}, }; } @@ -354,10 +366,10 @@ namespace omath return { { - {vector.x}, - {vector.y}, - {vector.z}, - {1} + vector.x, + vector.y, + vector.z, + 1 } }; } diff --git a/source/collision/LineTracer.cpp b/source/collision/LineTracer.cpp index 905350b..83bcdd2 100644 --- a/source/collision/LineTracer.cpp +++ b/source/collision/LineTracer.cpp @@ -1,7 +1,6 @@ // // Created by Orange on 11/13/2024. // -#pragma once #include "omath/collision/LineTracer.hpp" namespace omath::collision