public abstract class VoxelShape extends Object
Modifier and Type | Field and Description |
---|---|
private VoxelShape[] |
shapeCache |
protected VoxelSet |
voxels |
Constructor and Description |
---|
VoxelShape(VoxelSet voxels) |
Modifier and Type | Method and Description |
---|---|
protected double |
calculateMaxDistance(AxisCycleDirection axisCycle,
Box box,
double maxDist) |
double |
calculateMaxDistance(Direction.Axis axis,
Box box,
double maxDist) |
protected boolean |
contains(double x,
double y,
double z) |
void |
forEachBox(VoxelShapes.BoxConsumer boxConsumer) |
void |
forEachEdge(VoxelShapes.BoxConsumer boxConsumer) |
Box |
getBoundingBox() |
List<Box> |
getBoundingBoxes() |
protected int |
getCoordIndex(Direction.Axis axis,
double coord) |
double |
getEndingCoord(Direction.Axis axis,
double from,
double to) |
VoxelShape |
getFace(Direction facing) |
double |
getMax(Direction.Axis axis) |
double |
getMin(Direction.Axis axis) |
protected double |
getPointPosition(Direction.Axis axis,
int index) |
protected abstract it.unimi.dsi.fastutil.doubles.DoubleList |
getPointPositions(Direction.Axis axis) |
private VoxelShape |
getUncachedFace(Direction facing) |
boolean |
isEmpty() |
VoxelShape |
offset(double x,
double y,
double z) |
BlockHitResult |
raycast(Vec3d start,
Vec3d end,
BlockPos pos) |
VoxelShape |
simplify() |
String |
toString() |
protected final VoxelSet voxels
@Nullable private VoxelShape[] shapeCache
VoxelShape(VoxelSet voxels)
public double getMin(Direction.Axis axis)
public double getMax(Direction.Axis axis)
public Box getBoundingBox()
protected double getPointPosition(Direction.Axis axis, int index)
protected abstract it.unimi.dsi.fastutil.doubles.DoubleList getPointPositions(Direction.Axis axis)
public boolean isEmpty()
public VoxelShape offset(double x, double y, double z)
public VoxelShape simplify()
@Environment(value=CLIENT) public void forEachEdge(VoxelShapes.BoxConsumer boxConsumer)
public void forEachBox(VoxelShapes.BoxConsumer boxConsumer)
@Environment(value=CLIENT) public double getEndingCoord(Direction.Axis axis, double from, double to)
protected int getCoordIndex(Direction.Axis axis, double coord)
protected boolean contains(double x, double y, double z)
@Nullable public BlockHitResult raycast(Vec3d start, Vec3d end, BlockPos pos)
public VoxelShape getFace(Direction facing)
private VoxelShape getUncachedFace(Direction facing)
public double calculateMaxDistance(Direction.Axis axis, Box box, double maxDist)
protected double calculateMaxDistance(AxisCycleDirection axisCycle, Box box, double maxDist)