3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-13 22:50:06 +01:00

Added Vector.toVector2D and Vector2D.toVector.

Dieser Commit ist enthalten in:
TomyLobo 2012-01-03 00:41:25 +01:00
Ursprung 35230d12d8
Commit f11415f451
2 geänderte Dateien mit 18 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -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.
* *

Datei anzeigen

@ -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);
}
} }