17-07-2023, 08:44 AM
(14-07-2023, 07:54 AM)josemendez Wrote: The basic formula is your typical PBD constraint:
Code:lambda = constraint * (massA + massB);
deltaA = lambda * gradient / massA;
deltaB = lambda * gradient / massB;
Did you mean lambda = constraint * ( invMassA + invMassB)?
which is consistent with PBD paper/slides and Obi code:
BurstContact.SolveAdhesion {
...
float dlambda = -constraint / TotalNormalInvMass;
...
}
=====
Then velocity of the rigidbody is calculated here?
BurstMath.ApplyImpulse {
...
linearDeltas[rigidbodyIndex] += rigidbodies[rigidbodyIndex].inverseMass * impulseWS;
...
}
=====
Then somehow Unity calculates something that interacts with the joint force.