Skip to content

Commit

Permalink
Fix some custom frustums not overriding Sodium's fastAabbTest
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbot16 committed Sep 4, 2021
1 parent 67b12ac commit 51b4c58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public CullEverythingFrustum() {
super(new Matrix4f(), new Matrix4f());
}

// for Sodium
public boolean fastAabbTest(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
return false;
}

public boolean isVisible(Box box) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void setPosition(double cameraX, double cameraY, double cameraZ) {

// for Sodium
// TODO: Better way to do this... Maybe we shouldn't be using a frustum for the box culling in the first place!
public boolean preAabbTest(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
public boolean fastAabbTest(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
return !boxCuller.isCulled(minX, minY, minZ, maxX, maxY, maxZ);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public NonCullingFrustum() {
super(new Matrix4f(), new Matrix4f());
}

// for Sodium
public boolean fastAabbTest(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
return true;
}

public boolean isVisible(Box box) {
return true;
}
Expand Down

0 comments on commit 51b4c58

Please sign in to comment.