public class AxisAlignedBB
extends java.lang.Object
修飾子とタイプ | フィールドと説明 |
---|---|
double |
maxX |
double |
maxY |
double |
maxZ |
double |
minX |
double |
minY |
double |
minZ |
コンストラクタと説明 |
---|
AxisAlignedBB(BlockPos pos) |
AxisAlignedBB(BlockPos pos1,
BlockPos pos2) |
AxisAlignedBB(double x1,
double y1,
double z1,
double x2,
double y2,
double z2) |
AxisAlignedBB(Vec3d min,
Vec3d max) |
修飾子とタイプ | メソッドと説明 |
---|---|
boolean |
contains(double x,
double y,
double z) |
boolean |
contains(Vec3d vec)
Returns if the supplied Vec3D is completely inside the bounding box
|
AxisAlignedBB |
contract(double x,
double y,
double z)
Creates a new
AxisAlignedBB that has been contracted by the given amount, with positive changes decreasing
max values and negative changes increasing min values. |
boolean |
equals(java.lang.Object p_equals_1_) |
AxisAlignedBB |
expand(double x,
double y,
double z)
Creates a new
AxisAlignedBB that has been expanded by the given amount, with positive changes increasing
max values and negative changes decreasing min values. |
AxisAlignedBB |
expand(Vec3d p_216361_1_) |
double |
getAverageEdgeLength()
Returns the average length of the edges of the bounding box.
|
Vec3d |
getCenter() |
double |
getMax(Direction.Axis axis) |
double |
getMin(Direction.Axis axis) |
double |
getXSize() |
double |
getYSize() |
double |
getZSize() |
AxisAlignedBB |
grow(double value)
Creates a new
AxisAlignedBB that is expanded by the given value in all directions. |
AxisAlignedBB |
grow(double x,
double y,
double z)
Creates a new
AxisAlignedBB that has been contracted by the given amount in both directions. |
int |
hashCode() |
boolean |
hasNaN() |
AxisAlignedBB |
intersect(AxisAlignedBB other) |
boolean |
intersects(AxisAlignedBB other)
Checks if the bounding box intersects with another.
|
boolean |
intersects(double x1,
double y1,
double z1,
double x2,
double y2,
double z2) |
boolean |
intersects(Vec3d min,
Vec3d max) |
AxisAlignedBB |
offset(BlockPos pos) |
AxisAlignedBB |
offset(double x,
double y,
double z)
Offsets the current bounding box by the specified amount.
|
AxisAlignedBB |
offset(Vec3d vec) |
static BlockRayTraceResult |
rayTrace(java.lang.Iterable<AxisAlignedBB> boxes,
Vec3d start,
Vec3d end,
BlockPos pos) |
java.util.Optional<Vec3d> |
rayTrace(Vec3d p_216365_1_,
Vec3d p_216365_2_) |
AxisAlignedBB |
shrink(double value)
Creates a new
AxisAlignedBB that is expanded by the given value in all directions. |
static AxisAlignedBB |
toImmutable(MutableBoundingBox p_216363_0_) |
java.lang.String |
toString() |
AxisAlignedBB |
union(AxisAlignedBB other) |
public final double minX
public final double minY
public final double minZ
public final double maxX
public final double maxY
public final double maxZ
public AxisAlignedBB(double x1, double y1, double z1, double x2, double y2, double z2)
public AxisAlignedBB(BlockPos pos)
public static AxisAlignedBB toImmutable(MutableBoundingBox p_216363_0_)
public double getMin(Direction.Axis axis)
public double getMax(Direction.Axis axis)
public boolean equals(java.lang.Object p_equals_1_)
equals
クラス内 java.lang.Object
public int hashCode()
hashCode
クラス内 java.lang.Object
public AxisAlignedBB contract(double x, double y, double z)
AxisAlignedBB
that has been contracted by the given amount, with positive changes decreasing
max values and negative changes increasing min values.
Input | Result |
---|---|
| box[0.0, 0.0, 0.0 -> 2.0, 2.0, 2.0] |
| box[2.0, 2.0, 2.0 -> 4.0, 4.0, 4.0] |
| box[5.0, 5.0, 6.0 -> 7.0, 6.0, 7.0] |
| box[- 8.0, 2.0, -2.0 -> -2.0, 8.0, 2.0] |
expand(double, double, double)
- like this, except for expanding.grow(double, double, double)
and grow(double)
- expands in all directions.shrink(double)
- contracts in all directions (like grow(double)
)public AxisAlignedBB expand(Vec3d p_216361_1_)
public AxisAlignedBB expand(double x, double y, double z)
AxisAlignedBB
that has been expanded by the given amount, with positive changes increasing
max values and negative changes decreasing min values.
Input | Result | |
---|---|---|
| box[0, 0, 0 -> 3, 3, 3] | |
| box[-2, -2, -2 -> 1, 1, 1] | |
| box[5, 5, 4, 7, 8, 7] |
contract(double, double, double)
- like this, except for shrinking.grow(double, double, double)
and grow(double)
- expands in all directions.shrink(double)
- contracts in all directions (like grow(double)
)public AxisAlignedBB grow(double x, double y, double z)
AxisAlignedBB
that has been contracted by the given amount in both directions. Negative
values will shrink the AABB instead of expanding it.
Input | Result |
---|---|
| box[-2.0, - 2.0, -2.0 -> 3.0, 3.0, 3.0] |
| box[2.0, 2.0, 2.0 -> 4.0, 4.0, 4.0] |
| box[5.0, 4.0, 6.0 -> 7.0, 8.0, 6.0] |
| box[-1.0, 1.0, 0.0 -> 5.0, 3.0, 4.0] |
expand(double, double, double)
- expands in only one direction.contract(double, double, double)
- contracts in only one direction.grow(double)
- version of this that expands in all directions from one parameter.
shrink(double)
- contracts in all directionspublic AxisAlignedBB grow(double value)
AxisAlignedBB
that is expanded by the given value in all directions. Equivalent to grow(double, double, double)
with the given value for all 3 params. Negative values will shrink the AABB.
grow(double, double, double)
).public AxisAlignedBB intersect(AxisAlignedBB other)
public AxisAlignedBB union(AxisAlignedBB other)
public AxisAlignedBB offset(double x, double y, double z)
public AxisAlignedBB offset(BlockPos pos)
public AxisAlignedBB offset(Vec3d vec)
public boolean intersects(AxisAlignedBB other)
public boolean intersects(double x1, double y1, double z1, double x2, double y2, double z2)
public boolean contains(Vec3d vec)
public boolean contains(double x, double y, double z)
public double getAverageEdgeLength()
public double getXSize()
public double getYSize()
public double getZSize()
public AxisAlignedBB shrink(double value)
AxisAlignedBB
that is expanded by the given value in all directions. Equivalent to grow(double)
with value set to the negative of the value provided here. Passing a negative value to this method
values will grow the AABB.
grow(double, double, double)
).@Nullable public static BlockRayTraceResult rayTrace(java.lang.Iterable<AxisAlignedBB> boxes, Vec3d start, Vec3d end, BlockPos pos)
public java.lang.String toString()
toString
クラス内 java.lang.Object
public boolean hasNaN()
public Vec3d getCenter()