Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 10:30:04 +01:00
Updated Vector to have getMin() and getMax().
Dieser Commit ist enthalten in:
Ursprung
84da5bc6f8
Commit
a86a96f2d0
@ -578,4 +578,32 @@ public class Vector {
|
||||
public BlockVector toBlockVector() {
|
||||
return new BlockVector(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the minimum components of two vectors.
|
||||
*
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return minimum
|
||||
*/
|
||||
public static Vector getMinimum(Vector v1, Vector v2) {
|
||||
return new Vector(
|
||||
Math.min(v1.getX(), v2.getX()),
|
||||
Math.min(v1.getY(), v2.getY()),
|
||||
Math.min(v1.getZ(), v2.getZ()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the maximum components of two vectors.
|
||||
*
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return maximum
|
||||
*/
|
||||
public static Vector getMaximum(Vector v1, Vector v2) {
|
||||
return new Vector(
|
||||
Math.max(v1.getX(), v2.getX()),
|
||||
Math.max(v1.getY(), v2.getY()),
|
||||
Math.max(v1.getZ(), v2.getZ()));
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren