protected void updateLOD(final LodCalculator lodCalculator) { if (getSpatial() == null || camera == null) { return; } // update any existing ones that need updating updateQuadLODs(); if (updateLodOffCount(lodCalculator)) { return; } final Vector3f currentLocation = camera.getLocation(); if (!forceUpdate && previousCameraLocation.equals(currentLocation) && !lodCalculator.isLodOff()) { return; // don't update if in same spot } else { previousCameraLocation.set(currentLocation); } forceUpdate = false; if (!lodCalcRunning.compareAndSet(false, true)) { return; } prepareTerrain(); final TerrainExecutorService executorService = TerrainExecutorService.getInstance(); indexer = executorService.submit(createLodUpdateTask(singletonList(currentLocation), lodCalculator)); }