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 Type
    Method
    Description
    net.minecraft.world.phys.AABB
     
     
    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
    Get the center of the provided BoundingBox.
    default boolean
     
    default boolean
     
  • Method Details

    • asOBB

      OBBImpl asOBB() throws RuntimeException
      Returns:
      This BoundingBox as an OBB if it is one.
      Throws:
      RuntimeException - If this BoundingBox is not an OBB.
    • asAABB

      net.minecraft.world.phys.AABB asAABB() throws RuntimeException
      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

      static boolean contains(BoundingBox box, net.minecraft.world.phys.Vec3 pos)
      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

      static net.minecraft.world.phys.Vec3 getCenter(BoundingBox box)
      Get the center of the provided BoundingBox.
      Parameters:
      box - The BoundingBox to get the center of.
      Returns:
      The center of the provided BoundingBox.