MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / Pressure

Class Pressure

components/liquid-ether.tsx:856–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected