Updating a WB_KDTreeInteger without rebuilding it
co-ord opened this issue · 2 comments
co-ord commented
Apologies for the inconvenience. I'm wondering whether it is possible or not to change a KDTree without having to rebuild it.
Basically I have an array of cells whose locations are stored in a WB_KDTreeInteger
. These locations may change over time but not at the same moment (only 1 cell out of 1000 will move, one by one). Is it possible to update the entry corresponding to the cell that has moved (update the location) without having to rebuild entirely the WB_KDTreeInteger
at each iteration ?
wblut commented
Unfortunately, the kdtree isn’t dynamic. When you do many queries per “frame”, a rebuild can still be advantageous. If not, then it will indeed be too expensive to consider. My main use for it is to detect points close to each other when sequentially adding points, “does this point already exist”. For dynamic spatial hierarchy, I tend to resort to a fixed grid with a single bin per grid cell. Moving particles are much easier to track and the speedup can be as large as with a kdtree. I
From: solub <notifications@github.com>
Sent: Sunday, 9 June 2019 16:32
To: wblut/HE_Mesh <HE_Mesh@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [wblut/HE_Mesh] Updating a WB_KDTreeInteger without rebuilding it (#3)
Apologies for the inconvenience. I'm wondering whether it is possible or not to change a KDTree without having to rebuild it.
Basically I have an array of cells whose locations are stored in a WB_KDTreeInteger . These locations may change over time but not at the same moment (only 1 cell out of 1000 will move). Is it possible to update the WB_KDEntryInteger corresponding to the cell that has moved (update the location) without having to rebuild entirely the WB_KDTreeInteger ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#3?email_source=notifications&email_token=AAZ2LVDN4EHBC2EFLX4P3TTPZUH5XA5CNFSM4HWJRQO2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GYOASKQ> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAZ2LVEIMKRJI6MEPCNGVQLPZUH5XANCNFSM4HWJRQOQ> . <https://github.com/notifications/beacon/AAZ2LVGIM667F6BHYMNM4H3PZUH5XA5CNFSM4HWJRQO2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GYOASKQ.gif>
co-ord commented
Thanks a lot for the reply and details. I'll keep rebuilding the KDTree at each frame. And I got to say, it's working pretty good so far.
Thanks again,
Respectfully