Vixen
02b45cc4
csharp
public readonly record struct JointLimit

How far a joint may turn from where it was modelled.

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

Remarks

A swing cone and a twist range, about one axis, relative to the bind pose. A shoulder is a wide cone with some twist; an elbow is a narrow cone and almost none; a forearm is the opposite. That is the fidelity a constraint solver can use, and it is the parameterisation that stays well behaved when a correction has to be clamped — which per-axis Euler ranges do not, because clamping three angles in an order changes the answer depending on the order.

⚠ Relative to the bind pose and not to the parent. A rig's bind pose is where the artist put the joint, and "forty degrees from there" is what an artist means. Measuring from the parent's axes would make the same limit mean something different on two rigs that differ only in how their bones are oriented.

⚠ Free is the default and the zero value is not. A zeroed JointLimit is a joint that may not move at all, which is a legitimate thing to author and a catastrophic default — every existing rig would freeze. Nothing reads a limit unless a joint's Limited flag says to, so the two cases cannot be confused.

Fields and properties (6)

  • public static JointLimit Free

    A joint with no limit at all.

  • public float Swing

    How far the twist axis may lean from its bind direction, in radians.

  • public float Twist

    How far the joint may turn about that axis, in radians, either way.

  • public Vector3 Axis

    Which way the bone points in the joint's own space. Zero means +Y.

  • public bool IsFree

    Whether it constrains anything.

  • public Vector3 Direction

    The twist axis, normalised, with the default filled in.

Methods (2)

Used by (4)

  • DefaultConstraintArbiterVixen.Animation
  • JointLimitTestsVixen.Animation.Tests
  • SkeletonVixen.Animation
  • VariationHarnessVixen.Animation