This constraint consists of a single constraint equation that enforces that a unit vector v1 fixed to one body (the "base body") must maintain a fixed angle theta with respect to a unit vector v2 fixed on the other body (the "follower body").
More...
This constraint consists of a single constraint equation that enforces that a unit vector v1 fixed to one body (the "base body") must maintain a fixed angle theta with respect to a unit vector v2 fixed on the other body (the "follower body").
This can be done with a single constraint equation as long as theta is sufficiently far away from 0 and +/-Pi (180 degrees), with the numerically best performance at theta=Pi/2 (90 degrees).
- Warning:
- Do not use this constraint to align the vectors, that is for angles near 0 or +/- Pi; performance will noticeably degrade within a few degrees of these limits and numerical integration will eventually fail at the limits.
If you want to enforce that two axes are aligned with one another (that is, the angle between them is 0 or +/-Pi), that takes two constraint equations since the only remaining rotation is about the common axis. (That is, two rotational degrees of freedom are removed; that can't be done with one constraint equation -- the situation is analogous to the inability of a Rod (distance) constraint to keep two points at 0 distance.) Instead, you can use two ConstantAngle constraints on pairs of vectors perpendicular to the aligned ones, so that each ConstantAngle is set to the optimal 90 degrees.
This constraint is enforced by an internal scalar torque applied equal and opposite on each body, about the mutual perpendicular to the two vectors.
The assembly condition is the same as the run-time constraint: the bodies must be rotated until the vectors have the right angle between them.