CollisionDetection
CollisionDetection copied to clipboard
Collision of rounded rectangle and circle
trafficstars
Collision of rounded rectangle and circle , Excuse me, is there a solution ?
Hmm that would be really tricky. You could divide the collision into several steps:
- Four circle/circle tests, one for each corner of the rectangle
- Two circle/rect tests, one for the vertical rectangle made when you remove the rounded corners, then one for the horizontal one
But, unless you really need the perfect accuracy, I think simplifying the rounded rectangle to a regular one (just for collision) would be the better way to go. Hope that helps!
Oh, that's it, thank you very much.