Hi, I was curious on how others typically do warm starting when solving contact constraints. Mainly, what do you use as the IDs for each contact point.
I'm currently using an ID that's combines the rigid bodies IDs, the reference face index, the incident face point index, and the 2 clipping edges used to potentially clip the incident face point. My contact detection biases one of the rigid bodies so the reference and incident faces stay consistent across timesteps.
Now, there a couple of issues I've seen.
- If a box was clipped by 2 edges, then rotates slightly so it's only clipped by 1 edge, the contact point ID changes and we lose a frame of warm starting.
- When storing the impulses to be used in the next frame, I don't remove contacts that no longer exist, in case they exist in a later frame. I initially only stored the impulses that were used in the current frame and remove the caches that no longer exist, but that was less stable than not removing the non-existant contact because as a stack of boxes jitter, that contact may be found again and the previously unused cache will now be used. I've seen other physics engines just remove impulses that don't exist in the current frame, and I'm not a big fan of keeping them in cache due to not knowing when should I remove them. Anyone else experience this?
Context: Using a PGS solver. SAT for contact detection.