legacy-glTF2.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* eslint-disable import/no-internal-modules */
  2. import * as Extensions from "../glTF/2.0/Extensions/index.js";
  3. import * as Interfaces from "../glTF/2.0/glTFLoaderInterfaces.js";
  4. import * as GLTF2 from "../glTF/2.0/index.js";
  5. /**
  6. * This is the entry point for the UMD module.
  7. * The entry point for a future ESM package should be index.ts
  8. */
  9. const globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
  10. if (typeof globalObject !== "undefined") {
  11. globalObject.BABYLON = globalObject.BABYLON || {};
  12. const BABYLON = globalObject.BABYLON;
  13. BABYLON.GLTF2 = BABYLON.GLTF2 || {};
  14. BABYLON.GLTF2.Loader = BABYLON.GLTF2.Loader || {};
  15. BABYLON.GLTF2.Loader.Extensions = BABYLON.GLTF2.Loader.Extensions || {};
  16. const keys = [];
  17. for (const key in Extensions) {
  18. BABYLON.GLTF2.Loader.Extensions[key] = Extensions[key];
  19. keys.push(key);
  20. }
  21. for (const key in Interfaces) {
  22. BABYLON.GLTF2.Loader[key] = Interfaces[key];
  23. keys.push(key);
  24. }
  25. for (const key in GLTF2) {
  26. // Prevent Reassignment.
  27. if (keys.indexOf(key) > -1) {
  28. continue;
  29. }
  30. BABYLON.GLTF2[key] = GLTF2[key];
  31. }
  32. }
  33. export { GLTF2 };
  34. //# sourceMappingURL=legacy-glTF2.js.map