math - Collision detection with oddly shaped polygons -


i planning make program have circular shapes moving inside of oddly shaped polygon.

i can't seem figure out how collision detection edges , have shapes bounce correctly.

i sure problem has been solved before, can't find nice example.

my main problems are: figuring out if circle has hit edge of surrounding polygon. once hit occurs calculate normal of hit point figure out reflection vector.

can point me in right direction?

thanks, jason

you need circle line intersection test.

to make faster, can first check bounding boxes. example, if start , end point of line both left of leftmost coordinate of circle, there can't intersection.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -