lensFlareSystemSceneComponent.d.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import type { Nullable } from "../types";
  2. import type { Scene } from "../scene";
  3. import type { ISceneSerializableComponent } from "../sceneComponent";
  4. import { AbstractScene } from "../abstractScene";
  5. import { LensFlareSystem } from "./lensFlareSystem";
  6. declare module "../abstractScene" {
  7. interface AbstractScene {
  8. /**
  9. * The list of lens flare system added to the scene
  10. * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
  11. */
  12. lensFlareSystems: Array<LensFlareSystem>;
  13. /**
  14. * Removes the given lens flare system from this scene.
  15. * @param toRemove The lens flare system to remove
  16. * @returns The index of the removed lens flare system
  17. */
  18. removeLensFlareSystem(toRemove: LensFlareSystem): number;
  19. /**
  20. * Adds the given lens flare system to this scene
  21. * @param newLensFlareSystem The lens flare system to add
  22. */
  23. addLensFlareSystem(newLensFlareSystem: LensFlareSystem): void;
  24. /**
  25. * Gets a lens flare system using its name
  26. * @param name defines the name to look for
  27. * @returns the lens flare system or null if not found
  28. */
  29. getLensFlareSystemByName(name: string): Nullable<LensFlareSystem>;
  30. /**
  31. * Gets a lens flare system using its Id
  32. * @param id defines the Id to look for
  33. * @returns the lens flare system or null if not found
  34. * @deprecated Please use getLensFlareSystemById instead
  35. */
  36. getLensFlareSystemByID(id: string): Nullable<LensFlareSystem>;
  37. /**
  38. * Gets a lens flare system using its Id
  39. * @param id defines the Id to look for
  40. * @returns the lens flare system or null if not found
  41. */
  42. getLensFlareSystemById(id: string): Nullable<LensFlareSystem>;
  43. }
  44. }
  45. /**
  46. * Defines the lens flare scene component responsible to manage any lens flares
  47. * in a given scene.
  48. */
  49. export declare class LensFlareSystemSceneComponent implements ISceneSerializableComponent {
  50. /**
  51. * The component name helpful to identify the component in the list of scene components.
  52. */
  53. readonly name = "LensFlareSystem";
  54. /**
  55. * The scene the component belongs to.
  56. */
  57. scene: Scene;
  58. /**
  59. * Creates a new instance of the component for the given scene
  60. * @param scene Defines the scene to register the component in
  61. */
  62. constructor(scene: Scene);
  63. /**
  64. * Registers the component in a given scene
  65. */
  66. register(): void;
  67. /**
  68. * Rebuilds the elements related to this component in case of
  69. * context lost for instance.
  70. */
  71. rebuild(): void;
  72. /**
  73. * Adds all the elements from the container to the scene
  74. * @param container the container holding the elements
  75. */
  76. addFromContainer(container: AbstractScene): void;
  77. /**
  78. * Removes all the elements in the container from the scene
  79. * @param container contains the elements to remove
  80. * @param dispose if the removed element should be disposed (default: false)
  81. */
  82. removeFromContainer(container: AbstractScene, dispose?: boolean): void;
  83. /**
  84. * Serializes the component data to the specified json object
  85. * @param serializationObject The object to serialize to
  86. */
  87. serialize(serializationObject: any): void;
  88. /**
  89. * Disposes the component and the associated resources.
  90. */
  91. dispose(): void;
  92. private _draw;
  93. }