IParticleSystem.d.ts 28 KB

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