r/GraphicsProgramming • • 19d ago

Question Question about broad-phase collision detection

I'm working on a game engine and using GPU Gems as a loose guide for my physics. I really like the approach they outline for broad phase collision but I'm confused by one point. In ensuring no collision is double counted, the book says to expand each bounding sphere by sqrt(2) and then make the grid 1.5x that large. I did the math and understand where 1.5 comes from, but I'm stumped on the sqrt(2) and why we have to expand the bounding spheres themselves? Isn't the whole point of a bounding sphere that it contains the entire collider and is rotation invariant?

Also, just wanted to check if people think the book's approach is still viable. It seems solid to me but I'm still new to all this.

10 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/troyofearth 18d ago

Oh yeah sorry i got caught up there.

That's a slightly more simple counteraxample:

0 1

2 3

The sqrt(2) expansion of the bounds for marking, means that the spheres cant be marked exclusively in 0 and 3 and have a collision (on the original bounds) in 1.

To be clear they can still be in 0 and 3 and have collision in 1... but their radius is expanded so they will also have to BOTH touch either 0 and 3 for that case. 

You've eliminated that 'exclusively in 0 and 3' possibility. Artificially and its weird because it creates fake collisions that must be removed in narrowphase.

Sorry you were clear and i got caught up on the 1.5 lol.