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

Method update

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

Source from the content-addressed store, hash-verified

312 this.isHoverInside = false;
313 }
314 update() {
315 if (this.takeoverActive) {
316 const t =
317 (performance.now() - this.takeoverStartTime) /
318 (this.takeoverDuration * 1000);
319 if (t >= 1) {
320 this.takeoverActive = false;
321 this.coords.copy(this.takeoverTo);
322 this.coords_old.copy(this.coords);
323 this.diff.set(0, 0);
324 } else {
325 const k = t * t * (3 - 2 * t);
326 this.coords.copy(this.takeoverFrom).lerp(this.takeoverTo, k);
327 }
328 }
329 this.diff.subVectors(this.coords, this.coords_old);
330 this.coords_old.copy(this.coords);
331 if (this.coords_old.x === 0 && this.coords_old.y === 0)
332 this.diff.set(0, 0);
333 if (this.isAutoActive && !this.takeoverActive)
334 this.diff.multiplyScalar(this.autoIntensity);
335 }
336 }
337 const Mouse = new MouseClass();
338

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected