/** * Get the terrain tile at the specified XZ cell coordinate (not world coordinate). * @param cellCoordinate integer cell coordinates * @return the terrain tile at that location */ public Terrain getTerrainAtCell(Vector3f cellCoordinate) { return cache.get(cellCoordinate); }
@Override public Material getMaterial(Vector3f worldLocation) { if (worldLocation == null) return null; Vector3f tileCell = getTileCell(worldLocation); Terrain terrain = cache.get(tileCell); if (terrain == null) return null; // terrain not loaded for that cell yet! return terrain.getMaterial(worldLocation); }
/** * Get the terrain tile at the specified world location, in XZ coordinates. */ public Terrain getTerrainAt(Vector3f worldLocation) { if (worldLocation == null) return null; Vector3f tileCell = getTileCell(worldLocation.setY(0)); tileCell = new Vector3f(Math.round(tileCell.x), tileCell.y, Math.round(tileCell.z)); return cache.get(tileCell); }
cache.get(camCell.add(quadIndex[i * 4 + j]));
int quadIdx = i * 4 + j; final Vector3f quadCell = location.add(quadIndex[quadIdx]); TerrainQuad q = cache.get(quadCell); if (q == null) { if (gridTileLoader != null) {
/** * Get the terrain tile at the specified XZ cell coordinate (not world coordinate). * @param cellCoordinate integer cell coordinates * @return the terrain tile at that location */ public Terrain getTerrainAtCell(Vector3f cellCoordinate) { return cache.get(cellCoordinate); }
@Override public Material getMaterial(Vector3f worldLocation) { if (worldLocation == null) return null; Vector3f tileCell = getTileCell(worldLocation); Terrain terrain = cache.get(tileCell); if (terrain == null) return null; // terrain not loaded for that cell yet! return terrain.getMaterial(worldLocation); }
/** * Get the terrain tile at the specified world location, in XZ coordinates. */ public Terrain getTerrainAt(Vector3f worldLocation) { if (worldLocation == null) return null; Vector3f tileCell = getTileCell(worldLocation.setY(0)); tileCell = new Vector3f(Math.round(tileCell.x), tileCell.y, Math.round(tileCell.z)); return cache.get(tileCell); }
cache.get(camCell.add(quadIndex[i * 4 + j]));
int quadIdx = i * 4 + j; final Vector3f quadCell = location.add(quadIndex[quadIdx]); TerrainQuad q = cache.get(quadCell); if (q == null) { if (heightMapGrid != null) {