Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

How does Havok deal with ghost collisions with speculative contacts?

Discussion in 'Physics for ECS' started by Mr-Mechanical, Nov 28, 2019.

  1. Mr-Mechanical


    May 31, 2015
    I understand speculative contacts can create ghost collisions. I am considering Havok Physics but I am curious how it solves this problem? What procedure is done to cure this ghost collisions effect?

    Thank you, I am intrigued and insight will be helpful.
  2. MaxAbernethy


    Mar 16, 2019
    There are a couple of methods.

    One is to cast the body using its velocity at the beginning of the step and use the contact normal at the end of the cast instead of the starting position. This helps especially for near misses when the body shouldn't really hit anything. But, if the body does really hit something, then its velocity will change and it will no longer follow the path that it was cast along, so the other predicted collisions may not be correct anymore.

    Another way is to analyze the body's contact points collectively. For a simple example, suppose you have a flat quad made of two triangles. If a body is sitting on top of one triangle, it will get a sideways pointing normal from the other triangle's edge. That would create a contact plane that sticks up above the quad and could cause a ghost collision, but we can tell from the contacts with the first triangle that it won't hit that edge and adjust the normal to point upwards.

    These techniques do help, but they are not perfect, so ghost collisions and tunneling are still possible.
    Mr-Mechanical likes this.