Class StructureBoundingBox
java.lang.Object
cn.nukkit.level.generator.populator.impl.structure.utils.math.StructureBoundingBox
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
expandTo
(StructureBoundingBox boundingBox) Changes this bounding box to the bounding box of the union of itself and another bounding box.getMax()
int
int
getMin()
int
int
boolean
intersectsWith
(int minX, int minZ, int maxX, int maxZ) Whether this box intersects the given vertically-infinite box.boolean
intersectsWith
(StructureBoundingBox boundingBox) Whether this box intersects the given box.boolean
Checks whether the given point is inside a block that intersects this box.void
offset
(BlockVector3 offset)
-
Constructor Details
-
StructureBoundingBox
-
-
Method Details
-
getMin
-
getMax
-
getMinChunkX
public int getMinChunkX() -
getMinChunkZ
public int getMinChunkZ() -
getMaxChunkX
public int getMaxChunkX() -
getMaxChunkZ
public int getMaxChunkZ() -
isVectorInside
Checks whether the given point is inside a block that intersects this box.- Parameters:
vec
- the point to check- Returns:
- true if this box intersects the block containing
vec
-
intersectsWith
Whether this box intersects the given box.- Parameters:
boundingBox
- the box to check intersection with- Returns:
- true if the given box intersects this box; false otherwise
-
intersectsWith
public boolean intersectsWith(int minX, int minZ, int maxX, int maxZ) Whether this box intersects the given vertically-infinite box.- Parameters:
minX
- the minimum X coordinateminZ
- the minimum Z coordinatemaxX
- the maximum X coordinatemaxZ
- the maximum Z coordinate- Returns:
- true if the given box intersects this box; false otherwise
-
expandTo
Changes this bounding box to the bounding box of the union of itself and another bounding box.- Parameters:
boundingBox
- the other bounding box to contain
-
offset
-