|
@@ -36,6 +36,7 @@ export class Vgr {
|
|
|
const dy = targetY - this.baseY;
|
|
|
|
|
|
this.targetAngle = atan2(dy, dx);
|
|
|
+ console.log(`Target angle: ${this.targetAngle}`);
|
|
|
this.targetLength = min(dist(this.baseX, this.baseY, targetX, targetY), this.maxArmLength);
|
|
|
|
|
|
this.startAngle = this.angle;
|
|
@@ -57,7 +58,8 @@ export class Vgr {
|
|
|
const elapsed = now - this.startTime;
|
|
|
const t = constrain(elapsed / this.duration, 0, 1);
|
|
|
//const easeT = easeInOutCubic(t); // smoother easing
|
|
|
- const easeT = easeInOutSine(t); // smoother easing
|
|
|
+ //const easeT = easeInOutSine(t); // smoother easing
|
|
|
+ const easeT = t; // linear for now
|
|
|
|
|
|
this.angle = lerpAngle(this.startAngle, this.targetAngle, easeT);
|
|
|
this.armLength = lerp(this.startLength, this.targetLength, easeT);
|