(conceptual) question about contact point generation

Post Reply
chip
Posts: 2
Joined: Sat Dec 08, 2018 4:22 am

(conceptual) question about contact point generation

Post by chip » Sat Dec 08, 2018 4:44 am

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?

User avatar
drleviathan
Posts: 475
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: (conceptual) question about contact point generation

Post by drleviathan » Sat Dec 08, 2018 5:54 pm

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

chip
Posts: 2
Joined: Sat Dec 08, 2018 4:22 am

Re: (conceptual) question about contact point generation

Post by chip » Sat Dec 08, 2018 11:00 pm

Thanks, drleviathan, that video was very helpful!

Post Reply