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; }
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; }
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; }