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

Method update

components/liquid-ether.tsx:718–740  ·  view source on GitHub ↗
(...args: any[])

Source from the content-addressed store, hash-verified

716 this.scene!.add(this.mouse);
717 }
718 update(...args: any[]) {
719 const props = args[0] || {};
720 const forceX = (Mouse.diff.x / 2) * (props.mouse_force || 0);
721 const forceY = (Mouse.diff.y / 2) * (props.mouse_force || 0);
722 const cellScale = props.cellScale || { x: 1, y: 1 };
723 const cursorSize = props.cursor_size || 0;
724 const cursorSizeX = cursorSize * cellScale.x;
725 const cursorSizeY = cursorSize * cellScale.y;
726 const centerX = Math.min(
727 Math.max(Mouse.coords.x, -1 + cursorSizeX + cellScale.x * 2),
728 1 - cursorSizeX - cellScale.x * 2
729 );
730 const centerY = Math.min(
731 Math.max(Mouse.coords.y, -1 + cursorSizeY + cellScale.y * 2),
732 1 - cursorSizeY - cellScale.y * 2
733 );
734 const uniforms = (this.mouse.material as THREE.RawShaderMaterial)
735 .uniforms;
736 uniforms.force.value.set(forceX, forceY);
737 uniforms.center.value.set(centerX, centerY);
738 uniforms.scale.value.set(cursorSize, cursorSize);
739 super.update();
740 }
741 }
742
743 class Viscous extends ShaderPass {

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected