rename DhLodPos .getX/Z -> getMinX/Z

This commit is contained in:
James Seibel
2024-02-06 21:44:30 -06:00
parent 1859d0ea96
commit 0cfdf8f57e
2 changed files with 9 additions and 7 deletions
@@ -55,8 +55,10 @@ public class DhLodPos implements Comparable<DhLodPos>
// getters //
//=========//
public DhLodUnit getX() { return new DhLodUnit(this.detailLevel, this.x); }
public DhLodUnit getZ() { return new DhLodUnit(this.detailLevel, this.z); }
/** gets the X position closest to negative infinity */
public DhLodUnit getMinX() { return new DhLodUnit(this.detailLevel, this.x); }
/** gets the Z position closest to negative infinity */
public DhLodUnit getMinZ() { return new DhLodUnit(this.detailLevel, this.z); }
// Get the width of this pos, measured in the mc block unit. (i.e. detail 0)
public int getBlockWidth() { return this.getWidthAtDetail((byte) 0); }
@@ -71,10 +73,10 @@ public class DhLodPos implements Comparable<DhLodPos>
public DhBlockPos2D getCenterBlockPos()
{
return new DhBlockPos2D(
this.getX().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth()),
this.getZ().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth()));
this.getMinX().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth()),
this.getMinZ().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth()));
}
public DhBlockPos2D getCornerBlockPos() { return new DhBlockPos2D(this.getX().toBlockWidth(), this.getZ().toBlockWidth()); }
public DhBlockPos2D getCornerBlockPos() { return new DhBlockPos2D(this.getMinX().toBlockWidth(), this.getMinZ().toBlockWidth()); }
/** converts this position to a lower detail level, angled towards the corner position. */
public DhLodPos getCornerLodPos(byte newDetail)
@@ -281,8 +281,8 @@ public class RenderBufferHandler implements AutoCloseable
if (enableFrustumCulling)
{
DhLodPos lodBounds = renderSection.pos.getSectionBBoxPos();
int blockMinX = lodBounds.getX().toBlockWidth();
int blockMinZ = lodBounds.getZ().toBlockWidth();
int blockMinX = lodBounds.getMinX().toBlockWidth();
int blockMinZ = lodBounds.getMinZ().toBlockWidth();
int lodBlockWidth = lodBounds.getBlockWidth();
if (!frustum.intersects(blockMinX, blockMinZ, lodBlockWidth, lodBounds.detailLevel))
{