I have been reading through the implementation of FPBDJointConstraints::ApplyPlasticityLimits and I don’t quite understand what this line is meant to do.
My understanding is LinearDisplacement
is essentially the difference between the constraint’s pivots in the space of the parent pivot. The code also uses GetConstrainedParticleIndices
to flip from the constraint instance’s ordering of the bodies to the solver convention, so essentially from (child, parent) to (parent, child). When the method gets to computing StartDelta
and CurrentDelta
, it correctly computes the latter as Child.centerOfMass - Parent.pivot
in the local space of the parent pivot. However, when it computes StartDelta
, it uses ConstraintFramesLocal[Index1]
. Index1
is 0 as computed by GetConstrainedParticleIndices
, so ConstraintFramesLocal[Index1]
is actually the local space of the child pivot. But LinearDisplacement
is computed in the local space of the parent pivot, so is this a bug?