fluidRenderingObject.d.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import type { VertexBuffer } from "../../Buffers/buffer.js";
  2. import type { DataBuffer } from "../../Buffers/dataBuffer.js";
  3. import type { AbstractEngine } from "../../Engines/abstractEngine.js";
  4. import { EffectWrapper } from "../../Materials/effectRenderer.js";
  5. import { Observable } from "../../Misc/observable.js";
  6. import type { Scene } from "../../scene.js";
  7. import type { Nullable } from "../../types.js";
  8. /**
  9. * Defines the base object used for fluid rendering.
  10. * It is based on a list of vertices (particles)
  11. */
  12. export declare abstract class FluidRenderingObject {
  13. protected _scene: Scene;
  14. protected _engine: AbstractEngine;
  15. protected _effectsAreDirty: boolean;
  16. protected _depthEffectWrapper: Nullable<EffectWrapper>;
  17. protected _thicknessEffectWrapper: Nullable<EffectWrapper>;
  18. /** Defines the priority of the object. Objects will be rendered in ascending order of priority */
  19. priority: number;
  20. protected _particleSize: number;
  21. /** Observable triggered when the size of the particle is changed */
  22. onParticleSizeChanged: Observable<FluidRenderingObject>;
  23. /** Gets or sets the size of the particle */
  24. get particleSize(): number;
  25. set particleSize(size: number);
  26. /** Defines the alpha value of a particle */
  27. particleThicknessAlpha: number;
  28. /** Indicates if the object uses instancing or not */
  29. get useInstancing(): boolean;
  30. private _useVelocity;
  31. /** Indicates if velocity of particles should be used when rendering the object. The vertex buffer set must contain a "velocity" buffer for this to work! */
  32. get useVelocity(): boolean;
  33. set useVelocity(use: boolean);
  34. private _hasVelocity;
  35. /**
  36. * Gets the vertex buffers
  37. */
  38. abstract get vertexBuffers(): {
  39. [key: string]: VertexBuffer;
  40. };
  41. /**
  42. * Gets the index buffer (or null if the object is using instancing)
  43. */
  44. get indexBuffer(): Nullable<DataBuffer>;
  45. /**
  46. * @returns the name of the class
  47. */
  48. getClassName(): string;
  49. /**
  50. * Instantiates a fluid rendering object
  51. * @param scene The scene the object is part of
  52. */
  53. constructor(scene: Scene);
  54. protected _createEffects(): void;
  55. /**
  56. * Indicates if the object is ready to be rendered
  57. * @returns True if everything is ready for the object to be rendered, otherwise false
  58. */
  59. isReady(): boolean;
  60. /**
  61. * Gets the number of particles (vertices) of this object
  62. * @returns The number of particles
  63. */
  64. abstract get numParticles(): number;
  65. /**
  66. * Render the depth texture for this object
  67. */
  68. renderDepthTexture(): void;
  69. /**
  70. * Render the thickness texture for this object
  71. */
  72. renderThicknessTexture(): void;
  73. /**
  74. * Render the diffuse texture for this object
  75. */
  76. renderDiffuseTexture(): void;
  77. /**
  78. * Releases the ressources used by the class
  79. */
  80. dispose(): void;
  81. }