MP: peer true-mirror cadence -- drive the body clip from actual replicated motion (task #50)
Toward a truer mirror (user: peer 'hesitates/skips on accel/decel, master has
smoother transitions'). The body channel FOLLOWS the master's replicated STATE
(96a896a) but its CADENCE (bodyCycleSpeed) is still slewed LOCALLY toward the
replicated commanded speed -- which drifts from the master's actual cadence, so
the animation phase wanders until a record snaps it (the hesitation).
FIX (replicant-gated, single-player untouched): peerMirrorSpeed member = the
actual replicated ground speed (|updateVelocity|, set in the peer branch); the
body channel walk (6/7) + reverse (0xc/0xd) cases override bodyCycleSpeed with
it (clamped to the state's band) right before the clip advance, so the peer's
clip advances at the master's REAL rate instead of a locally-drifting slew.
peerMirrorSpeed = -1 on the master/single-player -> the authentic slew runs.
BT_NO_MIRROR_CAD / BT_PEER_LEGCH revert.
Verified autonomous (through-zero sweep): no crash, body channel advances forward
(back-steps ~0), feet track (position ratio 1.05, maxStep 1.68u). Perceived
smoothness is the visual test (harness saturates).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f094d78df1
commit
23f1532fb0
@@ -999,6 +999,9 @@ Scalar
|
||||
if (bodyCycleSpeed > bodyTargetSpeed) bodyCycleSpeed = bodyTargetSpeed;
|
||||
if (bodyCycleSpeed > walkStrideLength) bodyCycleSpeed = walkStrideLength;
|
||||
}
|
||||
if (peerMirrorSpeed >= 0.0f) // peer: cadence == actual mirrored ground speed
|
||||
bodyCycleSpeed = (peerMirrorSpeed < standSpeed) ? standSpeed
|
||||
: ((peerMirrorSpeed > walkStrideLength) ? walkStrideLength : peerMirrorSpeed);
|
||||
distance = bodyAnimation.Advance(
|
||||
time_slice * (bodyCycleSpeed / walkStrideLength) * globalTimeScale, loop);
|
||||
break;
|
||||
@@ -1019,6 +1022,9 @@ Scalar
|
||||
if (bodyCycleSpeed > bodyTargetSpeed) bodyCycleSpeed = bodyTargetSpeed;
|
||||
if (bodyCycleSpeed > reverseSpeedMax2) bodyCycleSpeed = reverseSpeedMax2;
|
||||
}
|
||||
if (peerMirrorSpeed >= 0.0f) // peer: cadence == actual mirrored ground speed
|
||||
bodyCycleSpeed = (peerMirrorSpeed < reverseSpeedMax) ? reverseSpeedMax
|
||||
: ((peerMirrorSpeed > reverseSpeedMax2) ? reverseSpeedMax2 : peerMirrorSpeed);
|
||||
distance = bodyAnimation.Advance(
|
||||
time_slice * (bodyCycleSpeed / reverseStrideLength) * globalTimeScale, loop);
|
||||
break;
|
||||
@@ -1159,6 +1165,9 @@ Scalar
|
||||
if (bodyCycleSpeed > bodyTargetSpeed) bodyCycleSpeed = bodyTargetSpeed;
|
||||
if (bodyCycleSpeed > walkStrideLength) bodyCycleSpeed = walkStrideLength;
|
||||
}
|
||||
if (peerMirrorSpeed >= 0.0f) // peer: cadence == actual mirrored ground speed
|
||||
bodyCycleSpeed = (peerMirrorSpeed < standSpeed) ? standSpeed
|
||||
: ((peerMirrorSpeed > walkStrideLength) ? walkStrideLength : peerMirrorSpeed);
|
||||
distance = bodyAnimation.Advance(
|
||||
time_slice * (bodyCycleSpeed / walkStrideLength) * globalTimeScale, loop);
|
||||
break;
|
||||
@@ -1179,6 +1188,9 @@ Scalar
|
||||
if (bodyCycleSpeed > bodyTargetSpeed) bodyCycleSpeed = bodyTargetSpeed;
|
||||
if (bodyCycleSpeed > reverseSpeedMax2) bodyCycleSpeed = reverseSpeedMax2;
|
||||
}
|
||||
if (peerMirrorSpeed >= 0.0f) // peer: cadence == actual mirrored ground speed
|
||||
bodyCycleSpeed = (peerMirrorSpeed < reverseSpeedMax) ? reverseSpeedMax
|
||||
: ((peerMirrorSpeed > reverseSpeedMax2) ? reverseSpeedMax2 : peerMirrorSpeed);
|
||||
distance = bodyAnimation.Advance(
|
||||
time_slice * (bodyCycleSpeed / reverseStrideLength) * globalTimeScale, loop);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user