fluidRenderingObjectCustomParticles.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { VertexBuffer } from "../../Buffers/buffer.js";
  2. import type { Scene } from "../../scene.js";
  3. import type { FloatArray } from "../../types.js";
  4. import { FluidRenderingObject } from "./fluidRenderingObject";
  5. /**
  6. * Defines a rendering object based on a list of custom buffers
  7. * The list must contain at least a "position" buffer!
  8. */
  9. export declare class FluidRenderingObjectCustomParticles extends FluidRenderingObject {
  10. private _numParticles;
  11. private _diffuseEffectWrapper;
  12. private _vertexBuffers;
  13. /**
  14. * @returns the name of the class
  15. */
  16. getClassName(): string;
  17. /**
  18. * Gets the vertex buffers
  19. */
  20. get vertexBuffers(): {
  21. [key: string]: VertexBuffer;
  22. };
  23. /**
  24. * Creates a new instance of the class
  25. * @param scene The scene the particles should be rendered into
  26. * @param buffers The list of buffers (must contain at least one "position" buffer!). Note that you don't have to pass all (or any!) buffers at once in the constructor, you can use the addBuffers method to add more later.
  27. * @param numParticles Number of vertices to take into account from the buffers
  28. */
  29. constructor(scene: Scene, buffers: {
  30. [key: string]: FloatArray;
  31. }, numParticles: number);
  32. /**
  33. * Add some new buffers
  34. * @param buffers List of buffers
  35. */
  36. addBuffers(buffers: {
  37. [key: string]: FloatArray;
  38. }): void;
  39. protected _createEffects(): void;
  40. /**
  41. * Indicates if the object is ready to be rendered
  42. * @returns True if everything is ready for the object to be rendered, otherwise false
  43. */
  44. isReady(): boolean;
  45. /**
  46. * Gets the number of particles in this object
  47. * @returns The number of particles
  48. */
  49. get numParticles(): number;
  50. /**
  51. * Sets the number of particles in this object
  52. * @param num The number of particles to take into account
  53. */
  54. setNumParticles(num: number): void;
  55. /**
  56. * Render the diffuse texture for this object
  57. */
  58. renderDiffuseTexture(): void;
  59. /**
  60. * Releases the ressources used by the class
  61. */
  62. dispose(): void;
  63. }