Interface BoundingBox
- All Known Subinterfaces:
OBB
- All Known Implementing Classes:
AABBBoundingBoxImplMixin
,OBBImpl
public interface BoundingBox
A representation of a box for collision and similar detection purposes. Minecraft's
AABB
and ImmersiveMC"s
OBBImpl
both implement this. Other classes may implement this interface in the future, though only ImmersiveMC
should create implementations of this interface.-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.phys.AABB
asAABB()
asOBB()
static boolean
contains
(BoundingBox box, net.minecraft.world.phys.Vec3 pos) Determine if the provided position is inside the provided BoundingBox.static net.minecraft.world.phys.Vec3
getCenter
(BoundingBox box) Get the center of the provided BoundingBox.default boolean
isAABB()
default boolean
isOBB()
-
Method Details
-
asOBB
- Returns:
- This BoundingBox as an OBB if it is one.
- Throws:
RuntimeException
- If this BoundingBox is not an OBB.
-
asAABB
- Returns:
- This BoundingBox as an AABB if it is one.
- Throws:
RuntimeException
- If this BoundingBox is not an AABB.
-
isOBB
default boolean isOBB()- Returns:
- Whether this BoundingBox is an OBB.
-
isAABB
default boolean isAABB()- Returns:
- Whether this BoundingBox is an AABB.
-
contains
Determine if the provided position is inside the provided BoundingBox.- Parameters:
box
- The BoundingBox to check if it contains the provided position.pos
- The position to check if inside the provided BoundingBox.- Returns:
- Whether pos is inside the box.
-
getCenter
Get the center of the provided BoundingBox.- Parameters:
box
- The BoundingBox to get the center of.- Returns:
- The center of the provided BoundingBox.
-