mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
removed operator since its not even
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user