| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A solar system visualization. | 6 * A solar system visualization. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 library solar3d; | 9 library solar3d; |
| 10 | 10 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 /** | 258 /** |
| 259 * Display the animation's FPS in a div. | 259 * Display the animation's FPS in a div. |
| 260 */ | 260 */ |
| 261 void showFps(num fps) { | 261 void showFps(num fps) { |
| 262 if (fpsAverage == null) { | 262 if (fpsAverage == null) { |
| 263 fpsAverage = fps; | 263 fpsAverage = fps; |
| 264 } | 264 } |
| 265 | 265 |
| 266 fpsAverage = fps * 0.05 + fpsAverage * 0.95; | 266 fpsAverage = fps * 0.05 + fpsAverage * 0.95; |
| 267 | 267 |
| 268 query("#notes").text = "${fpsAverage.round().toInt()} fps"; | 268 query("#notes").text = "${fpsAverage.round()} fps"; |
| 269 } | 269 } |
| 270 | 270 |
| 271 /** | 271 /** |
| 272 * A representation of the solar system. | 272 * A representation of the solar system. |
| 273 * | 273 * |
| 274 * This class maintains a list of planetary bodies, knows how to draw its | 274 * This class maintains a list of planetary bodies, knows how to draw its |
| 275 * background and the planets, and requests that it be redraw at appropriate | 275 * background and the planets, and requests that it be redraw at appropriate |
| 276 * intervals using the [Window.requestAnimationFrame] method. | 276 * intervals using the [Window.requestAnimationFrame] method. |
| 277 */ | 277 */ |
| 278 class SolarSystem { | 278 class SolarSystem { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 print(log); | 526 print(log); |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 | 529 |
| 530 /** | 530 /** |
| 531 * The entry point to the application. | 531 * The entry point to the application. |
| 532 */ | 532 */ |
| 533 void main() { | 533 void main() { |
| 534 application.startup('#container'); | 534 application.startup('#container'); |
| 535 } | 535 } |
| OLD | NEW |