Re: Collision Detection Between Circle Segment and Rectangle
Posted: Thu Aug 10, 2023 12:14 pm
First thing I wanted to say is thank you all for creating this thread, it has personally been really helpful. But I wanted to point out a possible optimization (although it might not work). In Gravy's post, it's stated that
However in all the cases I've found, there's never a need to check for T if we already check for the 4 corners and the closest point. Again, I could be wrong, but I'm somewhat confident about this.So we check the closest point, R, S, and T, and the four corners, for a total of 8 calculations. That's not too bad. (Although we should also check to see whether the center of the circle is within the rectangle in the first place.)