subEmitter.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import type { AbstractEngine } from "../Engines/abstractEngine";
  2. import type { Scene } from "../scene";
  3. import type { ParticleSystem } from "../Particles/particleSystem";
  4. /**
  5. * Type of sub emitter
  6. */
  7. export declare enum SubEmitterType {
  8. /**
  9. * Attached to the particle over it's lifetime
  10. */
  11. ATTACHED = 0,
  12. /**
  13. * Created when the particle dies
  14. */
  15. END = 1
  16. }
  17. /**
  18. * Sub emitter class used to emit particles from an existing particle
  19. */
  20. export declare class SubEmitter {
  21. /**
  22. * the particle system to be used by the sub emitter
  23. */
  24. particleSystem: ParticleSystem;
  25. /**
  26. * Type of the submitter (Default: END)
  27. */
  28. type: SubEmitterType;
  29. /**
  30. * If the particle should inherit the direction from the particle it's attached to. (+Y will face the direction the particle is moving) (Default: false)
  31. * Note: This only is supported when using an emitter of type Mesh
  32. */
  33. inheritDirection: boolean;
  34. /**
  35. * How much of the attached particles speed should be added to the sub emitted particle (default: 0)
  36. */
  37. inheritedVelocityAmount: number;
  38. /**
  39. * Creates a sub emitter
  40. * @param particleSystem the particle system to be used by the sub emitter
  41. */
  42. constructor(
  43. /**
  44. * the particle system to be used by the sub emitter
  45. */
  46. particleSystem: ParticleSystem);
  47. /**
  48. * Clones the sub emitter
  49. * @returns the cloned sub emitter
  50. */
  51. clone(): SubEmitter;
  52. /**
  53. * Serialize current object to a JSON object
  54. * @param serializeTexture defines if the texture must be serialized as well
  55. * @returns the serialized object
  56. */
  57. serialize(serializeTexture?: boolean): any;
  58. /**
  59. * @internal
  60. */
  61. static _ParseParticleSystem(system: any, sceneOrEngine: Scene | AbstractEngine, rootUrl: string, doNotStart?: boolean): ParticleSystem;
  62. /**
  63. * Creates a new SubEmitter from a serialized JSON version
  64. * @param serializationObject defines the JSON object to read from
  65. * @param sceneOrEngine defines the hosting scene or the hosting engine
  66. * @param rootUrl defines the rootUrl for data loading
  67. * @returns a new SubEmitter
  68. */
  69. static Parse(serializationObject: any, sceneOrEngine: Scene | AbstractEngine, rootUrl: string): SubEmitter;
  70. /** Release associated resources */
  71. dispose(): void;
  72. }