From bc340b0d243e84063cf0cf1bb018c020d158fb46 Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 3 Sep 2024 22:21:42 +0300 Subject: [PATCH] removed operator since its not even --- include/omath/Matrix.h | 2 -- source/Matrix.cpp | 15 +-------------- tests/UnitTestMatrix.cpp | 11 ----------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/include/omath/Matrix.h b/include/omath/Matrix.h index c157127..a191e37 100644 --- a/include/omath/Matrix.h +++ b/include/omath/Matrix.h @@ -65,8 +65,6 @@ namespace omath Matrix operator*(float f) const; - Matrix operator*(const Vector3 &vec3) const; - Matrix &operator*=(float f); Matrix &operator/=(float f); diff --git a/source/Matrix.cpp b/source/Matrix.cpp index 6d2e11b..8872774 100644 --- a/source/Matrix.cpp +++ b/source/Matrix.cpp @@ -164,20 +164,7 @@ namespace omath { Set(0.f); } - - Matrix Matrix::operator*(const Vector3 &vec3) const - { - auto vecmatrix = Matrix(m_rows, 1); - vecmatrix.Set(1.f); - vecmatrix.At(0, 0) = vec3.x; - vecmatrix.At(1, 0) = vec3.y; - vecmatrix.At(2, 0) = vec3.z; - - return *this * vecmatrix; - - } - - + Matrix &Matrix::operator=(const Matrix &other) { if (this == &other) diff --git a/tests/UnitTestMatrix.cpp b/tests/UnitTestMatrix.cpp index fb9566f..fc48e9b 100644 --- a/tests/UnitTestMatrix.cpp +++ b/tests/UnitTestMatrix.cpp @@ -66,17 +66,6 @@ TEST_F(UnitTestMatrix, Operator_Multiplication_Matrix) EXPECT_FLOAT_EQ(m3.At(1, 1), 22.0f); } -TEST_F(UnitTestMatrix, Operator_Multiplication_Vector3) -{ - Vector3 v(1.0f, 2.0f, 3.0f); - Matrix m3(3, 3, new float[9]{1, 0, 0, 0, 1, 0, 0, 0, 1}); - Matrix result = m3 * v; - - EXPECT_FLOAT_EQ(result.At(0, 0), 1.0f); - EXPECT_FLOAT_EQ(result.At(1, 0), 2.0f); - EXPECT_FLOAT_EQ(result.At(2, 0), 3.0f); -} - TEST_F(UnitTestMatrix, Operator_Multiplication_Scalar) { Matrix m3 = m2 * 2.0f;