Class FacesMeshGenerator

java.lang.Object
com.rvandoosselaer.blocks.FacesMeshGenerator
All Implemented Interfaces:
ChunkMeshGenerator

public class FacesMeshGenerator extends Object implements ChunkMeshGenerator
A chunk mesh generator that creates and combines a quad mesh for each of the visible faces of a block of the same type. In short, the chunk is traversed and all faces that are not visible will not be added to the final mesh. Some extra bookkeeping is done to scan through the neighbours of each block. One geometry is created per type of the block in the chunk. The geometry is attached to the node, and the node is positioned based on the location of the chunk.