瀏覽代碼

Change VGR movement to be linear

anfeny 3 月之前
父節點
當前提交
1ee7bb7065
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      dashboard/src/static/js/sim/components/vgr.js

+ 3 - 1
dashboard/src/static/js/sim/components/vgr.js

@@ -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);