Page 1 of 1

(conceptual) question about contact point generation

Posted: Sat Dec 08, 2018 4:44 am
by chip
Hi, I'm interested in reverse-engineering some of the physics behind Rocket League. Some of their developers mentioned that they use Bullet under the hood to handle some of the physics, and I was looking for some guidance about where to look for implementation details about how contact constraints might be generated for the case of a spherical ball colliding with an OBB hitbox.

My idea so far is to define a collision normal by taking the point, p, on the OBB that is closest to the sphere's center, c, and normalizing the difference (c-p). This seems to be working pretty well, but when that point p approaches an edge of the hitbox, my predictions start to disagree with the actual values. Also, the bullet user manual mentions a collision margin that makes OBB dimensions slightly smaller. Does that mean that objects that intersect that margin alone are ignored, or are somehow treated differently?

Could anyone help me better understand how bullet handles these things internally?

Re: (conceptual) question about contact point generation

Posted: Sat Dec 08, 2018 5:54 pm
by drleviathan
A good place to start would be a youtube video that shows the Bullet collision margin and how that changes the effective shape during collisions. The video points out Box-Box collisions don't use the margins, however Box-Sphere collisions do:

https://www.youtube.com/watch?v=BGAwRKPlpCw&t=2s

Re: (conceptual) question about contact point generation

Posted: Sat Dec 08, 2018 11:00 pm
by chip
Thanks, drleviathan, that video was very helpful!