/** Redraws the sky shading gradient using the model's current time. */ protected void redraw() { Date modelTime = model.getTime(); if (Math.abs(modelTime.getTime() - lastUpdateTimeMs) > UPDATE_FREQUENCY_MS) { lastUpdateTimeMs = modelTime.getTime(); RaDec sunPosition = SolarPositionCalculator.getSolarPosition(modelTime); // Log.d(TAG, "Enabling sky gradient with sun position " + sunPosition); rendererLock.lock(); try { renderer.queueEnableSkyGradient(GeocentricCoordinates.getInstance(sunPosition)); } finally { rendererLock.unlock(); } } }