How to make a response preventing objs from getting closer

Please don't post Bullet support questions here, use the above forums instead.
FD
Posts: 26
Joined: Thu May 18, 2006 9:25 pm

How to make a response preventing objs from getting closer

Post by FD »

Hi!

Collision response techniques, both pairwise like using impulses and complex ones involing LCP are usually formulated in the form that require that after the response there must be a positive relative speed (sometimes acceleration) along the contact normal, which (the normal) is assumed to be constant in time.

All response techniques that I know apply response forces (or impulses) once in a period of time, while the period may be constant or variable from frame to frame.

Under these assumptions, I've got a problem that was hard to comprehend, and which is still not solved appropriately by me. I wonder if you people know some common solutions for what I describe below.

I was writiong a collision detector for arbitrary convex shapes, and it was unable to handle penetration - however, I thought it was a minor problem because (1) the collision event was reported when the distance between two objects turned smaller than a pre-defined small-enough constant and the objects were having a negative relative velocity, and (2) the system was programmed to track objects' positions and the distances between them back and forth in time untill it gets the collision event and records the time of collision.

The problem was that in some cases the collision event wasn't there, although the penetration followed. After some thinking I found out that the collision event was registered and response impulses were applied over a few frames before the penetration. The problem was that these impulses DID result in a positive relative velocity along the contact normal, but the actual distance between the objects DECREASED after the positions and orientations were integrated.

This has an explaination. Assuming that the contact normal is constnt, we only make the closest points of the objects go apart in this very particular moment; in fact, after the impulses are applied, the bodies move in such a way that not only the contact normal, but also the closest points change, and because of the combination of linear and rotational motions some epsilon time after the response impulse applied we arrive at a state with NEW closest points and a NEW contact normal, which results in a SMALLER distance between them compared to the distance registered at the time of the response. No matter how small epsilon is, we have this effect, so even having the impulses applied once in X milliseconds we will have the distance between the objects decreasing steadily.

A theoretical solution for that would be making epsilon infinately small, producing "permanent impulse". In practice, I considered incorporating the change of the contact normal and of the closest points into my contact response condition, but it seems too complicated - the algorithms used for choosing the closest points and the normal are not suited for making such derivations and calculating differentials. Maybe one could integrate the impulse over time somehow, emulating the effect of a "permanent impulse" ?

So, does anybody know a response method that would guarantee that the distnce between the two objects WILL NOT DECREASE during a known period of time?

Anyway, how do people treat the problem? Or handling penetration is inevitable?

Thank you.