Package net.glowstone.entity.physics
Class BoundingBox
java.lang.Object
net.glowstone.entity.physics.BoundingBox
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
BlockBoundingBox,EntityBoundingBox
A rectangular bounding box with minimum and maximum corners.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BoundingBoxcopyOf(BoundingBox original) Returns a deep copy of a BoundingBox.static BoundingBoxfromCorners(org.bukkit.util.Vector a, org.bukkit.util.Vector b) Converts two Vector instances to a BoundingBox.static BoundingBoxfromPositionAndSize(org.bukkit.util.Vector pos, org.bukkit.util.Vector size) Creates a bounding box given its minimum corner and its size.org.bukkit.util.VectorgetSize()Returns the displacement of the maximum corner from the minimum corner.final booleanintersects(BoundingBox other) Tests whether this intersects another bounding box.static booleanintersects(BoundingBox a, BoundingBox b) Tests whether two bounding boxes intersect.
-
Field Details
-
minCorner
public final org.bukkit.util.Vector minCorner -
maxCorner
public final org.bukkit.util.Vector maxCorner
-
-
Constructor Details
-
BoundingBox
public BoundingBox()
-
-
Method Details
-
intersects
Tests whether two bounding boxes intersect.- Parameters:
a- a bounding boxb- a bounding box- Returns:
- true if
aandbintersect; false otherwise
-
intersects
Tests whether this intersects another bounding box.- Parameters:
other- another bounding box- Returns:
- true if this bounding box and
otherintersect; false otherwise
-
fromCorners
Converts two Vector instances to a BoundingBox.- Parameters:
a- any cornerb- the corner oppositea- Returns:
- a bounding box from
atob
-
fromPositionAndSize
public static BoundingBox fromPositionAndSize(org.bukkit.util.Vector pos, org.bukkit.util.Vector size) Creates a bounding box given its minimum corner and its size.- Parameters:
pos- the minimum cornersize- the displacement of the maximum corner from the minimum corner- Returns:
- a bounding box from
postopos.clone().add(size)
-
copyOf
Returns a deep copy of a BoundingBox.- Parameters:
original- the BoundingBox to copy- Returns:
- a copy of
original
-
getSize
public org.bukkit.util.Vector getSize()Returns the displacement of the maximum corner from the minimum corner.- Returns:
- the displacement of the maximum corner from the minimum corner
-