protected override MeshData FaceDataDown(Chunk chunk, int x, int y, int z, MeshData meshData)
        {
            meshData.AddVertex(new Vector3(x + blockSize, y - blockSize, z - blockSize));
            meshData.AddVertex(new Vector3(x - blockSize, y - blockSize, z - blockSize));
            meshData.AddVertex(new Vector3(x - blockSize, y - blockSize, z + blockSize));
            meshData.AddVertex(new Vector3(x + blockSize, y - blockSize, z + blockSize));

            meshData.AddQuadTriangles();
            return meshData;
        }
예제 #2
0
        protected virtual MeshData FaceDataWest(Chunk chunk, int x, int y, int z, MeshData meshData)
        {
            meshData.AddVertex(new Vector3(x - blockSize, y - blockSize, z + blockSize));
            meshData.AddVertex(new Vector3(x - blockSize, y + blockSize, z + blockSize));
            meshData.AddVertex(new Vector3(x - blockSize, y + blockSize, z - blockSize));
            meshData.AddVertex(new Vector3(x - blockSize, y - blockSize, z - blockSize));

            meshData.AddQuadTriangles();
            return meshData;
        }
예제 #3
0
        protected override MeshData FaceDataDown(Chunk chunk, int x, int y, int z, MeshData meshData)
        {
            meshData.AddVertex(new Vector3((x - treeOffset) - blockSize, y - (blockSize * treeHeight), (z - treeOffset) - blockSize));
            meshData.AddVertex(new Vector3((x - treeOffset) + blockSize, y - (blockSize * treeHeight), (z - treeOffset) - blockSize));
            meshData.AddVertex(new Vector3((x - treeOffset) + blockSize, y - (blockSize * treeHeight), (z - treeOffset) + blockSize));
            meshData.AddVertex(new Vector3((x - treeOffset) - blockSize, y - (blockSize * treeHeight), (z - treeOffset) + blockSize));

            meshData.AddQuadTriangles();

            meshData.AddVertex(new Vector3((x + treeOffset) - blockSize, y - (blockSize * treeHeight), z - blockSize));
            meshData.AddVertex(new Vector3((x + treeOffset) + blockSize, y - (blockSize * treeHeight), z - blockSize));
            meshData.AddVertex(new Vector3((x + treeOffset) + blockSize, y - (blockSize * treeHeight), z + blockSize));
            meshData.AddVertex(new Vector3((x + treeOffset) - blockSize, y - (blockSize * treeHeight), z + blockSize));

            meshData.AddQuadTriangles();

            meshData.AddVertex(new Vector3((x - treeOffset) - blockSize, y - (blockSize * treeHeight), z - blockSize));
            meshData.AddVertex(new Vector3((x - treeOffset) + blockSize, y - (blockSize * treeHeight), z - blockSize));
            meshData.AddVertex(new Vector3((x - treeOffset) + blockSize, y - (blockSize * treeHeight), z + blockSize));
            meshData.AddVertex(new Vector3((x - treeOffset) - blockSize, y - (blockSize * treeHeight), z + blockSize));

            meshData.AddQuadTriangles();

            meshData.AddVertex(new Vector3((x + treeOffset) - blockSize, y - (blockSize * treeHeight), (z + treeOffset) - blockSize));
            meshData.AddVertex(new Vector3((x + treeOffset) + blockSize, y - (blockSize * treeHeight), (z + treeOffset) - blockSize));
            meshData.AddVertex(new Vector3((x + treeOffset) + blockSize, y - (blockSize * treeHeight), (z + treeOffset) + blockSize));
            meshData.AddVertex(new Vector3((x + treeOffset) - blockSize, y - (blockSize * treeHeight), (z + treeOffset) + blockSize));

            meshData.AddQuadTriangles();
            return meshData;
        }