Soft Transform Constraint
Soft Transform Constraint is a type of constraint to control the motion of an affine body.
The state of an affine body is represented as:
\(\mathbf{p}\) is the position of the affine body and the \(\mathbf{a}_i\) are the rows of the affine transformation matrix.
#16 SoftTransformConstraint
The constraint energy is
where \(\hat{\mathbf{q}}\) is the target state. The constraint mass matrix \(\tilde{\mathbf{M}}\) is constructed from the parallel-axis decomposition of the physical mass matrix \(\mathbf{M}\):
where:
- \(\mathbf{c}\) is the center of mass in the reference frame (\(m\mathbf{c} = m\bar{\mathbf{x}}\))
- \(\mathbf{M}_{cm} = m\,\mathbf{J}(\mathbf{c})^T\mathbf{J}(\mathbf{c})\) is the ABD mass matrix of a point mass \(m\) at \(\mathbf{c}\), capturing the kinetic energy of center-of-mass translation
- \(\mathbf{M}_{rot} = \mathbf{M} - \mathbf{M}_{cm}\) captures rotation/deformation about the center of mass, with \(\mathbf{S}_{cm} = \mathbf{S} - m\mathbf{c}\mathbf{c}^T\) in its affine block, where \(\mathbf{S} = \int\rho\,\bar{\mathbf{x}}\bar{\mathbf{x}}^T\,dV\)
- \(\eta_p \in [0,+\infty)\): translation (center-of-mass) constraint strength
- \(\eta_a \in [0,+\infty)\): rotation/deformation constraint strength
Equivalently: \(\tilde{\mathbf{M}} = \eta_a\,\mathbf{M} + (\eta_p - \eta_a)\,\mathbf{M}_{cm}\).
Because the constraint is "SOFT", overly large values will cause numerical instability. Normally \(\eta_p\) and \(\eta_a\) are better kept in the range \([0, 100]\).
Attributes
On instances:
strength_ratio: \((\eta_p, \eta_a)\) in the kinetic termaim_transform: target \(\tilde{\mathbf{q}}\) in the kinetic term