Skip to content

Commit

Permalink
fix frustrum culling using wrong bounding box
Browse files Browse the repository at this point in the history
  • Loading branch information
Glease committed Sep 9, 2022
1 parent df4c54e commit 9bd19b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/gtnewhorizon/structurelib/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ public int getCreationTime() {

private static class HintParticleInfo {
private final World w;
// these are the block coordinate for e.g. w.getBlock()
private final int x, y, z;
// these are the lower bounds for rendering. the upper bound would be X + size
// currently size is fixed to be 0.5
// it is not made into a constants because this will allow for easy changing during debug
private final double X, Y, Z;
private final IIcon[] icons;
private short[] tint;
Expand Down Expand Up @@ -319,7 +323,7 @@ public int hashCode() {
}

public boolean isInFrustrum(Frustrum frustrum) {
return frustrum.isBoxInFrustum(x, y, z, X, Y, Z);
return frustrum.isBoxInFrustum(X, Y, Z, X + 0.5, Y + 0.5, Z + 0.5);
}

public void draw(Tessellator tes) {
Expand Down

0 comments on commit 9bd19b9

Please sign in to comment.