diff --git a/game/reconstructed/torso.cpp b/game/reconstructed/torso.cpp index 232b5dd..5808b87 100644 --- a/game/reconstructed/torso.cpp +++ b/game/reconstructed/torso.cpp @@ -143,11 +143,45 @@ Receiver::MessageHandlerSet Torso::AttributeIndexSet Torso::AttributeIndex; +// (AUDIO_FIDELITY F16) the real Torso attribute table, binary parity (dense +// ids 3..15 from MechSubsystem::NextAttributeID; offsets are the binary's, +// documented on the members). Un-deadens the torso-twist servo whir: +// TorsoTwistInt01/Ext01 pitch/gate on SpeedOfTorsoHorizontal, the stop clunk +// matches MotionState==2 (the limit-hit frame statusFlags already publishes). +const Torso::IndexEntry + Torso::AttributePointers[]= +{ + ATTRIBUTE_ENTRY(Torso, RotationOfTorsoVertical, currentElevation), // 3 @0x1E4 + ATTRIBUTE_ENTRY(Torso, RotationOfTorsoHorizontal, currentTwist), // 4 @0x1D8 + ATTRIBUTE_ENTRY(Torso, HorizontalLimitRight, horizontalLimitRight), // 5 @0x1DC + ATTRIBUTE_ENTRY(Torso, HorizontalLimitLeft, horizontalLimitLeft), // 6 @0x1E0 + ATTRIBUTE_ENTRY(Torso, SpeedOfTorsoVertical, elevationVelocity), // 7 @0x1EC + ATTRIBUTE_ENTRY(Torso, SpeedOfTorsoHorizontal, twistVelocity), // 8 @0x1E8 + ATTRIBUTE_ENTRY(Torso, StickPosition, analogTwistAxis), // 9 @0x1F0 + ATTRIBUTE_ENTRY(Torso, TorsoUp, elevateUpCommand), // 10 @0x1F8 + ATTRIBUTE_ENTRY(Torso, TorsoDown, elevateDownCommand), // 11 @0x1FC + ATTRIBUTE_ENTRY(Torso, TorsoLeft, twistLeftCommand), // 12 @0x200 + ATTRIBUTE_ENTRY(Torso, TorsoRight, twistRightCommand), // 13 @0x204 + ATTRIBUTE_ENTRY(Torso, TorsoCenter, centerCommand), // 14 @0x208 + ATTRIBUTE_ENTRY(Torso, MotionState, statusFlags) // 15 @0x20C +}; + +Torso::AttributeIndexSet& + Torso::GetAttributeIndex() +{ + static Torso::AttributeIndexSet attributeIndex( + ELEMENTS(Torso::AttributePointers), + Torso::AttributePointers, + MechSubsystem::GetAttributeIndex() + ); + return attributeIndex; +} + Torso::SharedData Torso::DefaultData( &Torso::ClassDerivations, Torso::MessageHandlers, - Torso::AttributeIndex, + Torso::GetAttributeIndex(), Torso::StateCount ); diff --git a/game/reconstructed/torso.hpp b/game/reconstructed/torso.hpp index 25b1cb8..89a8da8 100644 --- a/game/reconstructed/torso.hpp +++ b/game/reconstructed/torso.hpp @@ -100,6 +100,34 @@ class Joint; // engine skeleton node (JOINT.h); the twist target static Receiver::MessageHandlerSet MessageHandlers; static AttributeIndexSet AttributeIndex; + // (AUDIO_FIDELITY F16) the binary Torso attribute table [T1, rows + // keyed on the SpeedOfTorsoHorizontal string]: dense ids 3..15 + // starting at MechSubsystem::NextAttributeID (HeatWatcher/PowerWatcher + // publish nothing -- binary parity). The authored torso-twist servo + // whir reads SpeedOfTorsoHorizontal (scale: pitch over 0.5..0.9 + + // start/stop trigger at 0.25 -- the |yaw rate| the binary abs's) and + // MotionState (match ==2 = limit-hit frame -> the stop clunk). + enum { + RotationOfTorsoVerticalAttributeID = MechSubsystem::NextAttributeID, // 3 @0x1E4 currentElevation + RotationOfTorsoHorizontalAttributeID, // 4 @0x1D8 currentTwist + HorizontalLimitRightAttributeID, // 5 @0x1DC + HorizontalLimitLeftAttributeID, // 6 @0x1E0 + SpeedOfTorsoVerticalAttributeID, // 7 @0x1EC elevationVelocity (|rate|) + SpeedOfTorsoHorizontalAttributeID, // 8 @0x1E8 twistVelocity (|rate|) + StickPositionAttributeID, // 9 @0x1F0 analogTwistAxis + TorsoUpAttributeID, // 10 @0x1F8 elevateUpCommand + TorsoDownAttributeID, // 11 @0x1FC elevateDownCommand + TorsoLeftAttributeID, // 12 @0x200 twistLeftCommand + TorsoRightAttributeID, // 13 @0x204 twistRightCommand + TorsoCenterAttributeID, // 14 @0x208 centerCommand + MotionStateAttributeID, // 15 @0x20C statusFlags + NextAttributeID + }; + private: + static const IndexEntry AttributePointers[]; + public: + static AttributeIndexSet& GetAttributeIndex(); + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // BT segment / base-state / joint compatibility shims. //