Affine Body Fixed Joint
References:
A unified newton barrier method for multibody dynamics
#25 AffineBodyFixedJoint
The Affine Body Fixed Joint constitution constrains two affine bodies to be rigidly connected, preventing all relative translation and rotation. This is the most restrictive joint type, effectively welding two bodies together.
We assume 2 affine body indices \(i\) and \(j\), each with their own state vector (to be concrete, transform) \(\mathbf{q}_i\) and \(\mathbf{q}_j\) as defined in the Affine Body constitution.
At the beginning of the simulation, a shared frame \((\mathbf{c}, \hat{\mathbf{t}}, \hat{\mathbf{n}}, \hat{\mathbf{b}})\) is established such that it is well-aligned with the corresponding frame of affine body \(i\) and \(j\):
where \(\mathbf{c}\) is the midpoint between the two body centers, and \(\hat{\mathbf{t}}\), \(\hat{\mathbf{n}}\), \(\hat{\mathbf{b}}\) are the world-frame coordinate axes expressed in each body's local space. \(\mathbf{J}^{x}_k\) is the local coordinate of point \(\mathbf{x}\) in affine body \(k\)'s local space, and \(\mathring{\mathbf{J}}^{\hat{v}}_k\) is the local coordinate of direction vector \(\hat{\mathbf{v}}\) in affine body \(k\)'s local space. Typically, \(\mathbf{J}^{x}\) obeys the definition of \(\mathbf{J}\) in the Affine Body, while \(\mathring{\mathbf{J}}^{\hat{v}}\) is defined as:
which omits the translational part.
To be concise, we define:
Rotation Constraints
To prevent relative rotation, the frame vectors must remain aligned:
The rotation constraint vector is assembled as:
with the affine body mapping:
such that \(\mathbf{F}_{r} = \mathbf{J}_{r} \begin{bmatrix} \mathbf{q}_i \\ \mathbf{q}_j \end{bmatrix}\).
The rotation energy is:
Translation Constraint
To prevent relative translation, the center points must coincide:
The translation constraint vector is:
with the affine body mapping:
such that \(\mathbf{F}_{t} = \mathbf{J}_{t} \begin{bmatrix} \mathbf{q}_i \\ \mathbf{q}_j \end{bmatrix}\).
The translation energy is:
Total Energy
The total energy for the fixed joint is the sum of the rotation and translation energies:
where \(K\) is the stiffness constant of the joint, we choose \(K=\gamma (m_i + m_j)\), where \(\gamma\) is a user defined strength_ratio parameter, and \(m_i\) and \(m_j\) are the masses of the two affine bodies.
Attributes
On the joint geometry (1D simplicial complex), on edges:
strength_ratio: \(\gamma\) in \(K = \gamma(m_i + m_j)\) above