diff options
Diffstat (limited to 'src/helpers/Vector2D.hpp')
| -rw-r--r-- | src/helpers/Vector2D.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/helpers/Vector2D.hpp b/src/helpers/Vector2D.hpp index 557cdb53..f2f47e6b 100644 --- a/src/helpers/Vector2D.hpp +++ b/src/helpers/Vector2D.hpp @@ -3,7 +3,7 @@ #include <math.h> class Vector2D { - public: + public: Vector2D(double, double); Vector2D(); ~Vector2D(); @@ -12,18 +12,18 @@ class Vector2D { double y = 0; // returns the scale - double normalize(); + double normalize(); - Vector2D operator+(const Vector2D a) const { + Vector2D operator+(const Vector2D& a) const { return Vector2D(this->x + a.x, this->y + a.y); } - Vector2D operator-(const Vector2D a) const { + Vector2D operator-(const Vector2D& a) const { return Vector2D(this->x - a.x, this->y - a.y); } - Vector2D operator*(const float a) const { + Vector2D operator*(const float& a) const { return Vector2D(this->x * a, this->y * a); } - Vector2D operator/(const float a) const { + Vector2D operator/(const float& a) const { return Vector2D(this->x / a, this->y / a); } |
