index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. class Index {
  2. constructor() {
  3. this.examples = new Examples(this);
  4. this.utils = new Utils(this);
  5. this.monacoCreator = new MonacoCreator(this);
  6. this.settingsPG = new SettingsPG(this);
  7. this.menuPG = new MenuPG(this);
  8. this.zipTool = new ZipTool(this);
  9. this.main = new Main(this);
  10. /**
  11. * View split
  12. */
  13. this.splitInstance = Split(['#jsEditor', '#canvasZone']);
  14. /**
  15. * Run the main script
  16. */
  17. this.main.initialize();
  18. }
  19. }
  20. index = new Index();
  21. // defeinsive, in case there was an error loading babylon.js
  22. // This is done so that search bots will still be able to render the page, even when babylon had a problem while downloading
  23. if (!window.BABYLON) {
  24. window.BABYLON = {
  25. Vector3: function () {},
  26. Vector2: function () {},
  27. Mesh: function () {},
  28. Matrix: function () {},
  29. GLTF2: {
  30. GLTFLoader: {
  31. RegisterExtension: function () {}
  32. }
  33. },
  34. SceneLoader: {
  35. OnPluginActivatedObservable: {
  36. add: function () {}
  37. }
  38. }
  39. }
  40. BABYLON.Vector3.Up = function () {};
  41. BABYLON.Vector3.Zero = function () {};
  42. BABYLON.Vector2.Zero = function () {};
  43. BABYLON.Matrix.Zero = function () {};
  44. }