Class BoundingBox3i
java.lang.Object
dev.ryanhcode.sable.companion.math.BoundingBox3i
- All Implemented Interfaces:
BoundingBox3ic
An inclusive integer bounding box with JOML interaction.
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic com.mojang.serialization.Codec<BoundingBox3i> static final BoundingBox3icintintintintintint -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new bounding box with all values set to 0BoundingBox3i(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Creates a new bounding box with the given valuesBoundingBox3i(BoundingBox3d other) Creates a new bounding box with the given valuesBoundingBox3i(BoundingBox3ic other) Creates a new bounding box with the given valuesBoundingBox3i(net.minecraft.core.BlockPos min, net.minecraft.core.BlockPos max) Creates a new bounding box with the given valuesBoundingBox3i(net.minecraft.world.level.levelgen.structure.BoundingBox other) Creates a new bounding box with the given values -
Method Summary
Modifier and TypeMethodDescriptionbooleanexpand(int xExpansion, int yExpansion, int zExpansion) expandTo(int x, int y, int z) Expands this box to include the given pointexpandTo(BoundingBox3ic other) Expands this box to include the given boxexpandTo(org.joml.Vector3ic point) Expands this box to include the given pointstatic @Nullable BoundingBox3iinthashCode()intersect(BoundingBox3ic box) Calculates the bounding box intersect between this box and the specified box.intmaxX()intmaxY()intmaxZ()intminX()intminY()intminZ()move(int x, int y, int z) Translates this box by the given vectormove(org.joml.Vector3ic vec) Translates this box by the given vectorset(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Sets the bounding box to the given valuesset(BoundingBox3d other) Sets the bounding box to the given valuesset(BoundingBox3ic other) Sets the bounding box to the given valuessetUnchecked(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Sets the bounding box to the given values.setUnchecked(BoundingBox3ic other) Sets the bounding box to the given values.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.ryanhcode.sable.companion.math.BoundingBox3ic
center, chunkBoundsFrom, chunkBoundsFrom, contains, contains, contains, expandTo, expandTo, expandTo, height, intersect, intersects, intersects, intersects, length, move, move, size, toAABB, toMojang, volume, width
-
Field Details
-
EMPTY
-
CODEC
-
minX
public int minX -
minY
public int minY -
minZ
public int minZ -
maxX
public int maxX -
maxY
public int maxY -
maxZ
public int maxZ
-
-
Constructor Details
-
BoundingBox3i
public BoundingBox3i(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Creates a new bounding box with the given values -
BoundingBox3i
public BoundingBox3i(net.minecraft.core.BlockPos min, net.minecraft.core.BlockPos max) Creates a new bounding box with the given values -
BoundingBox3i
Creates a new bounding box with the given values -
BoundingBox3i
public BoundingBox3i(net.minecraft.world.level.levelgen.structure.BoundingBox other) Creates a new bounding box with the given values -
BoundingBox3i
public BoundingBox3i()Creates a new bounding box with all values set to 0 -
BoundingBox3i
Creates a new bounding box with the given values
-
-
Method Details
-
from
-
set
Sets the bounding box to the given values -
set
Sets the bounding box to the given values -
set
@Contract(value="_,_,_,_,_,_->this", mutates="this") public BoundingBox3i set(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Sets the bounding box to the given values -
setUnchecked
@Contract(value="_,_,_,_,_,_->this", mutates="this") public BoundingBox3i setUnchecked(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Sets the bounding box to the given values.
Does NOT automatically swap mins/maxes if swapped. -
setUnchecked
Sets the bounding box to the given values.
Does NOT automatically swap mins/maxes if swapped. -
expand
@Contract(value="_,_,_->this", mutates="this") public BoundingBox3i expand(int xExpansion, int yExpansion, int zExpansion) -
expandTo
Expands this box to include the given point- Parameters:
point- the point to include- Returns:
- the result stored in this
-
expandTo
Expands this box to include the given point- Parameters:
x- the x value of the pointy- the y value of the pointz- the z value of the point- Returns:
- the result stored in this
-
expandTo
Expands this box to include the given box- Parameters:
other- the box to include- Returns:
- the result stored in this
-
move
Translates this box by the given vector- Parameters:
vec- the vector to translate by- Returns:
- the result stored in this
-
move
Translates this box by the given vector- Parameters:
x- the x value of the vectory- the y value of the vectorz- the z value of the vector- Returns:
- the result stored in this
-
intersect
Calculates the bounding box intersect between this box and the specified box.- Parameters:
box- The box to intersect with- Returns:
- the result stored in this
-
minX
public int minX()- Specified by:
minXin interfaceBoundingBox3ic- Returns:
- the minimum x value of this box
-
minY
public int minY()- Specified by:
minYin interfaceBoundingBox3ic- Returns:
- the minimum y value of this box
-
minZ
public int minZ()- Specified by:
minZin interfaceBoundingBox3ic- Returns:
- the minimum z value of this box
-
maxX
public int maxX()- Specified by:
maxXin interfaceBoundingBox3ic- Returns:
- the maximum x value of this box
-
maxY
public int maxY()- Specified by:
maxYin interfaceBoundingBox3ic- Returns:
- the maximum y value of this box
-
maxZ
public int maxZ()- Specified by:
maxZin interfaceBoundingBox3ic- Returns:
- the maximum z value of this box
-
equals
-
hashCode
public int hashCode() -
toString
-