summaryrefslogtreecommitdiffstats
path: root/Vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'Vector.h')
-rw-r--r--Vector.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Vector.h b/Vector.h
index f884c49..ece1230 100644
--- a/Vector.h
+++ b/Vector.h
@@ -12,6 +12,14 @@ class Vector : public Vertex {
return Vector(x+v.x, y+v.y, z+v.z);
}
+ Vector& operator+=(const Vector &v) {
+ x += v.x;
+ y += v.y;
+ z += v.z;
+
+ return *this;
+ }
+
Vector operator*(float f) const {
return Vector(x*f, y*f, z*f);
}