Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision of rounded rectangle and circle #27

Open
DJ-HeYong opened this issue Oct 28, 2021 · 2 comments
Open

Collision of rounded rectangle and circle #27

DJ-HeYong opened this issue Oct 28, 2021 · 2 comments

Comments

@DJ-HeYong
Copy link

Collision of rounded rectangle and circle ,
Excuse me, is there a solution ?

@jeffThompson
Copy link
Owner

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!

@DJ-HeYong
Copy link
Author

Oh, that's it, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants