From ed2a562372f15a0bf0f60ac47f89fa11d331776e Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 13 Jun 2011 13:16:44 +0200 Subject: Added != operator to Vector3. --- vector.cpp | 4 ++++ vector.h | 1 + 2 files changed, 5 insertions(+) diff --git a/vector.cpp b/vector.cpp index cf2c164..29fbdc7 100644 --- a/vector.cpp +++ b/vector.cpp @@ -83,6 +83,10 @@ bool Vector3::operator==(const Vector3& v) { return x == v.x && y == v.y && z == v.z; } +bool Vector3::operator!=(const Vector3& v) { + return !(*this == v); +} + Vector3& Vector3::operator+=(const Vector3& v) { x += v.x; y += v.y; diff --git a/vector.h b/vector.h index a2a3192..f88cc20 100644 --- a/vector.h +++ b/vector.h @@ -32,6 +32,7 @@ class Vector3 : public Vector2 { Vector3(const Vector3& v); Vector3(float x, float y, float z); bool operator==(const Vector3& v); + bool operator!=(const Vector3& v); Vector3& operator+=(const Vector3& v); Vector3 operator+(const Vector3& v); Vector3& operator-=(const Vector3& v); -- cgit v1.2.3