Gyro tail + audio (task #66): the INSTABILITY MODEL -- mech+0x3F0 reconstructed
Byte-decoded the un-exported master-perf block @0x4aad3d-0x4aaf14 (capstone;
the same gap that held the F5 footstep code) [T1]:
instab = (min(|AccelerationLastFrame| / maxUnstableAcceleration, 1)
x unstableAccelerationEffect)^2
instab += clamp((demand - legCycleSpeed)/demand, <=1) # "gun the engine"
x unstableGunTheEngineEffect # (demand clamped to
# [gimpStride(neg), runMax2])
if (legAnimationState == 4 /*turn-in-place*/) instab += unstableStopedTurnEffect
clamp to 1 -> mech+0x3F0 -> gyro->swayBias (gyro+0x3A8)
Every piece resolves to already-reconstructed structure: the model-record
tuning block rec+0x80..0x94 (ctor copy @0x4a2593 -- the six authored
Unstable* fields, previously parked in the Wword scratch bank, now real
members); AccelerationLastFrame@0x82c = the snapshot of the ring-derived
localAcceleration (copied at the perf tail @0x4ab142); CurrentSpeed@0x348 =
legCycleSpeed; the trn state 4 gate; and the gyro feed lands in the
EXISTING swayBias member + GyroscopeSimulation consumer (task #56) --
GyroFrameJointWrite's "0.0f model TBD" argument is now the live value.
UnstablePercentage (binary id 52 @0x3F0) binds the real member: the LAST
dead audio attribute is live -- the authored instability alarm (start
thresh 0.01 + volume = the fraction) sounds under hard maneuvers, and the
cockpit ambient sway now scales with reckless driving.
Live verification (30s, 0.6-throttle run): instab 0.38 during the walk->run
chase (cyc 22.2 vs demand 33.6), settling to 0.002-0.12 per-stride ripple at
steady run; attribute binds with live float values; [instab] trace under
BT_GYRO_TRACE. unstableSuperStopEffect/unstableHighVelocityEffect writers
remain unlocated (plausibly the airborne perf variant) -- noted on members.
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
c581553a6c
commit
c51d64a6b8
@@ -733,7 +733,7 @@ const Mech::IndexEntry
|
||||
ATTRIBUTE_ENTRY(Mech, RadarAngularPosition, radarAngularPosition),// 0x31 (Quaternion* -> localOrigin)
|
||||
ATTRIBUTE_ENTRY(Mech, RearFiring, attrPad), // 0x32
|
||||
ATTRIBUTE_ENTRY(Mech, RequestDuckAnimation, attrPad), // 0x33
|
||||
ATTRIBUTE_ENTRY(Mech, UnstablePercentage, attrPad), // 0x34
|
||||
ATTRIBUTE_ENTRY(Mech, UnstablePercentage, unstablePercentage), // 0x34 (task #66: the instability alarm; binary id 52 @0x3F0)
|
||||
ATTRIBUTE_ENTRY(Mech, SuperStop, attrPad), // 0x35
|
||||
// (AUDIO_FIDELITY F7) real missile-alarm backing: binary ids 54/56 @0x3fc/
|
||||
// 0x400 [T1 table @0x50c0b0/0x50c0d0]; the authored beeper (match 1/0) +
|
||||
@@ -939,6 +939,9 @@ Mech::Mech(
|
||||
accelPrevFwdMean = 0.0f;
|
||||
accelPrevVertMean = 0.0f;
|
||||
accelPrevPos = localOrigin.linearPosition;
|
||||
// (task #66) instability accumulator: the binary reset zeroes 0x3F0
|
||||
// (part_012.c:9420); the tuning members are set from the model record below.
|
||||
unstablePercentage = 0.0f;
|
||||
fwdSpeedFiltered = 0.0f; // smoothed published velocity (see mech4 derive)
|
||||
vertSpeedFiltered = 0.0f;
|
||||
{ extern void *g_btFootStepAddr; g_btFootStepAddr = &footStep; } // DIAG: watcher-poll tracer target
|
||||
@@ -1391,12 +1394,14 @@ Mech::Mech(
|
||||
<< " superStop=" << airborneCycleRate
|
||||
<< " throttleAdj=" << forwardThrottleScale << std::endl;
|
||||
Wword(0x12f) = model->relativeMechValue; // rec+0x70 -> mech+0x4bc
|
||||
Wword(0x1e1) = model->maxUnstableAcceleration; // rec+0x80-0x94 -> mech+0x784..0x798
|
||||
Wword(0x1e2) = model->unstableAccelerationEffect; // (the six Unstable* effects)
|
||||
Wword(0x1e3) = model->unstableGunTheEngineEffect;
|
||||
Wword(0x1e4) = model->unstableSuperStopEffect;
|
||||
Wword(0x1e5) = model->unstableHighVelocityEffect;
|
||||
Wword(0x1e6) = model->unstableStopedTurnEffect;
|
||||
// (task #66) the six Unstable* tuning fields are REAL members now (the
|
||||
// instability model consumes them); binary rec+0x80-0x94 -> mech+0x784..0x798.
|
||||
maxUnstableAcceleration = model->maxUnstableAcceleration;
|
||||
unstableAccelerationEffect = model->unstableAccelerationEffect;
|
||||
unstableGunTheEngineEffect = model->unstableGunTheEngineEffect;
|
||||
unstableSuperStopEffect = model->unstableSuperStopEffect;
|
||||
unstableHighVelocityEffect = model->unstableHighVelocityEffect;
|
||||
unstableStopedTurnEffect = model->unstableStopedTurnEffect;
|
||||
|
||||
// Angle fields converted from degrees to radians.
|
||||
Wword(0x159) = (int)(model->lookLeftAngle * DegreesToRadians); // +0x50
|
||||
|
||||
Reference in New Issue
Block a user