From 33c3143de95d515a4de15682564dd97412480e2c Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 27 Dec 2014 20:31:09 +1100 Subject: [PATCH] Added unary negative to Vector2 This is the only fragment I'm bothering to salvage from the collisions branch. --- common/utilities/vector2.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/utilities/vector2.hpp b/common/utilities/vector2.hpp index e1688d4..00f4a06 100644 --- a/common/utilities/vector2.hpp +++ b/common/utilities/vector2.hpp @@ -92,6 +92,10 @@ public: 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); }