Add .add() to Vector

This commit is contained in:
2022-05-04 09:55:30 +02:00
parent 4f8f9e0c37
commit 1ab9c3650e
2 changed files with 16 additions and 6 deletions

View File

@ -45,6 +45,12 @@ public class Vector {
return new Vector(x + v.x, y + v.y, z + v.z);
}
public void add(Vector v) {
this.x += v.x;
this.y += v.y;
this.z += v.z;
}
/**
* Returns the product of this vector and 'd'.
*/