Browse files

Add Vector{2D}.toDirection(Vector{2D}) methods

  • Loading branch information...
1 parent 5b5188f commit 57809c64a3e721882cc57685ee01e40fb802ba5b @aumgn committed May 23, 2012
View
4 core/src/main/java/fr/aumgn/bukkitutils/geom/Vector.java
@@ -203,6 +203,10 @@ public Direction toDirection() {
return new VectorDirection(this);
}
+ public Direction toDirection(Vector to) {
+ return to.subtract(this).toDirection();
+ }
+
public Location toLocation(World world) {
return toLocation(world, 0.0f, 0.0f);
}
View
4 core/src/main/java/fr/aumgn/bukkitutils/geom/Vector2D.java
@@ -164,6 +164,10 @@ public Direction toDirection() {
return new Vector2DDirection(this);
}
+ public Direction toDirection(Vector2D to) {
+ return to.subtract(this).toDirection();
+ }
+
public Vector to3D() {
return new Vector(x, 0, z);
}

0 comments on commit 57809c6

Please sign in to comment.