IParticleSystem.ts 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. import { Nullable } from "../types";
  2. import { Vector2, Vector3 } from "../Maths/math.vector";
  3. import { Color3, Color4 } from '../Maths/math.color';
  4. import { AbstractMesh } from "../Meshes/abstractMesh";
  5. import { BaseTexture } from "../Materials/Textures/baseTexture";
  6. import { Texture } from "../Materials/Textures/texture";
  7. import { BoxParticleEmitter, IParticleEmitterType, PointParticleEmitter, HemisphericParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CylinderParticleEmitter, ConeParticleEmitter } from "../Particles/EmitterTypes/index";
  8. import { Scene } from "../scene";
  9. import { ColorGradient, FactorGradient, Color3Gradient } from "../Misc/gradients";
  10. import { Effect } from "../Materials/effect";
  11. import { Observable } from "../Misc/observable";
  12. declare type Animation = import("../Animations/animation").Animation;
  13. /**
  14. * Interface representing a particle system in Babylon.js.
  15. * This groups the common functionalities that needs to be implemented in order to create a particle system.
  16. * A particle system represents a way to manage particles from their emission to their animation and rendering.
  17. */
  18. export interface IParticleSystem {
  19. /**
  20. * List of animations used by the particle system.
  21. */
  22. animations: Animation[];
  23. /**
  24. * The id of the Particle system.
  25. */
  26. id: string;
  27. /**
  28. * The name of the Particle system.
  29. */
  30. name: string;
  31. /**
  32. * The emitter represents the Mesh or position we are attaching the particle system to.
  33. */
  34. emitter: Nullable<AbstractMesh | Vector3>;
  35. /**
  36. * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction
  37. */
  38. isBillboardBased: boolean;
  39. /**
  40. * The rendering group used by the Particle system to chose when to render.
  41. */
  42. renderingGroupId: number;
  43. /**
  44. * The layer mask we are rendering the particles through.
  45. */
  46. layerMask: number;
  47. /**
  48. * The overall motion speed (0.01 is default update speed, faster updates = faster animation)
  49. */
  50. updateSpeed: number;
  51. /**
  52. * The amount of time the particle system is running (depends of the overall update speed).
  53. */
  54. targetStopDuration: number;
  55. /**
  56. * The texture used to render each particle. (this can be a spritesheet)
  57. */
  58. particleTexture: Nullable<Texture>;
  59. /**
  60. * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE, ParticleSystem.BLENDMODE_STANDARD or ParticleSystem.BLENDMODE_ADD.
  61. */
  62. blendMode: number;
  63. /**
  64. * Minimum life time of emitting particles.
  65. */
  66. minLifeTime: number;
  67. /**
  68. * Maximum life time of emitting particles.
  69. */
  70. maxLifeTime: number;
  71. /**
  72. * Minimum Size of emitting particles.
  73. */
  74. minSize: number;
  75. /**
  76. * Maximum Size of emitting particles.
  77. */
  78. maxSize: number;
  79. /**
  80. * Minimum scale of emitting particles on X axis.
  81. */
  82. minScaleX: number;
  83. /**
  84. * Maximum scale of emitting particles on X axis.
  85. */
  86. maxScaleX: number;
  87. /**
  88. * Minimum scale of emitting particles on Y axis.
  89. */
  90. minScaleY: number;
  91. /**
  92. * Maximum scale of emitting particles on Y axis.
  93. */
  94. maxScaleY: number;
  95. /**
  96. * Random color of each particle after it has been emitted, between color1 and color2 vectors.
  97. */
  98. color1: Color4;
  99. /**
  100. * Random color of each particle after it has been emitted, between color1 and color2 vectors.
  101. */
  102. color2: Color4;
  103. /**
  104. * Color the particle will have at the end of its lifetime.
  105. */
  106. colorDead: Color4;
  107. /**
  108. * The maximum number of particles to emit per frame until we reach the activeParticleCount value
  109. */
  110. emitRate: number;
  111. /**
  112. * You can use gravity if you want to give an orientation to your particles.
  113. */
  114. gravity: Vector3;
  115. /**
  116. * Minimum power of emitting particles.
  117. */
  118. minEmitPower: number;
  119. /**
  120. * Maximum power of emitting particles.
  121. */
  122. maxEmitPower: number;
  123. /**
  124. * Minimum angular speed of emitting particles (Z-axis rotation for each particle).
  125. */
  126. minAngularSpeed: number;
  127. /**
  128. * Maximum angular speed of emitting particles (Z-axis rotation for each particle).
  129. */
  130. maxAngularSpeed: number;
  131. /**
  132. * Gets or sets the minimal initial rotation in radians.
  133. */
  134. minInitialRotation: number;
  135. /**
  136. * Gets or sets the maximal initial rotation in radians.
  137. */
  138. maxInitialRotation: number;
  139. /**
  140. * The particle emitter type defines the emitter used by the particle system.
  141. * It can be for example box, sphere, or cone...
  142. */
  143. particleEmitterType: Nullable<IParticleEmitterType>;
  144. /**
  145. * Defines the delay in milliseconds before starting the system (0 by default)
  146. */
  147. startDelay: number;
  148. /**
  149. * Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0
  150. */
  151. preWarmCycles: number;
  152. /**
  153. * Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1)
  154. */
  155. preWarmStepOffset: number;
  156. /**
  157. * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)
  158. */
  159. spriteCellChangeSpeed: number;
  160. /**
  161. * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display
  162. */
  163. startSpriteCellID: number;
  164. /**
  165. * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display
  166. */
  167. endSpriteCellID: number;
  168. /**
  169. * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use
  170. */
  171. spriteCellWidth: number;
  172. /**
  173. * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use
  174. */
  175. spriteCellHeight: number;
  176. /**
  177. * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID
  178. */
  179. spriteRandomStartCell: boolean;
  180. /**
  181. * Gets or sets a boolean indicating if a spritesheet is used to animate the particles texture
  182. */
  183. isAnimationSheetEnabled: boolean;
  184. /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */
  185. translationPivot: Vector2;
  186. /**
  187. * Gets or sets a texture used to add random noise to particle positions
  188. */
  189. noiseTexture: Nullable<BaseTexture>;
  190. /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */
  191. noiseStrength: Vector3;
  192. /**
  193. * Gets or sets the billboard mode to use when isBillboardBased = true.
  194. * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED
  195. */
  196. billboardMode: number;
  197. /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */
  198. limitVelocityDamping: number;
  199. /**
  200. * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called
  201. */
  202. beginAnimationOnStart: boolean;
  203. /**
  204. * Gets or sets the frame to start the animation from when beginAnimationOnStart is true
  205. */
  206. beginAnimationFrom: number;
  207. /**
  208. * Gets or sets the frame to end the animation on when beginAnimationOnStart is true
  209. */
  210. beginAnimationTo: number;
  211. /**
  212. * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true
  213. */
  214. beginAnimationLoop: boolean;
  215. /**
  216. * Specifies whether the particle system will be disposed once it reaches the end of the animation.
  217. */
  218. disposeOnStop: boolean;
  219. /**
  220. * Specifies if the particles are updated in emitter local space or world space
  221. */
  222. isLocal: boolean;
  223. /** Snippet ID if the particle system was created from the snippet server */
  224. snippetId: string;
  225. /**
  226. * Gets the maximum number of particles active at the same time.
  227. * @returns The max number of active particles.
  228. */
  229. getCapacity(): number;
  230. /**
  231. * Gets the number of particles active at the same time.
  232. * @returns The number of active particles.
  233. */
  234. getActiveCount(): number;
  235. /**
  236. * Gets if the system has been started. (Note: this will still be true after stop is called)
  237. * @returns True if it has been started, otherwise false.
  238. */
  239. isStarted(): boolean;
  240. /**
  241. * Animates the particle system for this frame.
  242. */
  243. animate(): void;
  244. /**
  245. * Renders the particle system in its current state.
  246. * @returns the current number of particles
  247. */
  248. render(): number;
  249. /**
  250. * Dispose the particle system and frees its associated resources.
  251. * @param disposeTexture defines if the particule texture must be disposed as well (true by default)
  252. */
  253. dispose(disposeTexture?: boolean): void;
  254. /**
  255. * An event triggered when the system is disposed
  256. */
  257. onDisposeObservable: Observable<IParticleSystem>;
  258. /**
  259. * Clones the particle system.
  260. * @param name The name of the cloned object
  261. * @param newEmitter The new emitter to use
  262. * @returns the cloned particle system
  263. */
  264. clone(name: string, newEmitter: any): Nullable<IParticleSystem>;
  265. /**
  266. * Serializes the particle system to a JSON object
  267. * @param serializeTexture defines if the texture must be serialized as well
  268. * @returns the JSON object
  269. */
  270. serialize(serializeTexture: boolean): any;
  271. /**
  272. * Rebuild the particle system
  273. */
  274. rebuild(): void;
  275. /** Force the system to rebuild all gradients that need to be resync */
  276. forceRefreshGradients(): void;
  277. /**
  278. * Starts the particle system and begins to emit
  279. * @param delay defines the delay in milliseconds before starting the system (0 by default)
  280. */
  281. start(delay?: number): void;
  282. /**
  283. * Stops the particle system.
  284. */
  285. stop(): void;
  286. /**
  287. * Remove all active particles
  288. */
  289. reset(): void;
  290. /**
  291. * Gets a boolean indicating that the system is stopping
  292. * @returns true if the system is currently stopping
  293. */
  294. isStopping(): boolean;
  295. /**
  296. * Is this system ready to be used/rendered
  297. * @return true if the system is ready
  298. */
  299. isReady(): boolean;
  300. /**
  301. * Returns the string "ParticleSystem"
  302. * @returns a string containing the class name
  303. */
  304. getClassName(): string;
  305. /**
  306. * Gets the custom effect used to render the particles
  307. * @param blendMode Blend mode for which the effect should be retrieved
  308. * @returns The effect
  309. */
  310. getCustomEffect(blendMode: number): Nullable<Effect>;
  311. /**
  312. * Sets the custom effect used to render the particles
  313. * @param effect The effect to set
  314. * @param blendMode Blend mode for which the effect should be set
  315. */
  316. setCustomEffect(effect: Nullable<Effect>, blendMode: number): void;
  317. /**
  318. * Fill the defines array according to the current settings of the particle system
  319. * @param defines Array to be updated
  320. * @param blendMode blend mode to take into account when updating the array
  321. */
  322. fillDefines(defines: Array<string>, blendMode: number): void;
  323. /**
  324. * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system
  325. * @param uniforms Uniforms array to fill
  326. * @param attributes Attributes array to fill
  327. * @param samplers Samplers array to fill
  328. */
  329. fillUniformsAttributesAndSamplerNames(uniforms: Array<string>, attributes: Array<string>, samplers: Array<string>): void;
  330. /**
  331. * Observable that will be called just before the particles are drawn
  332. */
  333. onBeforeDrawParticlesObservable: Observable<Nullable<Effect>>;
  334. /**
  335. * Gets the name of the particle vertex shader
  336. */
  337. vertexShaderName: string;
  338. /**
  339. * Adds a new color gradient
  340. * @param gradient defines the gradient to use (between 0 and 1)
  341. * @param color1 defines the color to affect to the specified gradient
  342. * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
  343. * @returns the current particle system
  344. */
  345. addColorGradient(gradient: number, color1: Color4, color2?: Color4): IParticleSystem;
  346. /**
  347. * Remove a specific color gradient
  348. * @param gradient defines the gradient to remove
  349. * @returns the current particle system
  350. */
  351. removeColorGradient(gradient: number): IParticleSystem;
  352. /**
  353. * Adds a new size gradient
  354. * @param gradient defines the gradient to use (between 0 and 1)
  355. * @param factor defines the size factor to affect to the specified gradient
  356. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  357. * @returns the current particle system
  358. */
  359. addSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  360. /**
  361. * Remove a specific size gradient
  362. * @param gradient defines the gradient to remove
  363. * @returns the current particle system
  364. */
  365. removeSizeGradient(gradient: number): IParticleSystem;
  366. /**
  367. * Gets the current list of color gradients.
  368. * You must use addColorGradient and removeColorGradient to udpate this list
  369. * @returns the list of color gradients
  370. */
  371. getColorGradients(): Nullable<Array<ColorGradient>>;
  372. /**
  373. * Gets the current list of size gradients.
  374. * You must use addSizeGradient and removeSizeGradient to udpate this list
  375. * @returns the list of size gradients
  376. */
  377. getSizeGradients(): Nullable<Array<FactorGradient>>;
  378. /**
  379. * Gets the current list of angular speed gradients.
  380. * You must use addAngularSpeedGradient and removeAngularSpeedGradient to udpate this list
  381. * @returns the list of angular speed gradients
  382. */
  383. getAngularSpeedGradients(): Nullable<Array<FactorGradient>>;
  384. /**
  385. * Adds a new angular speed gradient
  386. * @param gradient defines the gradient to use (between 0 and 1)
  387. * @param factor defines the angular speed to affect to the specified gradient
  388. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  389. * @returns the current particle system
  390. */
  391. addAngularSpeedGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  392. /**
  393. * Remove a specific angular speed gradient
  394. * @param gradient defines the gradient to remove
  395. * @returns the current particle system
  396. */
  397. removeAngularSpeedGradient(gradient: number): IParticleSystem;
  398. /**
  399. * Gets the current list of velocity gradients.
  400. * You must use addVelocityGradient and removeVelocityGradient to udpate this list
  401. * @returns the list of velocity gradients
  402. */
  403. getVelocityGradients(): Nullable<Array<FactorGradient>>;
  404. /**
  405. * Adds a new velocity gradient
  406. * @param gradient defines the gradient to use (between 0 and 1)
  407. * @param factor defines the velocity to affect to the specified gradient
  408. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  409. * @returns the current particle system
  410. */
  411. addVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  412. /**
  413. * Remove a specific velocity gradient
  414. * @param gradient defines the gradient to remove
  415. * @returns the current particle system
  416. */
  417. removeVelocityGradient(gradient: number): IParticleSystem;
  418. /**
  419. * Gets the current list of limit velocity gradients.
  420. * You must use addLimitVelocityGradient and removeLimitVelocityGradient to udpate this list
  421. * @returns the list of limit velocity gradients
  422. */
  423. getLimitVelocityGradients(): Nullable<Array<FactorGradient>>;
  424. /**
  425. * Adds a new limit velocity gradient
  426. * @param gradient defines the gradient to use (between 0 and 1)
  427. * @param factor defines the limit velocity to affect to the specified gradient
  428. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  429. * @returns the current particle system
  430. */
  431. addLimitVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  432. /**
  433. * Remove a specific limit velocity gradient
  434. * @param gradient defines the gradient to remove
  435. * @returns the current particle system
  436. */
  437. removeLimitVelocityGradient(gradient: number): IParticleSystem;
  438. /**
  439. * Adds a new drag gradient
  440. * @param gradient defines the gradient to use (between 0 and 1)
  441. * @param factor defines the drag to affect to the specified gradient
  442. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  443. * @returns the current particle system
  444. */
  445. addDragGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  446. /**
  447. * Remove a specific drag gradient
  448. * @param gradient defines the gradient to remove
  449. * @returns the current particle system
  450. */
  451. removeDragGradient(gradient: number): IParticleSystem;
  452. /**
  453. * Gets the current list of drag gradients.
  454. * You must use addDragGradient and removeDragGradient to udpate this list
  455. * @returns the list of drag gradients
  456. */
  457. getDragGradients(): Nullable<Array<FactorGradient>>;
  458. /**
  459. * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)
  460. * @param gradient defines the gradient to use (between 0 and 1)
  461. * @param factor defines the emit rate to affect to the specified gradient
  462. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  463. * @returns the current particle system
  464. */
  465. addEmitRateGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  466. /**
  467. * Remove a specific emit rate gradient
  468. * @param gradient defines the gradient to remove
  469. * @returns the current particle system
  470. */
  471. removeEmitRateGradient(gradient: number): IParticleSystem;
  472. /**
  473. * Gets the current list of emit rate gradients.
  474. * You must use addEmitRateGradient and removeEmitRateGradient to udpate this list
  475. * @returns the list of emit rate gradients
  476. */
  477. getEmitRateGradients(): Nullable<Array<FactorGradient>>;
  478. /**
  479. * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)
  480. * @param gradient defines the gradient to use (between 0 and 1)
  481. * @param factor defines the start size to affect to the specified gradient
  482. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  483. * @returns the current particle system
  484. */
  485. addStartSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  486. /**
  487. * Remove a specific start size gradient
  488. * @param gradient defines the gradient to remove
  489. * @returns the current particle system
  490. */
  491. removeStartSizeGradient(gradient: number): IParticleSystem;
  492. /**
  493. * Gets the current list of start size gradients.
  494. * You must use addStartSizeGradient and removeStartSizeGradient to udpate this list
  495. * @returns the list of start size gradients
  496. */
  497. getStartSizeGradients(): Nullable<Array<FactorGradient>>;
  498. /**
  499. * Adds a new life time gradient
  500. * @param gradient defines the gradient to use (between 0 and 1)
  501. * @param factor defines the life time factor to affect to the specified gradient
  502. * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
  503. * @returns the current particle system
  504. */
  505. addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
  506. /**
  507. * Remove a specific life time gradient
  508. * @param gradient defines the gradient to remove
  509. * @returns the current particle system
  510. */
  511. removeLifeTimeGradient(gradient: number): IParticleSystem;
  512. /**
  513. * Gets the current list of life time gradients.
  514. * You must use addLifeTimeGradient and removeLifeTimeGradient to udpate this list
  515. * @returns the list of life time gradients
  516. */
  517. getLifeTimeGradients(): Nullable<Array<FactorGradient>>;
  518. /**
  519. * Gets the current list of color gradients.
  520. * You must use addColorGradient and removeColorGradient to udpate this list
  521. * @returns the list of color gradients
  522. */
  523. getColorGradients(): Nullable<Array<ColorGradient>>;
  524. /**
  525. * Adds a new ramp gradient used to remap particle colors
  526. * @param gradient defines the gradient to use (between 0 and 1)
  527. * @param color defines the color to affect to the specified gradient
  528. * @returns the current particle system
  529. */
  530. addRampGradient(gradient: number, color: Color3): IParticleSystem;
  531. /**
  532. * Gets the current list of ramp gradients.
  533. * You must use addRampGradient and removeRampGradient to udpate this list
  534. * @returns the list of ramp gradients
  535. */
  536. getRampGradients(): Nullable<Array<Color3Gradient>>;
  537. /** Gets or sets a boolean indicating that ramp gradients must be used
  538. * @see http://doc.babylonjs.com/babylon101/particles#ramp-gradients
  539. */
  540. useRampGradients: boolean;
  541. /**
  542. * Adds a new color remap gradient
  543. * @param gradient defines the gradient to use (between 0 and 1)
  544. * @param min defines the color remap minimal range
  545. * @param max defines the color remap maximal range
  546. * @returns the current particle system
  547. */
  548. addColorRemapGradient(gradient: number, min: number, max: number): IParticleSystem;
  549. /**
  550. * Gets the current list of color remap gradients.
  551. * You must use addColorRemapGradient and removeColorRemapGradient to udpate this list
  552. * @returns the list of color remap gradients
  553. */
  554. getColorRemapGradients(): Nullable<Array<FactorGradient>>;
  555. /**
  556. * Adds a new alpha remap gradient
  557. * @param gradient defines the gradient to use (between 0 and 1)
  558. * @param min defines the alpha remap minimal range
  559. * @param max defines the alpha remap maximal range
  560. * @returns the current particle system
  561. */
  562. addAlphaRemapGradient(gradient: number, min: number, max: number): IParticleSystem;
  563. /**
  564. * Gets the current list of alpha remap gradients.
  565. * You must use addAlphaRemapGradient and removeAlphaRemapGradient to udpate this list
  566. * @returns the list of alpha remap gradients
  567. */
  568. getAlphaRemapGradients(): Nullable<Array<FactorGradient>>;
  569. /**
  570. * Creates a Point Emitter for the particle system (emits directly from the emitter position)
  571. * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
  572. * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
  573. * @returns the emitter
  574. */
  575. createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter;
  576. /**
  577. * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)
  578. * @param radius The radius of the hemisphere to emit from
  579. * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
  580. * @returns the emitter
  581. */
  582. createHemisphericEmitter(radius: number, radiusRange: number): HemisphericParticleEmitter;
  583. /**
  584. * Creates a Sphere Emitter for the particle system (emits along the sphere radius)
  585. * @param radius The radius of the sphere to emit from
  586. * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
  587. * @returns the emitter
  588. */
  589. createSphereEmitter(radius: number, radiusRange: number): SphereParticleEmitter;
  590. /**
  591. * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)
  592. * @param radius The radius of the sphere to emit from
  593. * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere
  594. * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere
  595. * @returns the emitter
  596. */
  597. createDirectedSphereEmitter(radius: number, direction1: Vector3, direction2: Vector3): SphereDirectedParticleEmitter;
  598. /**
  599. * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)
  600. * @param radius The radius of the emission cylinder
  601. * @param height The height of the emission cylinder
  602. * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius
  603. * @param directionRandomizer How much to randomize the particle direction [0-1]
  604. * @returns the emitter
  605. */
  606. createCylinderEmitter(radius: number, height: number, radiusRange: number, directionRandomizer: number): CylinderParticleEmitter;
  607. /**
  608. * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)
  609. * @param radius The radius of the cylinder to emit from
  610. * @param height The height of the emission cylinder
  611. * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
  612. * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder
  613. * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder
  614. * @returns the emitter
  615. */
  616. createDirectedCylinderEmitter(radius: number, height: number, radiusRange: number, direction1: Vector3, direction2: Vector3): SphereDirectedParticleEmitter;
  617. /**
  618. * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)
  619. * @param radius The radius of the cone to emit from
  620. * @param angle The base angle of the cone
  621. * @returns the emitter
  622. */
  623. createConeEmitter(radius: number, angle: number): ConeParticleEmitter;
  624. /**
  625. * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)
  626. * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
  627. * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
  628. * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
  629. * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
  630. * @returns the emitter
  631. */
  632. createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter;
  633. /**
  634. * Get hosting scene
  635. * @returns the scene
  636. */
  637. getScene(): Scene;
  638. }