Skip to content

Commit

Permalink
Use actual radius for inverse and adjust inside region check (#2582)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirYwell committed Feb 18, 2024
1 parent c93ec87 commit f94b96d
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -141,7 +141,7 @@ public Vector2 getRadius() {
*/
public void setRadius(Vector2 radius) {
this.radius = radius.add(0.5, 0.5);
this.radiusInverse = Vector2.ONE.divide(radius);
this.radiusInverse = Vector2.ONE.divide(this.radius);
}

/**
Expand Down Expand Up @@ -413,11 +413,12 @@ public void filter(
final IChunk chunk, final Filter filter, final ChunkFilterBlock block,
final IChunkGet get, final IChunkSet set, boolean full
) {
int bcx = chunk.getX() >> 4;
int bcz = chunk.getZ() >> 4;
int bcx = chunk.getX() << 4;
int bcz = chunk.getZ() << 4;
int tcx = bcx + 15;
int tcz = bcz + 15;
if (contains(bcx, bcz) && contains(tcx, tcz)) {
// must contain all 4 corners for fast path
if (contains(bcx, bcz) && contains(tcx, tcz) && contains(bcx, tcz) && contains(tcx, bcz)) {
filter(chunk, filter, block, get, set, minY, maxY, full);
return;
}
Expand Down

0 comments on commit f94b96d

Please sign in to comment.