Added support for drawing effects again.
[supertux.git] / src / vector.h
index 6436c3f..699a4cc 100644 (file)
@@ -41,6 +41,16 @@ public:
     return Vector(x * s, y * s);
   }
 
+  Vector operator/(float s) const
+  {
+    return Vector(x / s, y / s);
+  }
+
+  Vector operator-() const
+  {
+    return Vector(-x, -y);
+  }
+
   const Vector& operator +=(const Vector& other)
   {
     x += other.x;
@@ -48,6 +58,15 @@ public:
     return *this;
   }
 
+  // scalar product of 2 vectors
+  float operator*(const Vector& other) const
+  {
+    return x*other.x + y*other.y;
+  }
+
+  float norm() const;
+  Vector unit() const;
+
   // ... add the other operators as needed, I'm too lazy now ...
 
   float x, y; // leave this public, get/set methods just give me headaches