Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 57809c64a3e721882cc57685ee01e40fb802ba5b 1 parent 5b5188f
aumgn authored
4 core/src/main/java/fr/aumgn/bukkitutils/geom/Vector.java
View
@@ -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);
}
4 core/src/main/java/fr/aumgn/bukkitutils/geom/Vector2D.java
View
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.