public readonly record struct JointLimitHow 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 FreeA joint with no limit at all.
public float SwingHow far the twist axis may lean from its bind direction, in radians.
public float TwistHow far the joint may turn about that axis, in radians, either way.
public Vector3 AxisWhich way the bone points in the joint's own space. Zero means +Y.
public bool IsFreeWhether it constrains anything.
public Vector3 DirectionThe twist axis, normalised, with the default filled in.
Methods (2)
public static JointLimit Of(float swing, float twist, Vector3 axis = default(Vector3))A cone and a twist, in degrees, which is how an artist says it.
public Quaternion Clamp(Quaternion local, Quaternion bind, out bool clamped)Brings a rotation back inside the limit.
Used by (4)
- DefaultConstraintArbiterVixen.Animation
- JointLimitTestsVixen.Animation.Tests
- SkeletonVixen.Animation
- VariationHarnessVixen.Animation