Closed WaDelma closed 2 years ago
As a aside I wont be able to actually use k_nearest
or k_nearest_mut
in the game as I want to find closest satisfying certain predicate (the task is to find closest certain type of entity).
@WaDelma I think I fixed this. Thank you for looking into this! Sorry for the late response. I somehow missed this.
I was trying to use
k_nearest
(copy pasted version ofk_nearest_mut
with references swapped) and my game started to panic with errors that seemed to be caused by overflow (was running the game in release mode). I swapped tok_nearest_mut
and had same issue.I then printed the result of
get_elements
and the point I was trying to find nearest for, transformed result to code form (usingbbox
andrect
) and made test intobroccoli
code base which was still failing. Curiously it didn't fail if I useddefault_rect_knearest
.I then reduced the test from 6132
bbox
:es to only 2 and that reduced test is now this PR.