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

Does it work with rotated rectangles? #31

Open
xescugc opened this issue Feb 17, 2025 · 1 comment
Open

Does it work with rotated rectangles? #31

xescugc opened this issue Feb 17, 2025 · 1 comment

Comments

@xescugc
Copy link

xescugc commented Feb 17, 2025

I was wondering if it can detect collisions of rotated rectangles.

I see that it has Projections(needed for this specific usecase) but i don't see clearly on the documentation if that specific usecase can be solved or if it needs more than one call to solve, meaning is not as easy as

    if intersection, ok := rect.Intersection(circle); ok {
        fmt.Println("They're touching! Here's the data:", intersection)
    }

Or maybe it is and I cannot find it on the docs hehe 🤷

@SolarLune
Copy link
Owner

Rectangles are just convex polygons internally, so it should work with rotated rectangles, yeah.

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