diff --git a/Base/include/VectorBase.h b/Base/include/VectorBase.h index 46bc194..c3df4b4 100644 --- a/Base/include/VectorBase.h +++ b/Base/include/VectorBase.h @@ -110,7 +110,7 @@ namespace FasTC { const VectorTypeTwo &v2) { VectorTypeOne a(v1); for(int i = 0; i < VectorTypeOne::Size; i++) { - a(i) += v2(i); + a(i) += v2[i]; } return a; } @@ -132,7 +132,7 @@ namespace FasTC { const VectorTypeTwo &v2) { VectorTypeOne a(v1); for(int i = 0; i < VectorTypeOne::Size; i++) { - a(i) -= v2(i); + a(i) -= v2[i]; } return a; } diff --git a/Base/test/TestVector.cpp b/Base/test/TestVector.cpp index f2f2f53..7735fdc 100644 --- a/Base/test/TestVector.cpp +++ b/Base/test/TestVector.cpp @@ -216,6 +216,10 @@ TEST(VectorBase, Addition) { EXPECT_EQ(au[0], 6); EXPECT_EQ(au[1], 5); + au = v2u + fv + uv; + EXPECT_EQ(au[0], 11); + EXPECT_EQ(au[1], 7); + FasTC::VectorBase af = v2f + v2u; EXPECT_NEAR(af[0], 6.1f, kEpsilon); EXPECT_NEAR(af[1], 5.2f, kEpsilon);