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

Function applyOptionsFromProps

components/liquid-ether.tsx:1190–1208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1188 webglRef.current = webgl;
1189
1190 const applyOptionsFromProps = () => {
1191 if (!webglRef.current) return;
1192 const sim = webglRef.current.output?.simulation;
1193 if (!sim) return;
1194 const prevRes = sim.options.resolution;
1195 Object.assign(sim.options, {
1196 mouse_force: mouseForce,
1197 cursor_size: cursorSize,
1198 isViscous,
1199 viscous,
1200 iterations_viscous: iterationsViscous,
1201 iterations_poisson: iterationsPoisson,
1202 dt,
1203 BFECC,
1204 resolution,
1205 isBounce,
1206 });
1207 if (resolution !== prevRes) sim.resize();
1208 };
1209 applyOptionsFromProps();
1210 webgl.start();
1211

Callers 1

LiquidEtherFunction · 0.85

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected