mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Added Vector.toVector2D and Vector2D.toVector.
This commit is contained in:
parent
35230d12d8
commit
f11415f451
@ -619,6 +619,15 @@ public BlockVector toBlockVector() {
|
||||
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.
|
||||
*
|
||||
|
@ -190,4 +190,13 @@ public int hashCode() {
|
||||
public String toString() {
|
||||
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