int indices = 0;
int timeToGenerateBlockVertices = 0;
int timeToGenerateOptimizedBuffers = 0;
for (int i = 0; i < mesh.length; i++) {
final ChunkMesh segment = checkNotNull(mesh[i], "Chunk mesh segment #" + i + " must not be null");
if (!segment.isGenerated()) {
for (ChunkMesh.RenderType type : ChunkMesh.RenderType.values()) {
final ChunkMesh.VertexElements element = segment.getVertexElements(type);
vertices += element.finalVertices.limit();
indices += element.finalIndices.limit();
}
}
timeToGenerateBlockVertices += segment.getTimeToGenerateBlockVertices();
timeToGenerateOptimizedBuffers += segment.getTimeToGenerateOptimizedBuffers();
}
this.totalFinalVertices = vertices;
this.totalFinalIndices = indices;
this.totalTriangles = indices / 3;