splatFileLoader.d.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import type { ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderPlugin, ISceneLoaderAsyncResult, ISceneLoaderPluginExtensions, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
  2. import type { AssetContainer } from "@babylonjs/core/assetContainer.js";
  3. import type { Scene } from "@babylonjs/core/scene.js";
  4. /**
  5. * @experimental
  6. * SPLAT file type loader.
  7. * This is a babylon scene loader plugin.
  8. */
  9. export declare class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
  10. /**
  11. * Defines the name of the plugin.
  12. */
  13. name: string;
  14. /**
  15. * Defines the extensions the splat loader is able to load.
  16. * force data to come in as an ArrayBuffer
  17. */
  18. extensions: ISceneLoaderPluginExtensions;
  19. /**
  20. * Creates loader for gaussian splatting files
  21. */
  22. constructor();
  23. /**
  24. * Instantiates a gaussian splatting file loader plugin.
  25. * @returns the created plugin
  26. */
  27. createPlugin(): ISceneLoaderPluginAsync | ISceneLoaderPlugin;
  28. /**
  29. * If the data string can be loaded directly.
  30. * @returns if the data can be loaded directly
  31. */
  32. canDirectLoad(): boolean;
  33. /**
  34. * Imports from the loaded gaussian splatting data and adds them to the scene
  35. * @param _meshesNames a string or array of strings of the mesh names that should be loaded from the file
  36. * @param scene the scene the meshes should be added to
  37. * @param data the gaussian splatting data to load
  38. * @param rootUrl root url to load from
  39. * @param onProgress callback called while file is loading
  40. * @param fileName Defines the name of the file to load
  41. * @returns a promise containing the loaded meshes, particles, skeletons and animations
  42. */
  43. importMeshAsync(_meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
  44. /**
  45. * Imports all objects from the loaded gaussian splatting data and adds them to the scene
  46. * @param scene the scene the objects should be added to
  47. * @param data the gaussian splatting data to load
  48. * @param _rootUrl root url to load from
  49. * @returns a promise which completes when objects have been loaded to the scene
  50. */
  51. loadAsync(scene: Scene, data: any, _rootUrl: string): Promise<void>;
  52. /**
  53. * Load into an asset container.
  54. * @param _scene The scene to load into
  55. * @param _data The data to import
  56. * @param _rootUrl The root url for scene and resources
  57. * @returns The loaded asset container
  58. */
  59. loadAssetContainerAsync(_scene: Scene, _data: string, _rootUrl: string): Promise<AssetContainer>;
  60. }