Class AABB
java.lang.Object
studio.magemonkey.fabled.api.target.AABB
Represents an axix-aligned bounding box.
- Author:
- Kristian
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAABB(org.bukkit.Location block) Create a new AABB from a given block.AABB(AABB.Vec3D min, AABB.Vec3D max) Creates a new instance from a minimum point and a maximum point. -
Method Summary
Modifier and TypeMethodDescriptionvoidexpand(double expand) getMax()getMin()intersectsRay(AABB.Ray3D ray, float minDist, double maxDist) Calculates intersection with the given ray between a certain distance interval.
-
Constructor Details
-
AABB
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
-
getMin
-
expand
public void expand(double expand) -
intersectsRay
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 rayminDist-maxDist-- Returns:
- intersection point on the bounding box (only the first is returned) or null if no intersection
-