diff --git a/Source/engine.h b/Source/engine.h index 0dfd3ab67..daea2718a 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -91,6 +91,13 @@ struct Point { return *this; } + Point &operator*=(const float factor) + { + x *= factor; + y *= factor; + return *this; + } + friend Point operator+(Point a, const Point &b) { a += b; @@ -103,6 +110,20 @@ struct Point { return a; } + friend Point operator-(const Point &a) + { + Point b; + b.x = -a.x; + b.y = -a.y; + return b; + } + + friend Point operator*(Point a, const float factor) + { + a *= factor; + return a; + } + /** * @brief Fast approximate distance between two points, using only integer arithmetic, with less than ~5% error * @param other Pointer to which we want the distance