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

Add "within" support (rectangular axis-alligned region). #23

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

VitalyArtemiev
Copy link

Issue #7
Example in distance2d.rs.

Example in within2d.rs

Known issues:
Panic when loc1 is farther along the [1,1] axis than loc2. Could not find a way to check this and swap them inside of the macro.
Move example function back into distance2d.rs; remove within2d.rs.
@laundmo
Copy link
Owner

laundmo commented Oct 13, 2023

Hi!

Thank you a lot for your PR.

i'm a bit wary about expanding the SpatialAccess Trait like this - other data structures, of which i plan to add at least 2 somewhere during the next bevy release cycle, might not support it.

How do you feel about moving that to a extension trait? It would mean users have to import another trait, but leaves the option for other datastructures which don't support it.

@VitalyArtemiev
Copy link
Author

Of course, if you think it's best. I'll try implementing it that way.

@VitalyArtemiev
Copy link
Author

I finally got around to it. Hope this is what you had in mind.

@cliedelt
Copy link

@laundmo can we get this merged?

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

Successfully merging this pull request may close these issues.

3 participants