public class Box extends Object
Modifier and Type | Field and Description |
---|---|
double |
x1 |
double |
x2 |
double |
y1 |
double |
y2 |
double |
z1 |
double |
z2 |
Constructor and Description |
---|
Box(BlockPos pos) |
Box(BlockPos pos1,
BlockPos pos2) |
Box(double x1,
double y1,
double z1,
double x2,
double y2,
double z2) |
Box(Vec3d pos1,
Vec3d pos2) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x,
double y,
double z) |
boolean |
contains(Vec3d vec) |
Box |
contract(double value) |
boolean |
equals(Object o) |
Box |
expand(double value) |
Box |
expand(double x,
double y,
double z) |
static Box |
from(BlockBox mutable) |
double |
getAverageSideLength() |
Vec3d |
getCenter() |
double |
getMax(Direction.Axis axis) |
double |
getMin(Direction.Axis axis) |
double |
getXLength() |
double |
getYLength() |
double |
getZLength() |
int |
hashCode() |
Box |
intersection(Box box) |
boolean |
intersects(Box box) |
boolean |
intersects(double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ) |
boolean |
intersects(Vec3d from,
Vec3d to) |
boolean |
isValid() |
Box |
offset(BlockPos blockPos) |
Box |
offset(double x,
double y,
double z) |
Box |
offset(Vec3d vec3d) |
static BlockHitResult |
rayTrace(Iterable<Box> boxes,
Vec3d from,
Vec3d to,
BlockPos pos) |
Optional<Vec3d> |
rayTrace(Vec3d min,
Vec3d max) |
Box |
shrink(double x,
double y,
double z) |
Box |
stretch(double x,
double y,
double z) |
Box |
stretch(Vec3d scale) |
String |
toString() |
private static Direction |
traceCollisionSide(Box box,
Vec3d intersectingVector,
double[] traceDistanceResult,
Direction approachDirection,
double xDelta,
double yDelta,
double zDelta) |
private static Direction |
traceCollisionSide(double[] traceDistanceResult,
Direction approachDirection,
double xDelta,
double yDelta,
double zDelta,
double begin,
double minX,
double maxX,
double minZ,
double maxZ,
Direction resultDirection,
double startX,
double startY,
double startZ) |
Box |
union(Box box) |
public final double x1
public final double y1
public final double z1
public final double x2
public final double y2
public final double z2
public Box(double x1, double y1, double z1, double x2, double y2, double z2)
public Box(BlockPos pos)
public double getMin(Direction.Axis axis)
public double getMax(Direction.Axis axis)
public Box shrink(double x, double y, double z)
public Box stretch(double x, double y, double z)
public Box expand(double x, double y, double z)
public Box expand(double value)
public Box offset(double x, double y, double z)
public boolean intersects(Box box)
public boolean intersects(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
public boolean contains(Vec3d vec)
public boolean contains(double x, double y, double z)
public double getAverageSideLength()
public double getXLength()
public double getYLength()
public double getZLength()
public Box contract(double value)
@Nullable public static BlockHitResult rayTrace(Iterable<Box> boxes, Vec3d from, Vec3d to, BlockPos pos)
@Nullable private static Direction traceCollisionSide(Box box, Vec3d intersectingVector, double[] traceDistanceResult, @Nullable Direction approachDirection, double xDelta, double yDelta, double zDelta)
@Nullable private static Direction traceCollisionSide(double[] traceDistanceResult, @Nullable Direction approachDirection, double xDelta, double yDelta, double zDelta, double begin, double minX, double maxX, double minZ, double maxZ, Direction resultDirection, double startX, double startY, double startZ)
@Environment(value=CLIENT) public boolean isValid()
public Vec3d getCenter()