Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuadTree min/max? #25

Open
marcakafoddex opened this issue Jun 9, 2024 · 3 comments
Open

QuadTree min/max? #25

marcakafoddex opened this issue Jun 9, 2024 · 3 comments

Comments

@marcakafoddex
Copy link

I don't really understand the min/max constructor parameters for QuadTree. Does it indicate the maximum boundaries for any bbox inserted into the tree? The RTree has no such parameters.

@tuxalin
Copy link
Owner

tuxalin commented Jun 10, 2024

Compared to the RTree which computes the bounding box dynamically, the QuadTree needs a world bounding box that will be used for subdivision (so that it can create the nodes).

@marcakafoddex
Copy link
Author

Cool, thanks for answering so quickly!
A few follow up questions:

  • What happens if a bbox is added to the tree that falls outside of the initiql min/max passed to the constructor?
  • Does it make sense to pass -std:: numeric_limits<float>::max() - std:: numeric_limits<float>::max() as a catch-all construction?

@tuxalin
Copy link
Owner

tuxalin commented Jun 12, 2024

  1. It will asset and not add the item.
  2. No, in that case it makes you'll have many empty nodes and a high tree depth, which will result in very slow queries, in those cases it's best to split the world into a box grid with multiple quad/rtrees and do a neighbor search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants