Reconstructs the shared skeleton-joint resolver and binds the first subsystem (Torso) to the live skeleton. - Mech::ResolveJoint(name) (mech.cpp @00424b60): GetSegment(name) -> segment joint index -> GetJointSubsystem()->GetJoint(idx). - Verified the JointedMover base streams the full skeleton headlessly: jointCount=19, 40 named segments (gun joints jointlgun/jointrgun, shoulders, hip, leg joints jointlthigh..jointrankle). BT_MECH_LOG [skel] summary; BT_SKEL_DUMP lists every segment/jointIdx. - Torso resolves + binds its twist joint (ResolveJoint(torsoHorizontalJoint)) and pushes currentTwist onto it via Joint::SetRotation (hinge->Radian, ball->EulerAngles yaw). The TEST.EGG mech has a fixed torso (horizJoint='', enabled=0) so its twist path is inert -- correct + guarded, zero Fail. Next joint piece: elevation -> gun joints (jointlgun/jointrgun, the fixed-torso aim mechanism) via weapon-joint binding; then gait leg animation. Both are VISIBLE only under the renderer; headlessly the joint transforms are loggable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2.4 KiB
TORSO.CPP / .HPP — reconstruction notes
Torso (: PowerWatcher) drives torso twist (horizontal) and weapon elevation
(vertical). Tuning rates/limits stream from the resource
(horizontal/verticalRotationPerSecond, horizontal/verticalLimit*,
torsoHorizontalEnabled).
Reconstructed
- Ctor: streams the base rates (deg→rad) + limits +
horizontalEnabled, primescurrentTwist/currentElevation/analog axes to 0, and installsTorsoSimulationas the per-frame Performance (the replicant copy is console-driven viaTorsoCopySimulation, still staged). analogElevationAxis/analogTwistAxismembers +SetAnalogElevationAxis/SetAnalogTwistAxissetters (written byMechControlsMapper::InterpretControls).CurrentTwist()/CurrentElevation()/GetHorizontalEnabled()accessors.TorsoSimulation(Scalar)— per-frame aim integration (authentic core):currentElevation += analogElevationAxis · baseElevationRate · dt, clamped to [verticalLimitBottom, verticalLimitTop];- if
horizontalEnabled:currentTwist += analogTwistAxis · baseTwistRate · dt, clamped to [horizontalLimitLeft, horizontalLimitRight].
VERIFIED (BT_MECH_LOG [mppr] torsoElev=, forced-input BT_FORCE_ELEV):
stick pitch 0.8 slews the elevation up and clamps at the authentic
verticalLimitTop = 0.349 rad = 20°. Zero Fail.
Skeleton-joint binding (2026-07-21)
The twist joints are now RESOLVED and BOUND: the ctor calls
owner->ResolveJoint(torsoHorizontalJoint / torsoHorizontalShadowJoint) (the
skeleton is live — see MECH.NOTES.md), stores them as Joint*, and
TorsoSimulation pushes currentTwist onto horizontalJointNode via
Joint::SetRotation (hinge → Radian; ball → EulerAngles yaw).
The bring-up TEST.EGG mech has a FIXED torso (horizJoint='', enabled=0), so
its twist path is inert — correctly guarded (null joint → no apply, no crash). A
torso-twist mech drives the joint. Verified headlessly; the VISUAL rotation
needs the renderer.
Deferred
- Elevation → gun joints. This mech aims by pitching the guns
(
jointlgun/jointrgun), not twisting the torso.currentElevationstill only advances the scalar state; applying it to the gun joints needs the weapon-joint binding (resolved from the weapon subsystems, not the torso resource) — the next joint piece. - HUD free-aim slew, look/eyepoint commit,
TorsoCopySimulation(replicant console-driven aim) — still staged.