views:

50

answers:

1

I'm making a game where the player is an upright capped cylinder, and the world is axis aligned bounding boxes. Given this, how could I check if the cylinder is intersecting a box?

Thanks

+1  A: 

It's mostly a 2D problem.

For each AABB, test that the vertical dimensions of the cylinder overlap the vertical dimensions of the AABB. If so, then the test reduces to a 2D case, otherwise, there's no collision.

Then, in the 2D case you need to find if your circle intersects a rectangle... and I'll just refer you to here:

Circle-Rectangle collision detection (intersection)

Detmar