mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +00:00
Added Vector.toVector2D and Vector2D.toVector.
This commit is contained in:
parent
35230d12d8
commit
f11415f451
@ -619,6 +619,15 @@ public class Vector {
|
|||||||
return new BlockVector(this);
|
return new BlockVector(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a 2D vector by dropping the Y component from this vector.
|
||||||
|
*
|
||||||
|
* @return Vector2D
|
||||||
|
*/
|
||||||
|
public Vector2D toVector2D() {
|
||||||
|
return new Vector2D(x, z);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the dot product of this and another vector.
|
* Gets the dot product of this and another vector.
|
||||||
*
|
*
|
||||||
|
@ -190,4 +190,13 @@ public class Vector2D {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return "(" + x + ", " + z + ")";
|
return "(" + x + ", " + z + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a 3D vector by adding a zero Y component to this vector.
|
||||||
|
*
|
||||||
|
* @return Vector
|
||||||
|
*/
|
||||||
|
public Vector toVector() {
|
||||||
|
return new Vector(x, 0, z);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user