re-enable aabb

This commit is contained in:
NULL511
2024-01-25 19:27:52 -05:00
parent e771f8a53c
commit 08483d02c6
2 changed files with 6 additions and 5 deletions
@@ -1,6 +1,5 @@
package com.seibel.distanthorizons.core.pos;
import com.seibel.distanthorizons.coreapi.util.math.Mat4f;
import org.joml.FrustumIntersection;
import org.joml.Matrix4f;
import org.joml.Matrix4fc;
@@ -36,9 +35,9 @@ public class DhFrustumBounds
Vector3f lodMin = new Vector3f(lodPosX, worldMinY, lodPosZ);
Vector3f lodMax = new Vector3f(lodPosX + lodSize, worldMaxY, lodPosZ + lodSize);
//if (lodMax.x < this.boundsMin.x || lodMin.x > this.boundsMax.x) return false;
//if (lodMax.z < this.boundsMin.z || lodMin.z > this.boundsMax.z) return false;
//if (this.worldMaxY < this.boundsMin.y || this.worldMinY > this.boundsMax.y) return false;
if (lodMax.x < this.boundsMin.x || lodMin.x > this.boundsMax.x) return false;
if (lodMax.z < this.boundsMin.z || lodMin.z > this.boundsMax.z) return false;
if (this.worldMaxY < this.boundsMin.y || this.worldMinY > this.boundsMax.y) return false;
return frustum.testAab(lodMin, lodMax);
}
@@ -332,7 +332,7 @@ public class LodRenderer
if (renderingFirstPass)
{
Vec3f viewDir = this.getLookVector();
Vec3f viewDir = MC_RENDER.getLookAtVector();
Vec3d viewPos = MC_RENDER.getCameraExactPosition();
// TODO: find proper way to get view matrix, this breaks when perfectly up/down
@@ -340,6 +340,8 @@ public class LodRenderer
.setTransposed(projectionMatrix.getValuesAsArray())
.lookAlong(viewDir.x, viewDir.y, viewDir.z, 0f, 1f, 0f)
.translate(-(float)viewPos.x, -(float)viewPos.y, -(float)viewPos.z);
// TODO: will also need a diff matrix for iris shadow pass!
this.bufferHandler.buildRenderListAndUpdateSections(clientLevelWrapper, matViewProjection, viewDir);