Skip to content

Commit

Permalink
updated terrain engine
Browse files Browse the repository at this point in the history
  • Loading branch information
macbury committed Nov 15, 2014
1 parent 88d784f commit 3e3e035
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions core/src/macbury/forge/terrain/TerrainEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,12 @@ private void occulsion() {
Chunk visibleChunk = (Chunk) tempObjects.pop();
if (visibleChunk.renderables.size > 0) {
visibleChunks.add(visibleChunk);
boolean visibleFront = false;
//TODO: if i can see front face, that means i cant see back face, if i can see right face that means i cant see left face
for (int i = 0; i < visibleChunk.renderables.size; i++) {
VoxelFaceRenderable renderable = visibleChunk.renderables.get(i);
/*if (renderable.direction.epsilonEquals(TerrainBuilder.Face.Front.direction, 0.1f)) {
visibleFront = true;
}
if (visibleFront && renderable.direction.equals(TerrainBuilder.Face.Back)) {
} else {
visibleFaces.add(renderable);
}*/

if (camera.boundsInFrustum(renderable.boundingBox)) {
//http://www.gamasutra.com/view/feature/131773/a_compact_method_for_backface_.php?print=1
if (camera.boundsInFrustum(renderable.boundingBox) && tempA.set(camera.normalOrDebugPosition()).sub(visibleChunk.worldPosition).dot(renderable.direction) >= 0f) {
visibleFaces.add(renderable);
}
//visibleFaces.add(renderable);
}
}
}
Expand Down

0 comments on commit 3e3e035

Please sign in to comment.