| 854 | } |
| 855 | |
| 856 | class Pressure extends ShaderPass { |
| 857 | constructor(simProps: any) { |
| 858 | super({ |
| 859 | material: { |
| 860 | vertexShader: face_vert, |
| 861 | fragmentShader: pressure_frag, |
| 862 | uniforms: { |
| 863 | boundarySpace: { value: simProps.boundarySpace }, |
| 864 | pressure: { value: simProps.src_p.texture }, |
| 865 | velocity: { value: simProps.src_v.texture }, |
| 866 | px: { value: simProps.cellScale }, |
| 867 | dt: { value: simProps.dt }, |
| 868 | }, |
| 869 | }, |
| 870 | output: simProps.dst, |
| 871 | }); |
| 872 | this.init(); |
| 873 | } |
| 874 | update(...args: any[]) { |
| 875 | const { vel, pressure } = (args[0] || {}) as { |
| 876 | vel?: any; |
| 877 | pressure?: any; |
| 878 | }; |
| 879 | if (this.uniforms && vel && pressure) { |
| 880 | this.uniforms.velocity.value = vel.texture; |
| 881 | this.uniforms.pressure.value = pressure.texture; |
| 882 | } |
| 883 | super.update(); |
| 884 | } |
| 885 | } |
| 886 | |
| 887 | class Simulation { |
| 888 | options: SimOptions; |
nothing calls this directly
no outgoing calls
no test coverage detected