Vector.getMidpoint should not modify the current Vector. Thanks TomyLobo for noticing.

This commit is contained in:
Erik Broes
2012-01-04 09:17:05 +01:00
parent 7235331440
commit d24afc06a9

View File

@@ -220,9 +220,9 @@ public class Vector implements Cloneable, ConfigurationSerializable {
* @return a new midpoint vector
*/
public Vector getMidpoint(Vector other) {
x = (x + other.x) / 2;
y = (y + other.y) / 2;
z = (z + other.z) / 2;
double x = (this.x + other.x) / 2;
double y = (this.y + other.y) / 2;
double z = (this.z + other.z) / 2;
return new Vector(x, y, z);
}