Impossible situation with discrete collision detection

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
krb
Posts: 1
Joined: Fri Feb 23, 2018 5:32 pm

Impossible situation with discrete collision detection

Post by krb »

On some maps, objects are getting stuck because their contacts cannot be resolved.
Here is a diagram of the situation.

Image

Collision planes are the red dashed lines, contact normals in green.

The object is initially not touching the walls. After moving one time step to the right, the object overlaps the two spikes as well as the right wall. There is no way out of this trap, because the contacts cannot be simultaneously solved.

My update logic is roughly as follows:
  • Broad+Narrowphase: Find all contacts.
  • Find closest valid displacement to the object's desired displacement with PGS. If PGS cannot resolve collisions within some threshold, zero the displacement.
  • Move object by the corrected displacement.
Is there any way to deal with this situation, other than using continuous collision detection or making sure the map does not contain any problematic geometry?
Taihennami
Posts: 1
Joined: Tue Mar 27, 2018 4:00 pm

Re: Impossible situation with discrete collision detection

Post by Taihennami »

I can think of three reasonable alternatives:

1: Just use continuous collision detection - that's what it's for. But it may have a performance impact.

2: Detect when an impossible penetration has occurred, and redo the step with continuous collision detection turned on this time. However, this assumes you can always detect the problem in the same step that it occurs (or can rewind further).

3: Detect the impossible penetration and retry with a smaller timestep. Repeat as required. This has the same potential problem as #2.

Honestly this doesn't seem like an "R&D" question, since the problem is fundamentally solved by using continuous collision detection (which, incidentally, is Bullet's original key feature). It'd be better to put this in the Support forum.
Post Reply