particleSystemComponent.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import type { IParticleSystem } from "./IParticleSystem";
  2. import type { Effect } from "../Materials/effect";
  3. import "../Shaders/particles.vertex";
  4. import type { EffectFallbacks } from "../Materials/effectFallbacks";
  5. declare module "../Engines/abstractEngine" {
  6. interface AbstractEngine {
  7. /**
  8. * Create an effect to use with particle systems.
  9. * Please note that some parameters like animation sheets or not being billboard are not supported in this configuration, except if you pass
  10. * the particle system for which you want to create a custom effect in the last parameter
  11. * @param fragmentName defines the base name of the effect (The name of file without .fragment.fx)
  12. * @param uniformsNames defines a list of attribute names
  13. * @param samplers defines an array of string used to represent textures
  14. * @param defines defines the string containing the defines to use to compile the shaders
  15. * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails
  16. * @param onCompiled defines a function to call when the effect creation is successful
  17. * @param onError defines a function to call when the effect creation has failed
  18. * @param particleSystem the particle system you want to create the effect for
  19. * @returns the new Effect
  20. */
  21. createEffectForParticles(fragmentName: string, uniformsNames: string[], samplers: string[], defines: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, particleSystem?: IParticleSystem): Effect;
  22. }
  23. }
  24. declare module "../Meshes/mesh" {
  25. interface Mesh {
  26. /**
  27. * Returns an array populated with IParticleSystem objects whose the mesh is the emitter
  28. * @returns an array of IParticleSystem
  29. */
  30. getEmittedParticleSystems(): IParticleSystem[];
  31. /**
  32. * Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter
  33. * @returns an array of IParticleSystem
  34. */
  35. getHierarchyEmittedParticleSystems(): IParticleSystem[];
  36. }
  37. }