Permalink
Browse files

Fix error in location_shift() and shoof_projectile() when locations a…

…re the same
  • Loading branch information...
PseudoKnight committed Nov 12, 2017
1 parent 5dd9e82 commit c78461f759ad803b1d316533db976ed22ba9e0a6
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/main/java/com/laytonsmith/PureUtilities/Vector3D.java
@@ -81,7 +81,7 @@ public Vector3D multiply(double m) {
}
/**
* Returns a new vector of this vector multiplied by another.
* Returns a new vector of this vector divided by another.
*
* @param other the other vector
* @return a new vector
@@ -91,9 +91,9 @@ public Vector3D divide(Vector3D other) {
}
/**
* Returns a new vector of this vector multiplied by a value.
* Returns a new vector of this vector divided by a value.
*
* @param m the value to multiply by
* @param m the value to divide by
* @return a new vector
*/
public Vector3D divide(double m) {
@@ -108,6 +108,9 @@ public Vector3D divide(double m) {
*/
public Vector3D normalize() {
double length = length();
if(length == 0.0) {
return Vector3D.ZERO;
}
return new Vector3D(x / length, y / length, z / length);
}

0 comments on commit c78461f

Please sign in to comment.