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

How do I store/query stuff in this octree? #2

Closed
trsh opened this issue Sep 29, 2021 · 2 comments
Closed

How do I store/query stuff in this octree? #2

trsh opened this issue Sep 29, 2021 · 2 comments

Comments

@trsh
Copy link

trsh commented Sep 29, 2021

Like points?

@Dimev
Copy link
Owner

Dimev commented Sep 29, 2021

Non-goals
Be a general-usage tree data structure for storing items at specific locations.

You can't. This crate is specifically made to help generating and storing chunks for terrain with chunked LOD, not for general storage.
I'm working on 0.2, which does come with a new function to get a chunk at a specific location, but it won't do what you want.

Instead you can try this crate, but it's likely not as fast as possible due to each node taking up 2 allocations.

If you want to make your own, this stackoverflow post is a pretty good starting point. It also explains a lot of the techniques I used here to make it efficient. (keeping the actual node size small and storing children contiguously in memory)

@Dimev Dimev closed this as completed Sep 29, 2021
@trsh
Copy link
Author

trsh commented Sep 29, 2021

Thank you!

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