Add "within" support (rectangular axis-alligned region).#23
Add "within" support (rectangular axis-alligned region).#23VitalyArtemiev wants to merge 9 commits intolaundmo:mainfrom
Conversation
|
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. |
|
Of course, if you think it's best. I'll try implementing it that way. |
|
I finally got around to it. Hope this is what you had in mind. |
|
@laundmo can we get this merged? |
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.
Add separate demo.
Maybe needs rework.
|
Are you still interested in merging this feature? Should I perhaps create a better demo that does not cannibalize your code from distance2d.rs? |
|
I think it still super useful. You can have a workaround but this would be better... |
Issue #7
Example in distance2d.rs.