public class BoundingBox extends Object
Constructor and Description |
---|
BoundingBox(BoundingBox a,
BoundingBox b,
BiFunction<Double,Double,Double> f)
Create a new bounding box while computing two bounding box
|
BoundingBox(double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ) |
Modifier and Type | Method and Description |
---|---|
List<Point> |
getAllPoints() |
Point |
getAsHeadPoint()
Get head point where does the attack comes from
|
Point |
getIntersectPoint(Player p)
Get intersection point between actual bounding box and the given player
|
Point |
getIntersectPoint(Point begin,
Vector dir)
Get intersection point between actual bounding box and given point/vector
|
Point |
getMax() |
double |
getMaxX() |
double |
getMaxY() |
double |
getMaxZ() |
Point |
getMid() |
Point |
getMin() |
double |
getMinX() |
double |
getMinY() |
double |
getMinZ() |
Point |
getMostFarPoint(Point p) |
Point |
getNearestPoint(Point other) |
boolean |
isCollide(BoundingBox bb) |
boolean |
isIn(double x,
double y,
double z) |
boolean |
isIn(Point p) |
String |
toString() |
public BoundingBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
public BoundingBox(BoundingBox a, BoundingBox b, BiFunction<Double,Double,Double> f)
a
- the first bounding boxb
- the second bounding boxf
- the function to know if we need min and max valuespublic double getMinX()
public double getMinY()
public double getMinZ()
public double getMaxX()
public double getMaxY()
public double getMaxZ()
public Point getMin()
public Point getMid()
public Point getMax()
public boolean isIn(Point p)
public boolean isCollide(BoundingBox bb)
public boolean isIn(double x, double y, double z)
public Point getAsHeadPoint()
public Point getIntersectPoint(Player p)
p
- player that attackpublic Point getIntersectPoint(Point begin, Vector dir)
begin
- the point where the attack comes fromdir
- the vector where entity was looking at