开发者

Collision detection between a capped cylinder and an AABB?

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?

Than开发者_如何学JAVAks


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜