|
@@ -11,37 +11,39 @@
|
|
|
|
|
|
JPH_NAMESPACE_BEGIN
|
|
|
|
|
|
-/// Constrains movement on 2 axis
|
|
|
-///
|
|
|
-/// @see "Constraints Derivation for Rigid Body Simulation in 3D" - Daniel Chappuis, section 2.3.1
|
|
|
-///
|
|
|
-/// Constraint equation (eq 51):
|
|
|
-///
|
|
|
-/// \f[C = \begin{bmatrix} (p_2 - p_1) \cdot n_1 \\ (p_2 - p_1) \cdot n_2\end{bmatrix}\f]
|
|
|
-///
|
|
|
-/// Jacobian (transposed) (eq 55):
|
|
|
-///
|
|
|
-/// \f[J^T = \begin{bmatrix}
|
|
|
-/// -n_1 & -n_2 \\
|
|
|
-/// -(r_1 + u) \times n_1 & -(r_1 + u) \times n_2 \\
|
|
|
-/// n_1 & n_2 \\
|
|
|
-/// r_2 \times n_1 & r_2 \times n_2
|
|
|
-/// \end{bmatrix}\f]
|
|
|
-///
|
|
|
-/// Used terms (here and below, everything in world space):\n
|
|
|
-/// n1, n2 = constraint axis (normalized).\n
|
|
|
-/// p1, p2 = constraint points.\n
|
|
|
-/// r1 = p1 - x1.\n
|
|
|
-/// r2 = p2 - x2.\n
|
|
|
-/// u = x2 + r2 - x1 - r1 = p2 - p1.\n
|
|
|
-/// x1, x2 = center of mass for the bodies.\n
|
|
|
-/// v = [v1, w1, v2, w2].\n
|
|
|
-/// v1, v2 = linear velocity of body 1 and 2.\n
|
|
|
-/// w1, w2 = angular velocity of body 1 and 2.\n
|
|
|
-/// M = mass matrix, a diagonal matrix of the mass and inertia with diagonal [m1, I1, m2, I2].\n
|
|
|
-/// \f$K^{-1} = \left( J M^{-1} J^T \right)^{-1}\f$ = effective mass.\n
|
|
|
-/// b = velocity bias.\n
|
|
|
-/// \f$\beta\f$ = baumgarte constant.
|
|
|
+/**
|
|
|
+ Constrains movement on 2 axis
|
|
|
+
|
|
|
+ @see "Constraints Derivation for Rigid Body Simulation in 3D" - Daniel Chappuis, section 2.3.1
|
|
|
+
|
|
|
+ Constraint equation (eq 51):
|
|
|
+
|
|
|
+ \f[C = \begin{bmatrix} (p_2 - p_1) \cdot n_1 \\ (p_2 - p_1) \cdot n_2\end{bmatrix}\f]
|
|
|
+
|
|
|
+ Jacobian (transposed) (eq 55):
|
|
|
+
|
|
|
+ \f[J^T = \begin{bmatrix}
|
|
|
+ -n_1 & -n_2 \\
|
|
|
+ -(r_1 + u) \times n_1 & -(r_1 + u) \times n_2 \\
|
|
|
+ n_1 & n_2 \\
|
|
|
+ r_2 \times n_1 & r_2 \times n_2
|
|
|
+ \end{bmatrix}\f]
|
|
|
+
|
|
|
+ Used terms (here and below, everything in world space):\n
|
|
|
+ n1, n2 = constraint axis (normalized).\n
|
|
|
+ p1, p2 = constraint points.\n
|
|
|
+ r1 = p1 - x1.\n
|
|
|
+ r2 = p2 - x2.\n
|
|
|
+ u = x2 + r2 - x1 - r1 = p2 - p1.\n
|
|
|
+ x1, x2 = center of mass for the bodies.\n
|
|
|
+ v = [v1, w1, v2, w2].\n
|
|
|
+ v1, v2 = linear velocity of body 1 and 2.\n
|
|
|
+ w1, w2 = angular velocity of body 1 and 2.\n
|
|
|
+ M = mass matrix, a diagonal matrix of the mass and inertia with diagonal [m1, I1, m2, I2].\n
|
|
|
+ \f$K^{-1} = \left( J M^{-1} J^T \right)^{-1}\f$ = effective mass.\n
|
|
|
+ b = velocity bias.\n
|
|
|
+ \f$\beta\f$ = baumgarte constant.
|
|
|
+**/
|
|
|
class DualAxisConstraintPart
|
|
|
{
|
|
|
public:
|