Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cloth push-back and pass-through
#7
(17-07-2023, 08:44 AM)danazoid Wrote: Did you mean lambda = constraint * ( invMassA + invMassB)?

which is consistent with PBD paper/slides and Obi code:
BurstContact.SolveAdhesion {
...
     float dlambda = -constraint / TotalNormalInvMass;
...
}

Nope. Both the PBD paper and Obi's code divide by the total inverse mass. A / (1 / B) = A * B.

Still, constraint * (massA + massB) is not correct since 1/A + 1/B != 1/(A+B), should have said constraint / (1/massA + 1/mass B). My bad!

(17-07-2023, 08:44 AM)danazoid Wrote: =====
Then velocity of the rigidbody is calculated here?

BurstMath.ApplyImpulse {
...
    linearDeltas[rigidbodyIndex]  += rigidbodies[rigidbodyIndex].inverseMass * impulseWS;
...
}

That's a linear velocity delta, not the final velocity. linearDelta is then added to the rigidbody's linear velocity at the start of the frame. Same with the angular velocity.

(17-07-2023, 08:44 AM)danazoid Wrote: Then somehow Unity calculates something that interacts with the joint force.

Unity solves for impulses, same thing Obi does. You accumulate multiple impulses on a rigidbody (some come from Obi, some come from Unity joints), and end up with the final velocity.
Reply


Messages In This Thread
Cloth push-back and pass-through - by danazoid - 14-07-2023, 06:21 AM
RE: Cloth push-back and pass-through - by josemendez - 17-07-2023, 09:38 AM