public Terrain(int blocksPerRow, float scale, float minY, float maxY, String heightMap, String textureFile, int textInc) throws Exception { gameItems = new GameItem[blocksPerRow * blocksPerRow]; HeightMapMesh heightMapMesh = new HeightMapMesh(minY, maxY, heightMap, textureFile, textInc); for (int row = 0; row < blocksPerRow; row++) { for (int col = 0; col < blocksPerRow; col++) { float xDisplacement = (col - ((float) blocksPerRow - 1) / (float) 2) * scale * HeightMapMesh.getXLength(); float zDisplacement = (row - ((float) blocksPerRow - 1) / (float) 2) * scale * HeightMapMesh.getZLength(); GameItem terrainBlock = new GameItem(heightMapMesh.getMesh()); terrainBlock.setScale(scale); terrainBlock.setPosition(xDisplacement, 0, zDisplacement); gameItems[row * blocksPerRow + col] = terrainBlock; } } }
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, buf, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, decodedImage, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, decodedImage, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {
verticesPerRow = height - 1; heightMapMesh = new HeightMapMesh(minY, maxY, decodedImage, width, height, textureFile, textInc); boundingBoxes = new Box2D[terrainSize][terrainSize]; for (int row = 0; row < terrainSize; row++) {