Skip to content

Commit 439541c

Browse files
committed
Remove frame-rate-dependent turn clamping.
1 parent 8094ad0 commit 439541c

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

src/scripts/robot/animation.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ export class AnimationController {
8484
*/
8585
private readonly detourPath: THREE.CatmullRomCurve3;
8686

87-
/** Previous frame's facing direction. */
88-
private prevTangent: THREE.Vector3 | null = null;
8987

9088
constructor(refs: VehicleRefs) {
9189
this.refs = refs;
@@ -221,20 +219,6 @@ export class AnimationController {
221219
wheelSpeed = 6;
222220
}
223221

224-
// ── Smooth facing direction (clamped angular rate) ──
225-
// Limit rotation to MAX_TURN_RAD_PER_SEC * delta so large direction changes
226-
// (like reverse → arc) produce a gradual steering motion at any frame rate.
227-
const MAX_TURN_RAD_PER_SEC = 2.1; // ~120°/sec
228-
const maxTurnThisFrame = MAX_TURN_RAD_PER_SEC * delta;
229-
if (this.prevTangent) {
230-
const angle = this.prevTangent.angleTo(tangent);
231-
if (angle > maxTurnThisFrame) {
232-
const fraction = maxTurnThisFrame / angle;
233-
tangent = this.prevTangent.clone().lerp(tangent, fraction).normalize();
234-
}
235-
}
236-
this.prevTangent = tangent.clone();
237-
238222
// ── Apply position + facing ──
239223
this.refs.vehicle.position.copy(pos);
240224
const lookTarget = pos.clone().add(tangent);

0 commit comments

Comments
 (0)