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 c5063fa024
commit 2312c4d258

View File

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