java.lang.Object
studio.magemonkey.fabled.api.target.AABB

public class AABB extends Object
Represents an axix-aligned bounding box.
Author:
Kristian
  • Constructor Details

    • AABB

      public AABB(AABB.Vec3D min, AABB.Vec3D max)
      Creates a new instance from a minimum point and a maximum point.
    • AABB

      public AABB(org.bukkit.Location block)
      Create a new AABB from a given block.
      Parameters:
      block - - the block.
  • Method Details

    • getMax

      public AABB.Vec3D getMax()
    • getMin

      public AABB.Vec3D getMin()
    • expand

      public void expand(double expand)
    • intersectsRay

      public AABB.Vec3D intersectsRay(AABB.Ray3D ray, float minDist, double maxDist)
      Calculates intersection with the given ray between a certain distance interval.

      Ray-box intersection is using IEEE numerical properties to ensure the test is both robust and efficient, as described in:
      Amy Williams, Steve Barrus, R. Keith Morley, and Peter Shirley: "An Efficient and Robust Ray-Box Intersection Algorithm" Journal of graphics tools, 10(1):49-54, 2005

      Parameters:
      ray - incident ray
      minDist -
      maxDist -
      Returns:
      intersection point on the bounding box (only the first is returned) or null if no intersection