Class AxisAlignedBB

java.lang.Object
ua.mcchickenstudio.opencreative.utils.millennium.math.AxisAlignedBB

public final class AxisAlignedBB extends Object
  • Field Details

    • minX

      public double minX
    • minY

      public double minY
    • minZ

      public double minZ
    • maxX

      public double maxX
    • maxY

      public double maxY
    • maxZ

      public double maxZ
  • Constructor Details

    • AxisAlignedBB

      public AxisAlignedBB(AxisAlignedBB bb)
    • AxisAlignedBB

      public AxisAlignedBB(double x1, double y1, double z1, double x2, double y2, double z2)
    • AxisAlignedBB

      public AxisAlignedBB(Vec3 location)
  • Method Details

    • fromBounds

      public static AxisAlignedBB fromBounds(double p_178781_0_, double p_178781_2_, double p_178781_4_, double p_178781_6_, double p_178781_8_, double p_178781_10_)
      returns an AABB with corners x1, y1, z1 and x2, y2, z2
    • addCoord

      public AxisAlignedBB addCoord(double x, double y, double z)
      Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z
    • expand

      public AxisAlignedBB expand(double x, double y, double z)
      Returns a bounding box expanded by the specified vector (if negative numbers are given it will shrink). Args: x, y, z
    • union

      public AxisAlignedBB union(AxisAlignedBB other)
    • offset

      public AxisAlignedBB offset(double x, double y, double z)
      Offsets the current bounding box by the specified coordinates. Args: x, y, z
    • calculateXOffset

      public double calculateXOffset(AxisAlignedBB other, double p_72316_2_)
      if instance and the argument bounding boxes overlap in the Y and Z dimensions, calculate the offset between them in the X dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated offset. Otherwise return the calculated offset.
    • calculateYOffset

      public double calculateYOffset(AxisAlignedBB other, double p_72323_2_)
      if instance and the argument bounding boxes overlap in the X and Z dimensions, calculate the offset between them in the Y dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated offset. Otherwise return the calculated offset.
    • calculateZOffset

      public double calculateZOffset(AxisAlignedBB other, double p_72322_2_)
      if instance and the argument bounding boxes overlap in the Y and X dimensions, calculate the offset between them in the Z dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated offset. Otherwise return the calculated offset.
    • intersectsWith

      public boolean intersectsWith(AxisAlignedBB other)
      Returns whether the given bounding box intersects with this one. Args: axisAlignedBB
    • isVecInside

      public boolean isVecInside(Vec3 vec)
      Returns if the supplied Vec3D is completely inside the bounding box
    • getAverageEdgeLength

      public double getAverageEdgeLength()
      Returns the average length of the edges of the bounding box.
    • contract

      public AxisAlignedBB contract(double x, double y, double z)
      Returns a bounding box that is inset by the specified amounts
    • calculateIntercept

      public MovingObjectPosition calculateIntercept(Vec3 p_72327_1_, Vec3 p_72327_2_)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • offsetAndUpdate

      public AxisAlignedBB offsetAndUpdate(double par1, double par3, double par5)
    • copyFrom

      public void copyFrom(AxisAlignedBB bb)
    • getEyeHeight

      public double getEyeHeight()
    • clone

      public AxisAlignedBB clone()
      Overrides:
      clone in class Object