|  | Jolt Physics
    A multi core friendly Game Physics Engine | 
#include <PointConstraintPart.h>
| Public Member Functions | |
| void | CalculateConstraintProperties (const Body &inBody1, Mat44Arg inRotation1, Vec3Arg inR1, const Body &inBody2, Mat44Arg inRotation2, Vec3Arg inR2) | 
| void | Deactivate () | 
| Deactivate this constraint. | |
| bool | IsActive () const | 
| Check if constraint is active. | |
| void | WarmStart (Body &ioBody1, Body &ioBody2, float inWarmStartImpulseRatio) | 
| bool | SolveVelocityConstraint (Body &ioBody1, Body &ioBody2) | 
| bool | SolvePositionConstraint (Body &ioBody1, Body &ioBody2, float inBaumgarte) const | 
| Vec3 | GetTotalLambda () const | 
| Return lagrange multiplier. | |
| void | SaveState (StateRecorder &inStream) const | 
| Save state of this constraint part. | |
| void | RestoreState (StateRecorder &inStream) | 
| Restore state of this constraint part. | |
Constrains movement along 3 axis
Constraint equation (eq 45):
\[C = p_2 - p_1\]
Jacobian (transposed) (eq 47):
\[J^T = \begin{bmatrix}-E & r1x & E & -r2x^T\end{bmatrix} = \begin{bmatrix}-E^T \\ r1x^T \\ E^T \\ -r2x^T\end{bmatrix} = \begin{bmatrix}-E \\ -r1x \\ E \\ r2x\end{bmatrix}\]
Used terms (here and below, everything in world space):
p1, p2 = constraint points.
r1 = p1 - x1.
r2 = p2 - x2.
r1x = 3x3 matrix for which r1x v = r1 x v (cross product).
x1, x2 = center of mass for the bodies.
v = [v1, w1, v2, w2].
v1, v2 = linear velocity of body 1 and 2.
w1, w2 = angular velocity of body 1 and 2.
M = mass matrix, a diagonal matrix of the mass and inertia with diagonal [m1, I1, m2, I2].
 \(K^{-1} = \left( J M^{-1} J^T \right)^{-1}\) = effective mass.
b = velocity bias.
 \(\beta\) = baumgarte constant.
E = identity matrix. 
| 
 | inline | 
Calculate properties used during the functions below
| inBody1 | The first body that this constraint is attached to | 
| inBody2 | The second body that this constraint is attached to | 
| inRotation1 | The 3x3 rotation matrix for body 1 (translation part is ignored) | 
| inRotation2 | The 3x3 rotation matrix for body 2 (translation part is ignored) | 
| inR1 | Local space vector from center of mass to constraint point for body 1 | 
| inR2 | Local space vector from center of mass to constraint point for body 2 | 
| 
 | inline | 
Deactivate this constraint.
| 
 | inline | 
Return lagrange multiplier.
| 
 | inline | 
Check if constraint is active.
| 
 | inline | 
Restore state of this constraint part.
| 
 | inline | 
Save state of this constraint part.
| 
 | inline | 
Iteratively update the position constraint. Makes sure C(...) = 0.
| ioBody1 | The first body that this constraint is attached to | 
| ioBody2 | The second body that this constraint is attached to | 
| inBaumgarte | Baumgarte constant (fraction of the error to correct) | 
Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint equation.
| ioBody1 | The first body that this constraint is attached to | 
| ioBody2 | The second body that this constraint is attached to | 
| 
 | inline | 
Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses
| ioBody1 | The first body that this constraint is attached to | 
| ioBody2 | The second body that this constraint is attached to | 
| inWarmStartImpulseRatio | Ratio of new step to old time step (dt_new / dt_old) for scaling the lagrange multiplier of the previous frame |