Added unary negative to Vector2

This is the only fragment I'm bothering to salvage from the collisions
branch.
This commit is contained in:
Kayne Ruse
2014-12-27 20:31:09 +11:00
parent ce16fc6969
commit 33c3143de9
+4
View File
@@ -92,6 +92,10 @@ public:
return ret; return ret;
} }
//unary operators
Vector2 operator-() { return {-x, -y}; }
//comparison operators
bool operator==(Vector2 v) { return (x == v.x && y == v.y); } bool operator==(Vector2 v) { return (x == v.x && y == v.y); }
bool operator!=(Vector2 v) { return (x != v.x || y != v.y); } bool operator!=(Vector2 v) { return (x != v.x || y != v.y); }