meshSimplificationSceneComponent.d.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { Scene } from "../scene";
  2. import type { ISimplificationSettings } from "./meshSimplification";
  3. import { SimplificationQueue, SimplificationType } from "./meshSimplification";
  4. import type { ISceneComponent } from "../sceneComponent";
  5. declare module "../scene" {
  6. interface Scene {
  7. /** @internal (Backing field) */
  8. _simplificationQueue: SimplificationQueue;
  9. /**
  10. * Gets or sets the simplification queue attached to the scene
  11. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/simplifyingMeshes
  12. */
  13. simplificationQueue: SimplificationQueue;
  14. }
  15. }
  16. declare module "../Meshes/mesh" {
  17. interface Mesh {
  18. /**
  19. * Simplify the mesh according to the given array of settings.
  20. * Function will return immediately and will simplify async
  21. * @param settings a collection of simplification settings
  22. * @param parallelProcessing should all levels calculate parallel or one after the other
  23. * @param simplificationType the type of simplification to run
  24. * @param successCallback optional success callback to be called after the simplification finished processing all settings
  25. * @returns the current mesh
  26. */
  27. simplify(settings: Array<ISimplificationSettings>, parallelProcessing?: boolean, simplificationType?: SimplificationType, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): Mesh;
  28. }
  29. }
  30. /**
  31. * Defines the simplification queue scene component responsible to help scheduling the various simplification task
  32. * created in a scene
  33. */
  34. export declare class SimplicationQueueSceneComponent implements ISceneComponent {
  35. /**
  36. * The component name helpfull to identify the component in the list of scene components.
  37. */
  38. readonly name = "SimplificationQueue";
  39. /**
  40. * The scene the component belongs to.
  41. */
  42. scene: Scene;
  43. /**
  44. * Creates a new instance of the component for the given scene
  45. * @param scene Defines the scene to register the component in
  46. */
  47. constructor(scene: Scene);
  48. /**
  49. * Registers the component in a given scene
  50. */
  51. register(): void;
  52. /**
  53. * Rebuilds the elements related to this component in case of
  54. * context lost for instance.
  55. */
  56. rebuild(): void;
  57. /**
  58. * Disposes the component and the associated resources
  59. */
  60. dispose(): void;
  61. private _beforeCameraUpdate;
  62. }