Class BoundingBox
java.lang.Object
org.geysermc.geyser.level.physics.BoundingBox
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionBoundingBox(double middleX, double middleY, double middleZ, double sizeX, double sizeY, double sizeZ) BoundingBox(org.cloudburstmc.math.vector.Vector3d position, double sizeX, double sizeY, double sizeZ) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleancheckIntersection(double offsetX, double offsetY, double offsetZ, BoundingBox otherBox) booleancheckIntersection(org.cloudburstmc.math.vector.Vector3d offset, BoundingBox otherBox) booleancheckIntersection(BoundingBox otherBox) clone()booleanvoidexpand(double expand) voidexpand(double x, double y, double z) voidextend(double x, double y, double z) voidextend(org.cloudburstmc.math.vector.Vector3d extend) org.cloudburstmc.math.vector.Vector3ddoublegetIntersectionSize(BoundingBox otherBoundingBox, Direction side) Get the distance required to move this bounding box to one of otherBoundingBox's sidesorg.cloudburstmc.math.vector.Vector3dgetMax()doubledoublegetMaxOffset(double xOffset, double yOffset, double zOffset, BoundingBox otherBoundingBox, Axis axis, double offset) Find the maximum offset of another bounding box in an axis that will not collide with this bounding boxdoubledoubledoubleorg.cloudburstmc.math.vector.Vector3dgetMin()doubledoublegetSizeX()doublegetSizeY()doublegetSizeZ()inthashCode()voidsetMiddleX(double middleX) voidsetMiddleY(double middleY) voidsetMiddleZ(double middleZ) voidsetSizeX(double sizeX) voidsetSizeY(double sizeY) voidsetSizeZ(double sizeZ) toString()voidtranslate(double x, double y, double z) voidtranslate(org.cloudburstmc.math.vector.Vector3d translate)
-
Constructor Details
-
BoundingBox
public BoundingBox(org.cloudburstmc.math.vector.Vector3d position, double sizeX, double sizeY, double sizeZ) -
BoundingBox
public BoundingBox(double middleX, double middleY, double middleZ, double sizeX, double sizeY, double sizeZ)
-
-
Method Details
-
translate
public void translate(double x, double y, double z) -
extend
public void extend(double x, double y, double z) -
expand
public void expand(double x, double y, double z) -
translate
public void translate(org.cloudburstmc.math.vector.Vector3d translate) -
extend
public void extend(org.cloudburstmc.math.vector.Vector3d extend) -
expand
public void expand(double expand) -
checkIntersection
public boolean checkIntersection(double offsetX, double offsetY, double offsetZ, BoundingBox otherBox) -
checkIntersection
public boolean checkIntersection(org.cloudburstmc.math.vector.Vector3d offset, BoundingBox otherBox) -
checkIntersection
-
getMin
public org.cloudburstmc.math.vector.Vector3d getMin() -
getMin
-
getMax
public org.cloudburstmc.math.vector.Vector3d getMax() -
getMax
-
getBottomCenter
public org.cloudburstmc.math.vector.Vector3d getBottomCenter() -
getMaxOffset
public double getMaxOffset(double xOffset, double yOffset, double zOffset, BoundingBox otherBoundingBox, Axis axis, double offset) Find the maximum offset of another bounding box in an axis that will not collide with this bounding box- Parameters:
xOffset- The x offset of this bounding boxyOffset- The y offset of this bounding boxzOffset- The z offset of this bounding boxotherBoundingBox- The bounding box that is movingaxis- The axis of movementoffset- The current max offset- Returns:
- The new max offset
-
getIntersectionSize
Get the distance required to move this bounding box to one of otherBoundingBox's sides- Parameters:
otherBoundingBox- The stationary bounding boxside- The side of otherBoundingBox to snap this bounding box to- Returns:
- The distance to move in the direction of
side
-
clone
-
getMiddleX
public double getMiddleX() -
getMiddleY
public double getMiddleY() -
getMiddleZ
public double getMiddleZ() -
getSizeX
public double getSizeX() -
getSizeY
public double getSizeY() -
getSizeZ
public double getSizeZ() -
setMiddleX
public void setMiddleX(double middleX) -
setMiddleY
public void setMiddleY(double middleY) -
setMiddleZ
public void setMiddleZ(double middleZ) -
setSizeX
public void setSizeX(double sizeX) -
setSizeY
public void setSizeY(double sizeY) -
setSizeZ
public void setSizeZ(double sizeZ) -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-