Collision Detection Between Circle Segment and Rectangle

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
GGfazo
Prole
Posts: 1
Joined: Thu Aug 10, 2023 11:59 am

Re: Collision Detection Between Circle Segment and Rectangle

Post by GGfazo »

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
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.)
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.
Captura de pantalla 2023-08-10 140920.png
Captura de pantalla 2023-08-10 140920.png (13.68 KiB) Viewed 427 times
Again, I could be wrong, but I'm somewhat confident about this.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 3 guests