Source: Scene/SceneMode.js

  1. /*global define*/
  2. define([
  3. '../Core/freezeObject'
  4. ], function(
  5. freezeObject) {
  6. 'use strict';
  7. /**
  8. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  9. *
  10. * @exports SceneMode
  11. *
  12. * @see Scene#mode
  13. */
  14. var SceneMode = {
  15. /**
  16. * Morphing between mode, e.g., 3D to 2D.
  17. *
  18. * @type {Number}
  19. * @constant
  20. */
  21. MORPHING : 0,
  22. /**
  23. * Columbus View mode. A 2.5D perspective view where the map is laid out
  24. * flat and objects with non-zero height are drawn above it.
  25. *
  26. * @type {Number}
  27. * @constant
  28. */
  29. COLUMBUS_VIEW : 1,
  30. /**
  31. * 2D mode. The map is viewed top-down with an orthographic projection.
  32. *
  33. * @type {Number}
  34. * @constant
  35. */
  36. SCENE2D : 2,
  37. /**
  38. * 3D mode. A traditional 3D perspective view of the globe.
  39. *
  40. * @type {Number}
  41. * @constant
  42. */
  43. SCENE3D : 3
  44. };
  45. /**
  46. * Returns the morph time for the given scene mode.
  47. *
  48. * @param {SceneMode} value The scene mode
  49. * @returns {Number} The morph time
  50. */
  51. SceneMode.getMorphTime = function(value) {
  52. if (value === SceneMode.SCENE3D) {
  53. return 1.0;
  54. } else if (value === SceneMode.MORPHING) {
  55. return undefined;
  56. }
  57. return 0.0;
  58. };
  59. return freezeObject(SceneMode);
  60. });