{"ast":null,"code":"import { FluidRenderingObject } from \"./fluidRenderingObject.js\";\n/**\n * Defines a rendering object based on a particle system\n */\nexport class FluidRenderingObjectParticleSystem extends FluidRenderingObject {\n /** Gets the particle system */\n get particleSystem() {\n return this._particleSystem;\n }\n /**\n * @returns the name of the class\n */\n getClassName() {\n return \"FluidRenderingObjectParticleSystem\";\n }\n /**\n * Gets or sets a boolean indicating that the diffuse texture should be generated based on the regular rendering of the particle system (default: true).\n * Sometimes, generating the diffuse texture this way may be sub-optimal. In that case, you can disable this property, in which case the particle system will be\n * rendered using a ALPHA_COMBINE mode instead of the one used by the particle system.\n */\n get useTrueRenderingForDiffuseTexture() {\n return this._useTrueRenderingForDiffuseTexture;\n }\n set useTrueRenderingForDiffuseTexture(use) {\n if (this._useTrueRenderingForDiffuseTexture === use) {\n return;\n }\n this._useTrueRenderingForDiffuseTexture = use;\n if (use) {\n this._particleSystem.blendMode = this._blendMode;\n this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver);\n this._onBeforeDrawParticleObserver = null;\n } else {\n this._particleSystem.blendMode = -1;\n this._onBeforeDrawParticleObserver = this._particleSystem.onBeforeDrawParticlesObservable.add(() => {\n this._engine.setAlphaMode(2);\n });\n }\n }\n /**\n * Gets the vertex buffers\n */\n get vertexBuffers() {\n return this._particleSystem.vertexBuffers;\n }\n /**\n * Gets the index buffer (or null if the object is using instancing)\n */\n get indexBuffer() {\n return this._particleSystem.indexBuffer;\n }\n /**\n * Creates a new instance of the class\n * @param scene The scene the particle system is part of\n * @param ps The particle system\n * @param shaderLanguage The shader language to use\n */\n constructor(scene, ps, shaderLanguage) {\n super(scene, shaderLanguage);\n this._useTrueRenderingForDiffuseTexture = true;\n this._particleSystem = ps;\n this._originalRender = ps.render.bind(ps);\n this._blendMode = ps.blendMode;\n this._onBeforeDrawParticleObserver = null;\n this._updateInAnimate = this._particleSystem.updateInAnimate;\n this._particleSystem.updateInAnimate = true;\n this._particleSystem.render = () => 0;\n this.particleSize = (ps.minSize + ps.maxSize) / 2;\n this.useTrueRenderingForDiffuseTexture = false;\n }\n /**\n * Indicates if the object is ready to be rendered\n * @returns True if everything is ready for the object to be rendered, otherwise false\n */\n isReady() {\n return super.isReady() && this._particleSystem.isReady();\n }\n /**\n * Gets the number of particles in this particle system\n * @returns The number of particles\n */\n get numParticles() {\n return this._particleSystem.getActiveCount();\n }\n /**\n * Render the diffuse texture for this object\n */\n renderDiffuseTexture() {\n this._originalRender();\n }\n /**\n * Releases the ressources used by the class\n */\n dispose() {\n super.dispose();\n this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver);\n this._onBeforeDrawParticleObserver = null;\n this._particleSystem.render = this._originalRender;\n this._particleSystem.blendMode = this._blendMode;\n this._particleSystem.updateInAnimate = this._updateInAnimate;\n }\n}","map":{"version":3,"names":["FluidRenderingObject","FluidRenderingObjectParticleSystem","particleSystem","_particleSystem","getClassName","useTrueRenderingForDiffuseTexture","_useTrueRenderingForDiffuseTexture","use","blendMode","_blendMode","onBeforeDrawParticlesObservable","remove","_onBeforeDrawParticleObserver","add","_engine","setAlphaMode","vertexBuffers","indexBuffer","constructor","scene","ps","shaderLanguage","_originalRender","render","bind","_updateInAnimate","updateInAnimate","particleSize","minSize","maxSize","isReady","numParticles","getActiveCount","renderDiffuseTexture","dispose"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js"],"sourcesContent":["\nimport { FluidRenderingObject } from \"./fluidRenderingObject.js\";\n/**\n * Defines a rendering object based on a particle system\n */\nexport class FluidRenderingObjectParticleSystem extends FluidRenderingObject {\n /** Gets the particle system */\n get particleSystem() {\n return this._particleSystem;\n }\n /**\n * @returns the name of the class\n */\n getClassName() {\n return \"FluidRenderingObjectParticleSystem\";\n }\n /**\n * Gets or sets a boolean indicating that the diffuse texture should be generated based on the regular rendering of the particle system (default: true).\n * Sometimes, generating the diffuse texture this way may be sub-optimal. In that case, you can disable this property, in which case the particle system will be\n * rendered using a ALPHA_COMBINE mode instead of the one used by the particle system.\n */\n get useTrueRenderingForDiffuseTexture() {\n return this._useTrueRenderingForDiffuseTexture;\n }\n set useTrueRenderingForDiffuseTexture(use) {\n if (this._useTrueRenderingForDiffuseTexture === use) {\n return;\n }\n this._useTrueRenderingForDiffuseTexture = use;\n if (use) {\n this._particleSystem.blendMode = this._blendMode;\n this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver);\n this._onBeforeDrawParticleObserver = null;\n }\n else {\n this._particleSystem.blendMode = -1;\n this._onBeforeDrawParticleObserver = this._particleSystem.onBeforeDrawParticlesObservable.add(() => {\n this._engine.setAlphaMode(2);\n });\n }\n }\n /**\n * Gets the vertex buffers\n */\n get vertexBuffers() {\n return this._particleSystem.vertexBuffers;\n }\n /**\n * Gets the index buffer (or null if the object is using instancing)\n */\n get indexBuffer() {\n return this._particleSystem.indexBuffer;\n }\n /**\n * Creates a new instance of the class\n * @param scene The scene the particle system is part of\n * @param ps The particle system\n * @param shaderLanguage The shader language to use\n */\n constructor(scene, ps, shaderLanguage) {\n super(scene, shaderLanguage);\n this._useTrueRenderingForDiffuseTexture = true;\n this._particleSystem = ps;\n this._originalRender = ps.render.bind(ps);\n this._blendMode = ps.blendMode;\n this._onBeforeDrawParticleObserver = null;\n this._updateInAnimate = this._particleSystem.updateInAnimate;\n this._particleSystem.updateInAnimate = true;\n this._particleSystem.render = () => 0;\n this.particleSize = (ps.minSize + ps.maxSize) / 2;\n this.useTrueRenderingForDiffuseTexture = false;\n }\n /**\n * Indicates if the object is ready to be rendered\n * @returns True if everything is ready for the object to be rendered, otherwise false\n */\n isReady() {\n return super.isReady() && this._particleSystem.isReady();\n }\n /**\n * Gets the number of particles in this particle system\n * @returns The number of particles\n */\n get numParticles() {\n return this._particleSystem.getActiveCount();\n }\n /**\n * Render the diffuse texture for this object\n */\n renderDiffuseTexture() {\n this._originalRender();\n }\n /**\n * Releases the ressources used by the class\n */\n dispose() {\n super.dispose();\n this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver);\n this._onBeforeDrawParticleObserver = null;\n this._particleSystem.render = this._originalRender;\n this._particleSystem.blendMode = this._blendMode;\n this._particleSystem.updateInAnimate = this._updateInAnimate;\n }\n}\n"],"mappings":"AACA,SAASA,oBAAoB,QAAQ,2BAA2B;AAChE;AACA;AACA;AACA,OAAO,MAAMC,kCAAkC,SAASD,oBAAoB,CAAC;EACzE;EACA,IAAIE,cAAcA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACC,eAAe;EAC/B;EACA;AACJ;AACA;EACIC,YAAYA,CAAA,EAAG;IACX,OAAO,oCAAoC;EAC/C;EACA;AACJ;AACA;AACA;AACA;EACI,IAAIC,iCAAiCA,CAAA,EAAG;IACpC,OAAO,IAAI,CAACC,kCAAkC;EAClD;EACA,IAAID,iCAAiCA,CAACE,GAAG,EAAE;IACvC,IAAI,IAAI,CAACD,kCAAkC,KAAKC,GAAG,EAAE;MACjD;IACJ;IACA,IAAI,CAACD,kCAAkC,GAAGC,GAAG;IAC7C,IAAIA,GAAG,EAAE;MACL,IAAI,CAACJ,eAAe,CAACK,SAAS,GAAG,IAAI,CAACC,UAAU;MAChD,IAAI,CAACN,eAAe,CAACO,+BAA+B,CAACC,MAAM,CAAC,IAAI,CAACC,6BAA6B,CAAC;MAC/F,IAAI,CAACA,6BAA6B,GAAG,IAAI;IAC7C,CAAC,MACI;MACD,IAAI,CAACT,eAAe,CAACK,SAAS,GAAG,CAAC,CAAC;MACnC,IAAI,CAACI,6BAA6B,GAAG,IAAI,CAACT,eAAe,CAACO,+BAA+B,CAACG,GAAG,CAAC,MAAM;QAChG,IAAI,CAACC,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC;MAChC,CAAC,CAAC;IACN;EACJ;EACA;AACJ;AACA;EACI,IAAIC,aAAaA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACb,eAAe,CAACa,aAA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AI,CAAC/B,eAAe,CAACO,+BAA+B,CAACC,MAAM,CAAC,IAAI,CAACC,6BAA6B,CAAC;IAC/F,IAAI,CAACA,6BAA6B,GAAG,IAAI;IACzC,IAAI,CAACT,eAAe,CAACoB,MAAM,GAAG,IAAI,CAACD,eAAe;IAClD,IAAI,CAACnB,eAAe,CAACK,SAAS,GAAG,IAAI,CAACC,UAAU;IAChD,IAAI,CAACN,eAAe,CAACuB,eAAe,GAAG,IAAI,CAACD,gBAAgB;EAChE;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}