Make held items follow bent arms and straighten the first-person arm

- PlayerModelMixin: after translateToHand, move the item from the hand of
  the straight arm to the hand of the bent one (BendTransforms.attachAt,
  the same rigid move as the ring at the hand). PlayerModel overrides
  translateToHand for slim arms without calling HumanoidModel's, so the
  hook has to be on PlayerModel.
- FirstPersonHandMixin: the first-person arm is drawn from the shared
  model without setupAnim, so clear any bend left by the last
  third-person player.
- LimbBend.start()/end() getters.
- testmod: a hold animation, and gametest shots holding a sword and in
  first person.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-09-26 20:31:01 +02:00
co-authored by claude
parent 7016405e5f
commit c3b0e86548
7 changed files with 144 additions and 1 deletions
@@ -96,6 +96,16 @@ public final class LimbBend {
return segments;
}
/** Top of the limb along Y (its pivot end), as given to the constructor. */
public float start() {
return start;
}
/** Bottom of the limb along Y (the hand or foot end), as given to the constructor. */
public float end() {
return start + length;
}
/** Y positions where the limb is cut into pieces, not counting its ends. */
public float[] cuts() {
float[] cuts = new float[segments - 1];