Investigated the next planned binding (elevation -> gun joints jointlgun/ jointrgun) before implementing it, and found it was the wrong target: BT411's own reverse-engineering history records that NO gun/arm elevation joint exists in the authentic engine. The pod's stick-Y aim pitches the COCKPIT EYE and the weapon boresight directly (mech4.cpp @~5219, pixel-calibrated against real screenshots) -- the torso geometry never tilts for elevation on this mech family. Reconstructing a gun-joint binding would have been invented behavior. - MECH.HPP: EulerAngles eyepointRotation member (out of reservedState, now [208]) + GetEyepointRotation() accessor. - MECH.CPP: composed each frame in Simulate -- eyepointRotation = EulerAngles(Radian(Normalize(lookPitch+elevation)), Radian(Normalize(lookYaw)), Radian(0)), reading Torso::CurrentElevation() via sinkSourceSubsystem. lookPitch/lookYaw are 0 until the look-button wave (BTCommitLookState) lands. Verified: BT_FORCE_ELEV=0.8 -> torsoElev and eyePitch both read 0.349066 (the authentic 20 degree resource limit) every frame, exact match; neutral -> 0. Zero Fail. Corrected TORSO.NOTES.md's prior (wrong) "next: gun joints" note. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
56 lines
2.8 KiB
Markdown
56 lines
2.8 KiB
Markdown
# 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`, primes
|
|
`currentTwist`/`currentElevation`/analog axes to 0, and installs
|
|
`TorsoSimulation` as the per-frame Performance (the replicant copy is
|
|
console-driven via `TorsoCopySimulation`, still staged).
|
|
- `analogElevationAxis` / `analogTwistAxis` members + `SetAnalogElevationAxis` /
|
|
`SetAnalogTwistAxis` setters (written by `MechControlsMapper::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.
|
|
|
|
## Elevation does NOT drive a gun joint (corrected 2026-07-21)
|
|
|
|
Checked BT411 before reconstructing a "gun-elevation joint": no such joint
|
|
binding exists anywhere in the authentic engine. `currentElevation` instead
|
|
composes into `Mech::eyepointRotation` (the cockpit-eye / weapon-boresight
|
|
pitch) — see MECH.NOTES.md "PHASE 5.3 INCREMENT 5". `TorsoSimulation` only
|
|
needed to keep advancing the scalar state, which it already did; the missing
|
|
piece was the CONSUMER (`Mech::Simulate`'s eyepoint composition), now
|
|
reconstructed and verified (`torsoElev` == `eyePitch` every frame).
|
|
|
|
## Deferred
|
|
|
|
- HUD free-aim slew, the look-button state machine (`BTCommitLookState` /
|
|
`gBTLookPitch`/`gBTLookYaw` — composes with elevation into the full
|
|
eyepoint), `TorsoCopySimulation` (replicant console-driven aim) — still
|
|
staged.
|