|
void | SetLimits (float inTwistMinAngle, float inTwistMaxAngle, float inSwingYHalfAngle, float inSwingZHalfAngle) |
| Set limits for this constraint (see description above for parameters)
|
|
void | ClampSwingTwist (Quat &ioSwing, bool &outSwingYClamped, bool &outSwingZClamped, Quat &ioTwist, bool &outTwistClamped) const |
| Clamp twist and swing against the constraint limits, returns which parts were clamped (everything assumed in constraint space)
|
|
void | CalculateConstraintProperties (const Body &inBody1, const Body &inBody2, QuatArg inConstraintRotation, QuatArg inConstraintToWorld) |
|
void | Deactivate () |
| Deactivate this constraint.
|
|
bool | IsActive () const |
| Check if constraint is active.
|
|
void | WarmStart (Body &ioBody1, Body &ioBody2, float inWarmStartImpulseRatio) |
| Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses.
|
|
bool | SolveVelocityConstraint (Body &ioBody1, Body &ioBody2) |
| Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint equation.
|
|
bool | SolvePositionConstraint (Body &ioBody1, Body &ioBody2, QuatArg inConstraintRotation, QuatArg inConstraintToBody1, QuatArg inConstraintToBody2, float inBaumgarte) const |
|
float | GetTotalSwingYLambda () const |
| Return lagrange multiplier for swing.
|
|
float | GetTotalSwingZLambda () const |
|
float | GetTotalTwistLambda () const |
| Return lagrange multiplier for twist.
|
|
void | SaveState (StateRecorder &inStream) const |
| Save state of this constraint part.
|
|
void | RestoreState (StateRecorder &inStream) |
| Restore state of this constraint part.
|
|
Quaternion based constraint that decomposes the rotation in constraint space in swing and twist: q = q_swing * q_twist where q_swing.x = 0 and where q_twist.y = q_twist.z = 0
- Rotation around the twist (x-axis) is within [inTwistMinAngle, inTwistMaxAngle].
- Rotation around the swing axis (y and z axis) are limited to an ellipsoid in quaternion space formed by the equation:
(q_swing.y / sin(inSwingYHalfAngle / 2))^2 + (q_swing.z / sin(inSwingZHalfAngle / 2))^2 <= 1
Which roughly corresponds to an elliptic cone shape with major axis (inSwingYHalfAngle, inSwingZHalfAngle).
In case inSwingYHalfAngle = 0, the rotation around Y will be constrained to 0 and the rotation around Z will be constrained between [-inSwingZHalfAngle, inSwingZHalfAngle]. Vice versa if inSwingZHalfAngle = 0.