mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Added Vector.getMidpoint
This commit is contained in:
parent
555758288b
commit
a7530b7f89
@ -708,4 +708,19 @@ public static Vector getMaximum(Vector v1, Vector v2) {
|
||||
Math.max(v1.z, v2.z)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the midpoint of two vectors.
|
||||
*
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return maximum
|
||||
*/
|
||||
public static Vector getMidpoint(Vector v1, Vector v2) {
|
||||
return new Vector(
|
||||
(v1.x + v2.x) / 2,
|
||||
(v1.y + v2.y) / 2,
|
||||
(v1.z + v2.z) / 2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user