legacy.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* eslint-disable @typescript-eslint/naming-convention */
  2. /* eslint-disable import/no-internal-modules */
  3. import * as BABYLON from "../index.js";
  4. import * as DebugImport from "../Debug/index.js";
  5. /**
  6. * Legacy support, defining window.BABYLON (global variable).
  7. *
  8. * This is the entry point for the UMD module.
  9. * The entry point for a future ESM package should be index.ts
  10. */
  11. const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
  12. if (typeof globalObject !== "undefined") {
  13. globalObject.BABYLON = globalObject.BABYLON || {};
  14. const BABYLONGLOBAL = globalObject.BABYLON;
  15. if (!BABYLONGLOBAL.Debug) {
  16. BABYLONGLOBAL.Debug = BABYLONGLOBAL.Debug || {};
  17. for (const key in DebugImport) {
  18. if (!BABYLONGLOBAL.Debug[key]) {
  19. BABYLONGLOBAL.Debug[key] = DebugImport[key];
  20. }
  21. }
  22. }
  23. for (const key in BABYLON) {
  24. if (!BABYLONGLOBAL[key]) {
  25. BABYLONGLOBAL[key] = BABYLON[key];
  26. }
  27. }
  28. }
  29. export * from "../index.js";
  30. export const Debug = {
  31. AxesViewer: BABYLON.AxesViewer,
  32. BoneAxesViewer: BABYLON.BoneAxesViewer,
  33. PhysicsViewer: BABYLON.PhysicsViewer,
  34. SkeletonViewer: BABYLON.SkeletonViewer,
  35. };
  36. //# sourceMappingURL=legacy.js.map