Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- horizontallyCentered(double, double, double)
- cube(Vector3dc, double)
- centeredCube(Vector3dc, double)
- setMinMax(Vector3dc, Vector3dc)
- setMinMax(double[], double[])
- setMinMax(float[], float[])
- setEmpty()
- setMinMax(double, double)
- union(Box)
- assign(Box)
- assign(double, double, double, double, double, double)
- minkowskiSum(Box)
- scale(float)
- normalize()
- enclosingRotatedAABB(float, float, float)
- rotateX(float)
- rotateY(float)
- rotateZ(float)
- offset(double, double, double)
- offset(Vector3dc)
- sweep(Vector3dc)
- extend(double, double, double)
- width()
- height()
- depth()
- dimension(Axis)
- getThickness()
- getMaximumThickness()
- getVolume()
- hasVolume()
- isIntersecting(Box)
- isUnitBox()
- middleX()
- middleY()
- middleZ()
- clone()
- getMin()
- getMax()
- getBox(double, double, double)
- containsPosition(double, double, double)
- expand(double)
- containsBlock(int, int, int)
- containsBlock(Vector3ic, int, int, int)
- forEachBlock(double, double, double, double, TriIntPredicate)
- forEachBlock(double, double, double, double, T, TriIntObjPredicate)
- getMaximumExtent()
- intersectsLine(Vector3dc, Vector3dc)
- toString()
Class Box
java.lang.Object
com.hypixel.hytale.math.shape.Box
- All Implemented Interfaces:
Shape
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassign(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) static BoxcenteredCube(org.joml.Vector3dc center, double inradius) clone()booleancontainsBlock(int x, int y, int z) booleancontainsBlock(org.joml.Vector3ic origin, int x, int y, int z) booleancontainsPosition(double x, double y, double z) static Boxcube(org.joml.Vector3dc min, double side) doubledepth()doubleenclosingRotatedAABB(float pitch, float yaw, float roll) Computes the axis-aligned bounding box that fully encloses this box after rotating all 8 corners by the given Euler angles (pitch, yaw, roll).voidexpand(double radius) extend(double extentX, double extentY, double extentZ) booleanforEachBlock(double x, double y, double z, double epsilon, TriIntPredicate consumer) <T> booleanforEachBlock(double x, double y, double z, double epsilon, T t, TriIntObjPredicate<T> consumer) getBox(double x, double y, double z) org.joml.Vector3dgetMax()doubleGets the maximum distance this hitbox extends outside of the 1x1x1 unit box.doubleorg.joml.Vector3dgetMin()doubledoublebooleandoubleheight()static BoxhorizontallyCentered(double width, double height, double depth) booleanintersectsLine(org.joml.Vector3dc start, org.joml.Vector3dc end) Determines whether the line from the provided start and end positions intersects with this box.booleanisIntersecting(Box other) booleandoublemiddleX()doublemiddleY()doublemiddleZ()minkowskiSum(Box bb) offset(double x, double y, double z) offset(org.joml.Vector3dc pos) rotateX(float angleInRadians) rotateY(float angleInRadians) rotateZ(float angleInRadians) scale(float scale) setEmpty()setMinMax(double[] min, double[] max) setMinMax(double min, double max) setMinMax(float[] min, float[] max) setMinMax(org.joml.Vector3dc min, org.joml.Vector3dc max) sweep(org.joml.Vector3dc v) toString()doublewidth()Methods inherited from interface Shape
containsPosition, containsPosition, forEachBlock, forEachBlock, forEachBlock, forEachBlock, forEachBlock, forEachBlock, getBox
-
Field Details
-
CODEC
-
UNIT
-
ZERO
-
min
@Nonnull public final org.joml.Vector3d min -
max
@Nonnull public final org.joml.Vector3d max
-
-
Constructor Details
-
Box
public Box() -
Box
-
Box
public Box(@Nonnull org.joml.Vector3dc min, @Nonnull org.joml.Vector3dc max) -
Box
public Box(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax)
-
-
Method Details
-
horizontallyCentered
-
cube
-
centeredCube
-
setMinMax
-
setMinMax
-
setMinMax
-
setEmpty
-
setMinMax
-
union
-
assign
-
assign
@Nonnull public Box assign(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) -
minkowskiSum
-
scale
-
normalize
-
enclosingRotatedAABB
Computes the axis-aligned bounding box that fully encloses this box after rotating all 8 corners by the given Euler angles (pitch, yaw, roll). Uses extrinsic Z->Y->X order to match the client's intrinsic X->Y->Z quaternion composition. -
rotateX
-
rotateY
-
rotateZ
-
offset
-
offset
-
sweep
-
extend
-
width
public double width() -
height
public double height() -
depth
public double depth() -
dimension
-
getThickness
public double getThickness() -
getMaximumThickness
public double getMaximumThickness() -
getVolume
public double getVolume() -
hasVolume
public boolean hasVolume() -
isIntersecting
-
isUnitBox
public boolean isUnitBox() -
middleX
public double middleX() -
middleY
public double middleY() -
middleZ
public double middleZ() -
clone
-
getMin
@Nonnull public org.joml.Vector3d getMin() -
getMax
@Nonnull public org.joml.Vector3d getMax() -
getBox
-
containsPosition
public boolean containsPosition(double x, double y, double z) - Specified by:
containsPositionin interfaceShape
-
expand
-
containsBlock
public boolean containsBlock(int x, int y, int z) -
containsBlock
public boolean containsBlock(@Nonnull org.joml.Vector3ic origin, int x, int y, int z) -
forEachBlock
public boolean forEachBlock(double x, double y, double z, double epsilon, @Nonnull TriIntPredicate consumer) - Specified by:
forEachBlockin interfaceShape
-
forEachBlock
public <T> boolean forEachBlock(double x, double y, double z, double epsilon, T t, @Nonnull TriIntObjPredicate<T> consumer) - Specified by:
forEachBlockin interfaceShape
-
getMaximumExtent
public double getMaximumExtent()Gets the maximum distance this hitbox extends outside of the 1x1x1 unit box.This is calculated by checking the minimum and maximum values for each axis. If the minimum is n where n is invalid input: '<'0 the extent for that axis in the negative direction is -n aka the number of blocks below 0. If the maximum is n where n is >1 the extent for that axis in the positive direction is n-1 aka the number of blocks above 1.
- Returns:
- the maximum distance this hitbox extends outside of the 1x1x1 unit box
-
intersectsLine
public boolean intersectsLine(@Nonnull org.joml.Vector3dc start, @Nonnull org.joml.Vector3dc end) Determines whether the line from the provided start and end positions intersects with this box.- Parameters:
start- Starting point of the line segment.end- Ending point of the line segment.- Returns:
trueif the line segment intersects the box,falseotherwise.
-
toString
-