diff --git a/tempest/vector/C3Vector.cpp b/tempest/vector/C3Vector.cpp index ea08da7..8e222c2 100644 --- a/tempest/vector/C3Vector.cpp +++ b/tempest/vector/C3Vector.cpp @@ -28,3 +28,7 @@ C3Vector operator+(const C3Vector& l, const C3Vector& r) { return { x, y, z }; } + +bool operator!=(const C3Vector& l, const C3Vector& r) { + return l.x != r.x || l.y != r.y || l.z != r.z; +} diff --git a/tempest/vector/C3Vector.hpp b/tempest/vector/C3Vector.hpp index 2334ef9..49b3c9c 100644 --- a/tempest/vector/C3Vector.hpp +++ b/tempest/vector/C3Vector.hpp @@ -22,4 +22,6 @@ class C3Vector { C3Vector operator+(const C3Vector& l, const C3Vector& r); +bool operator!=(const C3Vector& l, const C3Vector& r); + #endif diff --git a/test/Vector.cpp b/test/Vector.cpp index 2ab6b04..54f6bca 100644 --- a/test/Vector.cpp +++ b/test/Vector.cpp @@ -109,4 +109,10 @@ TEST_CASE("C3Vector global operators", "[vector]") { REQUIRE(vector3.y == 7.0f); REQUIRE(vector3.z == 9.0f); } + + SECTION("C3Vector != C3Vector") { + auto vector1 = C3Vector(1.0f, 2.0f, 3.0f); + auto vector2 = C3Vector(4.0f, 5.0f, 6.0f); + REQUIRE(vector1 != vector2); + } }