Vixen
02b45cc4
csharp
public sealed class AttachmentSocket

An attachment point on a character, whose offset from the bone is itself solved.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ A socket is adapted, not just read, and this is what makes a held prop work across bodies. A pistol hangs off an attachment point that is a child of a hand bone, and the offset from bone to socket was authored against one hand. Put the same pistol in a hand 20 % larger and preserving that offset drives the grip into the palm; preserving the grip contact and letting the offset move is what a person would do.

So the socket names a SurfaceCoordinate on the hand's own proxy shape, and the solve moves the socket rather than a joint: the point on the prop that must touch the palm is placed on the palm's surface, wherever that surface turned out to be for this body. One authored socket, every hand.

⚠ This is also how a prop becomes solvable at all. Without it, a goal on a held object is a goal on something with no chain to move, and the only recourse is to move the character's arm — which is right for reaching and wrong for adjusting a grip.

Fields and properties (9)

  • public required Symbol Name

    What it is called — right-hand-grip.

  • public required int Joint

    Which joint it hangs off.

  • public BoneTransform Offset

    Where it sits relative to that joint, as authored.

  • public SurfaceCoordinate? Contact

    Where on the body it should touch, or to leave the offset alone.

  • public Vector3 Grip

    The point on the attached thing that touches the body, in the socket's own space.

  • public float Weight

    How much of the correction to apply, in [0, 1].

  • public BoneTransform Solved

    Where it ended up, in the character's model space.

  • public bool IsAdapted

    Whether the last solve resolved its contact.

  • public float Adjustment

    How far the contact had to move, in metres.

Used by (3)

  • AttachmentFrameVixen.Animation
  • AttachmentSocketsVixen.Animation
  • ProxyShapeTestsVixen.Animation.Tests