java.lang.Object
org.geysermc.connector.network.translators.collision.BoundingBox
All Implemented Interfaces:
Cloneable

public class BoundingBox extends Object implements Cloneable
  • Constructor Details

    • BoundingBox

      public BoundingBox()
  • Method Details

    • translate

      public void translate(double x, double y, double z)
    • extend

      public void extend(double x, double y, double z)
    • extend

      public void extend(com.nukkitx.math.vector.Vector3d extend)
    • checkIntersection

      public boolean checkIntersection(double offsetX, double offsetY, double offsetZ, BoundingBox otherBox)
    • checkIntersection

      public boolean checkIntersection(com.nukkitx.math.vector.Vector3d offset, BoundingBox otherBox)
    • getMin

      public com.nukkitx.math.vector.Vector3d getMin()
    • getMax

      public com.nukkitx.math.vector.Vector3d getMax()
    • getBottomCenter

      public com.nukkitx.math.vector.Vector3d getBottomCenter()
    • getMaxOffset

      public double getMaxOffset(com.nukkitx.math.vector.Vector3d boxOffset, BoundingBox otherBoundingBox, Axis axis, double offset)
      Find the maximum offset of another bounding box in an axis that will not collide with this bounding box
      Parameters:
      boxOffset - The offset of this bounding box
      otherBoundingBox - The bounding box that is moving
      axis - The axis of movement
      offset - The current max offset
      Returns:
      The new max offset
    • getIntersectionSize

      public double getIntersectionSize(BoundingBox otherBoundingBox, Direction side)
      Get the distance required to move this bounding box to one of otherBoundingBox's sides
      Parameters:
      otherBoundingBox - The stationary bounding box
      side - The side of otherBoundingBox to snap this bounding box to
      Returns:
      The distance to move in the direction of side
    • clone

      public BoundingBox clone()
      Overrides:
      clone in class Object