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?
(conceptual) question about contact point generation
- drleviathan
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: (conceptual) question about contact point generation
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
https://www.youtube.com/watch?v=BGAwRKPlpCw&t=2s
Re: (conceptual) question about contact point generation
Thanks, drleviathan, that video was very helpful!