Collisions between moving ball and polygons
Posted
by
miguelSantirso
on Game Development
See other posts from Game Development
or by miguelSantirso
Published on 2012-05-01T13:11:47Z
Indexed on
2012/09/05
21:51 UTC
Read the original article
Hit count: 312
I know this is a very typical problem and that there area a lot of similar questions, but I have been looking for a while and I have not found anything that fits what I want.
I am developing a 2D game in which I need to perform collisions between a ball and simple polygons. The polygons are defined as an array of vertices.
I have implemented the collisions with the bounding boxes of the polygons (that was easy) and I need to refine that collision in the cases where the ball collides with the bounding box. The ball can move quite fast and the polygons are not too big so I need to perform continuous collisions.
I am looking for a method that allows me to detect if the ball collides with a polygon and, at the same time, calculate the new direction for the ball after bouncing in the polygon.
(I am using XNA, in case that helps)
© Game Development or respective owner