legacy.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import * as Babylon from "../index";
  2. import * as DebugImport from "../Debug/index";
  3. declare var global: any;
  4. /**
  5. * Legacy support, defining window.BABYLON (global variable).
  6. *
  7. * This is the entry point for the UMD module.
  8. * The entry point for a future ESM package should be index.ts
  9. */
  10. var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
  11. if (typeof globalObject !== "undefined") {
  12. (<any>globalObject).BABYLON = BABYLON;
  13. (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};
  14. var BABYLON = (<any>globalObject).BABYLON;
  15. BABYLON.Debug = BABYLON.Debug || {};
  16. const keys = [];
  17. for (var key in DebugImport) {
  18. BABYLON.Debug[key] = (<any>DebugImport)[key];
  19. keys.push(key);
  20. }
  21. for (var key in Babylon) {
  22. BABYLON[key] = (<any>Babylon)[key];
  23. }
  24. }
  25. export * from "../index";
  26. export const Debug = {
  27. AxesViewer: DebugImport.AxesViewer,
  28. BoneAxesViewer: DebugImport.BoneAxesViewer,
  29. PhysicsViewer: DebugImport.PhysicsViewer,
  30. SkeletonViewer: DebugImport.SkeletonViewer,
  31. };