mtlFileLoader.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import type { Nullable } from "@babylonjs/core/types.js";
  2. import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial.js";
  3. import type { Scene } from "@babylonjs/core/scene.js";
  4. import type { AssetContainer } from "@babylonjs/core/assetContainer.js";
  5. /**
  6. * Class reading and parsing the MTL file bundled with the obj file.
  7. */
  8. export declare class MTLFileLoader {
  9. /**
  10. * Invert Y-Axis of referenced textures on load
  11. */
  12. static INVERT_TEXTURE_Y: boolean;
  13. /**
  14. * All material loaded from the mtl will be set here
  15. */
  16. materials: StandardMaterial[];
  17. /**
  18. * This function will read the mtl file and create each material described inside
  19. * This function could be improve by adding :
  20. * -some component missing (Ni, Tf...)
  21. * -including the specific options available
  22. *
  23. * @param scene defines the scene the material will be created in
  24. * @param data defines the mtl data to parse
  25. * @param rootUrl defines the rooturl to use in order to load relative dependencies
  26. * @param assetContainer defines the asset container to store the material in (can be null)
  27. */
  28. parseMTL(scene: Scene, data: string | ArrayBuffer, rootUrl: string, assetContainer: Nullable<AssetContainer>): void;
  29. /**
  30. * Gets the texture for the material.
  31. *
  32. * If the material is imported from input file,
  33. * We sanitize the url to ensure it takes the texture from aside the material.
  34. *
  35. * @param rootUrl The root url to load from
  36. * @param value The value stored in the mtl
  37. * @param scene
  38. * @returns The Texture
  39. */
  40. private static _GetTexture;
  41. }