Examples of ChunkMesh


Examples of org.terasology.rendering.primitives.ChunkMesh

        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;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.