public TerrainQuad getTerrainQuadAt(Vector3f location) { String modelName = assetPath + "/" + name + "_" + Math.round(location.x) + "_" + Math.round(location.y) + "_" + Math.round(location.z) + ".j3o"; Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Load terrain grid tile: {0}", modelName); TerrainQuad quad = null; try { quad = (TerrainQuad) manager.loadModel(modelName); } catch (Exception e) { // e.printStackTrace(); } if (quad == null) { Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Could not load terrain grid tile: {0}", modelName); quad = createNewQuad(location); } else { Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Loaded terrain grid tile: {0}", modelName); } return quad; }
AssetTileLoader grid = new AssetTileLoader(assetManager, "testgrid", "TerrainGrid"); this.terrain = new TerrainGrid("terrain", 65, 257, grid);
public TerrainQuad getTerrainQuadAt(Vector3f location) { String modelName = assetPath + "/" + name + "_" + Math.round(location.x) + "_" + Math.round(location.y) + "_" + Math.round(location.z) + ".j3o"; Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Load terrain grid tile: {0}", modelName); TerrainQuad quad = null; try { quad = (TerrainQuad) manager.loadModel(modelName); } catch (Exception e) { // e.printStackTrace(); } if (quad == null) { Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Could not load terrain grid tile: {0}", modelName); quad = createNewQuad(location); } else { Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Loaded terrain grid tile: {0}", modelName); } return quad; }