Implement Spatial Query Raycast sorting like with Raycaster/RayHits component #262
jacobrolph98
started this conversation in
Ideas
Replies: 1 comment
-
You can sort the vector with hits.sort_by(|a, b| a.time_of_impact.partial_cmp(&b.time_of_impact).unwrap())
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using the Raycast/hit components, RayHits implements iter_sorted() to sort results by time_of_impact. There is no such feature when using Spatial Query raycasting, as it returns Vec. Cannot use vec.sort as RayHitData doesn't implement Ord, etc
Please let me know if I'm missing something.
Beta Was this translation helpful? Give feedback.
All reactions