public class BoundingBox extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
org.bukkit.util.Vector |
maxCorner |
org.bukkit.util.Vector |
minCorner |
Constructor and Description |
---|
BoundingBox() |
Modifier and Type | Method and Description |
---|---|
static BoundingBox |
copyOf(BoundingBox original)
Returns a deep copy of a BoundingBox.
|
static BoundingBox |
fromCorners(org.bukkit.util.Vector a,
org.bukkit.util.Vector b)
Converts two Vector instances to a BoundingBox.
|
static BoundingBox |
fromPositionAndSize(org.bukkit.util.Vector pos,
org.bukkit.util.Vector size)
Creates a bounding box given its minimum corner and its size.
|
org.bukkit.util.Vector |
getSize()
Returns the displacement of the maximum corner from the minimum corner.
|
boolean |
intersects(BoundingBox other)
Tests whether this intersects another bounding box.
|
static boolean |
intersects(BoundingBox a,
BoundingBox b)
Tests whether two bounding boxes intersect.
|
public final org.bukkit.util.Vector minCorner
public final org.bukkit.util.Vector maxCorner
public final boolean intersects(BoundingBox other)
other
- another bounding boxother
intersect; false otherwisepublic static boolean intersects(BoundingBox a, BoundingBox b)
a
- a bounding boxb
- a bounding boxa
and b
intersect; false otherwisepublic static BoundingBox fromCorners(org.bukkit.util.Vector a, org.bukkit.util.Vector b)
a
- any cornerb
- the corner opposite a
a
to b
public static BoundingBox fromPositionAndSize(org.bukkit.util.Vector pos, org.bukkit.util.Vector size)
pos
- the minimum cornersize
- the displacement of the maximum corner from the minimum cornerpos
to pos.clone().add(size)
public static BoundingBox copyOf(BoundingBox original)
original
- the BoundingBox to copyoriginal
public org.bukkit.util.Vector getSize()
Copyright © 2021. All rights reserved.