File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments