@Override public void doFrame(long frameTimeNanos) { if (this.lastFrameTimeNanos != 0) { // Compute the frame duration in seconds. double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9; double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond); // Move the navigator to continuously bring new tiles into view. Navigator navigator = getWorldWindow().getNavigator(); navigator.setLongitude(navigator.getLongitude() + cameraDegrees); // Redraw the WorldWindow to display the above changes. this.getWorldWindow().requestRedraw(); } Choreographer.getInstance().postFrameCallback(this); this.lastFrameTimeNanos = frameTimeNanos; }
@Override public void doFrame(long frameTimeNanos) { if (this.lastFrameTimeNanos != 0) { // Compute the frame duration in seconds. double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9; double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond); // Move the navigator to simulate the Earth's rotation about its axis. Navigator navigator = getWorldWindow().getNavigator(); navigator.setLongitude(navigator.getLongitude() - cameraDegrees); // Redraw the WorldWindow to display the above changes. this.getWorldWindow().requestRedraw(); } if (!this.activityPaused) { // stop animating when this Activity is paused Choreographer.getInstance().postFrameCallback(this); } this.lastFrameTimeNanos = frameTimeNanos; }
@Override public void doFrame(long frameTimeNanos) { if (this.lastFrameTimeNanos != 0) { // Compute the frame duration in seconds. double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9; double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond); // Move the navigator to simulate the Earth's rotation about its axis. Navigator navigator = getWorldWindow().getNavigator(); navigator.setLongitude(navigator.getLongitude() - cameraDegrees); // Redraw the WorldWindow to display the above changes. this.getWorldWindow().requestRedraw(); } if (!this.activityPaused) { // stop animating when this Activity is paused Choreographer.getInstance().postFrameCallback(this); } this.lastFrameTimeNanos = frameTimeNanos; }
@Override public void doFrame(long frameTimeNanos) { if (this.lastFrameTimeNanos != 0) { // Compute the frame duration in seconds. double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9; double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond); double lightDegrees = (frameDurationSeconds * this.lightDegreesPerSecond); // Move the navigator to simulate the Earth's rotation about its axis. Navigator navigator = getWorldWindow().getNavigator(); navigator.setLongitude(navigator.getLongitude() - cameraDegrees); // Move the sun location to simulate the Sun's rotation about the Earth. this.sunLocation.set(this.sunLocation.latitude, this.sunLocation.longitude - lightDegrees); this.atmosphereLayer.setLightLocation(this.sunLocation); // Redraw the WorldWindow to display the above changes. this.getWorldWindow().requestRedraw(); } if (!this.activityPaused) { // stop animating when this Activity is paused Choreographer.getInstance().postFrameCallback(this); } this.lastFrameTimeNanos = frameTimeNanos; }