public void BuildMesh(object data) { try { MeshDataGroup group = new MeshDataGroup(); for (int y = Position.y; y < Position.y + Chunk.Size; y++) { for (int z = Position.z; z < Position.z + Chunk.Size; z++) { for (int x = Position.x; x < Position.x + Chunk.Size; x++) { Block block = Map.GetBlock(x, y, z); if (block.ID != BlockID.Air) { block.Build(x, y, z, group.GetData(block.MeshIndex())); } } } } invisible = true; PreparedMeshInfo info = new PreparedMeshInfo(group, this); Map.ProcessMeshData(info); } catch (System.Exception e) { Logger.LogError("Error while building meshes.", e.Message, e.StackTrace); Engine.SignalQuit(); } }
public PreparedMeshInfo(MeshDataGroup data, Chunk chunk) { this.group = data; this.chunk = chunk; }