Locomotion: wire the AUTHENTIC per-mech turn-rate lerp (task #64b)

The master-perf disasm (0x4aa3d3-0x4aa4ff) computes the yaw rate as
lerp(walkingTurnRate@0x574, runningTurnRate@0x578) by ground speed, not a
constant. Wired it into the drive, replacing the bring-up constant kDriveTurnRate:

- walkingTurnRate/runningTurnRate are now REAL named members. The ctor's
  `Wword(0x15d)/(0x15e) = model->...TurnRate * DegreesToRadians` writes were
  NO-OPS -- Wword() returns a shared static scratch cell, so the rates were
  silently discarded. Now stored + read by name.
- The drive (mech4.cpp) computes authTurnRate: base = walkingTurnRate; above
  reverseSpeedMax(0x538) lerp walk->run across [walkStride 0x534 .. topSpeed
  0x34c] with an over-run falloff runningTurnRate/t^2; clamp >=0; zeroed in the
  death/limbo/airborne leg states (1/2/3) or when deathAnimationLatched(0x650) is
  set. Falls back to kDriveTurnRate if the model gave no rates.

The lerp is a RUN-speed refinement -- below reverseSpeedMax (walk / turn-in-place)
the rate is the constant walkTR base; runningTurnRate < walkingTurnRate (a running
mech is less maneuverable). Verified headless (DEV mech, BT_TURN_LOG): walkTR
1.309 rad/s (75 deg/s), runTR 0.873 (50 deg/s), turn-in-place + walk yaw at walkTR,
no crash. [T1 logic / T2 runtime]

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-14 05:48:51 -05:00
co-authored by Claude Fable 5
parent 35c30bda67
commit a83995a755
4 changed files with 67 additions and 23 deletions
+7 -8
View File
@@ -1325,14 +1325,13 @@ Mech::Mech(
<< " turnVel=" << updateTurnVelocityDeadband
<< " turnAngle=" << updateTurnAngleDeadband << " (rad)" << std::endl;
Wword(0x10c) = model->timeDelay; // rec+0xA4 -> mech+0x430
// NOTE: the decomp writes word slots this[0x15d]/this[0x15e]. Routed to the
// scratch bank (unnamed pose-angle fields) -- writing through (float*)(this +
// 0x15d) would be typed-pointer arithmetic on Mech* (== this + 0x15d*sizeof(Mech)).
// The AUTHENTIC per-mech turn rates (rec+0x60/0x64, deg->rad ->
// mech+0x574/0x578) -- still absorbed pending the turn-code wiring
// (locomotion polish item: the port turns at a bring-up constant rate).
Wword(0x15d) = model->walkingTurnRate * DegreesToRadians;
Wword(0x15e) = model->runningTurnRate * DegreesToRadians;
// The AUTHENTIC per-mech turn rates (rec+0x60/0x64, deg->rad -> mech+0x574/0x578).
// The decomp writes word slots this[0x15d]/this[0x15e] (== 0x574/0x578); stored in
// real named members now (task #64b) -- read by the master-perf turn-rate lerp in
// the drive (mech4.cpp) that yaws at lerp(walkingTurnRate, runningTurnRate) by speed
// instead of the old bring-up constant kDriveTurnRate.
walkingTurnRate = model->walkingTurnRate * DegreesToRadians;
runningTurnRate = model->runningTurnRate * DegreesToRadians;
//
// SHADOW JOINT resolve (task #20; CORRECTED -- the earlier draft misread