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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 /** | 264 /** |
265 * Display the animation's FPS in a div. | 265 * Display the animation's FPS in a div. |
266 */ | 266 */ |
267 void showFps(num fps) { | 267 void showFps(num fps) { |
268 if (fpsAverage == null) { | 268 if (fpsAverage == null) { |
269 fpsAverage = fps; | 269 fpsAverage = fps; |
270 } | 270 } |
271 | 271 |
272 fpsAverage = fps * 0.05 + fpsAverage * 0.95; | 272 fpsAverage = fps * 0.05 + fpsAverage * 0.95; |
273 | 273 |
274 query("#notes").text = "${fpsAverage.round().toInt()} fps"; | 274 query("#notes").text = "${fpsAverage.round()} fps"; |
275 } | 275 } |
276 | 276 |
277 /** | 277 /** |
278 * A representation of the solar system. | 278 * A representation of the solar system. |
279 * | 279 * |
280 * This class maintains a list of planetary bodies, knows how to draw its | 280 * This class maintains a list of planetary bodies, knows how to draw its |
281 * background and the planets, and requests that it be redraw at appropriate | 281 * background and the planets, and requests that it be redraw at appropriate |
282 * intervals using the [Window.requestAnimationFrame] method. | 282 * intervals using the [Window.requestAnimationFrame] method. |
283 */ | 283 */ |
284 class SolarSystem { | 284 class SolarSystem { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 print(log); | 532 print(log); |
533 } | 533 } |
534 } | 534 } |
535 | 535 |
536 /** | 536 /** |
537 * The entry point to the application. | 537 * The entry point to the application. |
538 */ | 538 */ |
539 void main() { | 539 void main() { |
540 application.startup('#container'); | 540 application.startup('#container'); |
541 } | 541 } |
OLD | NEW |