Ralith / sieve-tree

9 stars 1 forks source link

Maintaining a sort order #6

Open grovesNL opened 3 months ago

grovesNL commented 3 months ago

Is it possible that we could apply sorting by something (min/max bounds, some other key from the value) at some level, so less sorting is needed when using the results from intersections? Ideally intersections could return the results already sorted by min for example. If not fully sorted it might still be useful to sort at the subdivision, so that most sorting functions would have less work to do when applying it across all matches.

It would be useful for 1D where I'd like to sort by min bounds, but also for 2D/3D cases where you might want to prioritize certain element intersections over others and stopping at the highest priority intersection (e.g., 2D hit testing based on z-index or depth).