fix(weapons): the wrist turns the hand, and the gun stays on the aim line
The weapon is a child of a BoneAttachment3D on the trigger hand, so the two were welded by construction. Every degree `wrist_r` turned swung the barrel the same degree off the aim line — and took with it every control that could have corrected for it, because they are all expressed relative to that same hand. There was no combination of sliders that aligned a hand to a gun, which is the one thing the knob exists for. Both outcomes are now computed where the hand's local pose is set: the rotation the hand would take without the wrist offset, and the one it takes with it. The hand gets the second; the difference between them is exactly the counter-rotation the weapon mount needs, in the hand's own local frame, and `SkinnedPlayerModel._hold_weapon_still` applies it to the mount each frame. The gun ends up precisely where the solver put it. That also gives the two controls a clean split, which is what makes them usable together: TRIGGER / SUPPORT WRIST (hold) turns the HAND, gun stays on the aim line Grip roll / pitch / yaw (anchors) turns the GUN inside the hand Identity when `wrist_r` is untuned, so a character nobody has tuned mounts its weapon exactly as before. Applied in `_process` rather than inside the modifier pass on purpose. The gun's mount is not something the skeleton owns, and the compensated value only changes when a slider moves or the ADS blend travels, so one frame of lag is a fraction of a degree; reaching into the modifier to touch a scene node would be worse. wrist_gun_check asserts both halves, because only asserting the first is how this shipped broken: the hand must TURN, or the knob does nothing, and the gun must NOT, or the knob cannot be used. Across both poses and all three axes the hand turns 28.2-28.7 degrees for a 0.5 rad knob and the gun moves 0.1-0.6 — against the ~28 it would move if it were still following the wrist. The residue is the arm's own IK settling, since the hand's rotation feeds the chain that places the shoulder. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a97ccca13c
commit
e97de9aafd
@@ -143,6 +143,14 @@ standing still changed. `pitch` exists at low ready only: down the sights the
|
||||
muzzle follows the camera, so there is nothing there to tune, and a slider that
|
||||
does nothing is worse than a missing one.
|
||||
|
||||
**The wrists turn the HAND, not the gun.** The weapon is a child of a
|
||||
BoneAttachment3D on the trigger hand, so the two are welded by construction: a
|
||||
wrist rotation swings the barrel off the aim line and takes every control that
|
||||
could correct it along with it, which made the knob useless for aligning a hand
|
||||
to a gun. `ShooterPoseModifier.wrist_comp_r` is the exact counter-rotation in
|
||||
the hand's local frame, and `SkinnedPlayerModel._hold_weapon_still` applies it.
|
||||
To rotate the GUN inside the hand instead, use the grip rotation in ANCHORS.
|
||||
|
||||
Knobs that describe the WEAPON and the hands on it — where each hand sits along
|
||||
it and off its barrel line, the finger curls, the weapon size — are shared,
|
||||
because shouldering a gun does not move the hand along it. Both wrists take
|
||||
|
||||
Reference in New Issue
Block a user