}
}
public void addModelToScene() {
OctreeRoot octree = block.getOctree();
Mesh mesh = new Mesh();
MeshData meshData = mesh.getMeshData();
int numOfQuads = quads.size();
int numOfVoxels = voxelCounter;
FloatBuffer vertexBuffer = BufferUtils.createVector3Buffer(numOfVoxels);
IntBuffer indexBuffer = BufferUtils.createIntBuffer(numOfQuads * 6);
FloatBuffer normalBuffer = BufferUtils.createVector3Buffer(numOfVoxels);
// FloatBuffer texCoordBuffer = BufferUtils.createVector2Buffer(numOfVoxels);
FloatBuffer colorBuffer = BufferUtils.createColorBuffer(numOfVoxels);
ArrayList<Integer> verticesWithGrass = new ArrayList<Integer>();
int blockSize = VoxelWorld.BLOCK_SIZE;
for (int x = 0; x < blockSize + 1; x++) {
for (int y = 0; y < blockSize + 1; y++) {
for (int z = 0; z < blockSize + 1; z++) {
Voxel voxel = voxels[x][y][z];
if (voxel != null) {
voxel.summarize();
octree.insertVertex(x, y, z, voxel.index);
int i3 = voxel.index * 3;
vertexBuffer.put(i3+0, voxel.vertexPosition.getXf());
vertexBuffer.put(i3+1, voxel.vertexPosition.getYf());