particleSystemSet.d.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import type { Nullable } from "../types";
  2. import { Color3 } from "../Maths/math.color";
  3. import type { AbstractMesh } from "../Meshes/abstractMesh";
  4. import type { IParticleSystem } from "./IParticleSystem";
  5. import type { Scene, IDisposable } from "../scene";
  6. import type { Vector3 } from "../Maths/math.vector";
  7. /**
  8. * Represents a set of particle systems working together to create a specific effect
  9. */
  10. export declare class ParticleSystemSet implements IDisposable {
  11. /**
  12. * Gets or sets base Assets URL
  13. */
  14. static BaseAssetsUrl: string;
  15. private _emitterCreationOptions;
  16. private _emitterNode;
  17. private _emitterNodeIsOwned;
  18. /**
  19. * Gets the particle system list
  20. */
  21. systems: IParticleSystem[];
  22. /**
  23. * Gets or sets the emitter node used with this set
  24. */
  25. get emitterNode(): Nullable<AbstractMesh | Vector3>;
  26. set emitterNode(value: Nullable<AbstractMesh | Vector3>);
  27. /**
  28. * Creates a new emitter mesh as a sphere
  29. * @param options defines the options used to create the sphere
  30. * @param options.diameter
  31. * @param options.segments
  32. * @param options.color
  33. * @param renderingGroupId defines the renderingGroupId to use for the sphere
  34. * @param scene defines the hosting scene
  35. */
  36. setEmitterAsSphere(options: {
  37. diameter: number;
  38. segments: number;
  39. color: Color3;
  40. }, renderingGroupId: number, scene: Scene): void;
  41. /**
  42. * Starts all particle systems of the set
  43. * @param emitter defines an optional mesh to use as emitter for the particle systems
  44. */
  45. start(emitter?: AbstractMesh): void;
  46. /**
  47. * Release all associated resources
  48. */
  49. dispose(): void;
  50. /**
  51. * Serialize the set into a JSON compatible object
  52. * @param serializeTexture defines if the texture must be serialized as well
  53. * @returns a JSON compatible representation of the set
  54. */
  55. serialize(serializeTexture?: boolean): any;
  56. /**
  57. * Parse a new ParticleSystemSet from a serialized source
  58. * @param data defines a JSON compatible representation of the set
  59. * @param scene defines the hosting scene
  60. * @param gpu defines if we want GPU particles or CPU particles
  61. * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
  62. * @returns a new ParticleSystemSet
  63. */
  64. static Parse(data: any, scene: Scene, gpu?: boolean, capacity?: number): ParticleSystemSet;
  65. }