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

Give more control over quadtree elements #46

Open
fluffynukeit opened this issue Nov 17, 2015 · 1 comment
Open

Give more control over quadtree elements #46

fluffynukeit opened this issue Nov 17, 2015 · 1 comment

Comments

@fluffynukeit
Copy link

Hi. Thanks for this awesome library. Having a map loader with a built-in quad tree is really convenient. It would be nice to have more control over the quad's elements, though.

For instance, I'd like to be able to only add objects from a particular layer instead of all layers (or arbitrary combinations of layers/objects). I suppose I can do this now by using QuadTreeRoot directly, but I'd be ignoring the UpdateQuadTree and QueryQuadTree methods, which aren't strictly necessary.

Also nice would be using the quad tree class for anything providing a GetAABB method, not just Map Objects. For instance, I'd love to double dip and use it for tracking projectiles, for instance.

I think both of these can be resolved by breaking out the quad tree implementation into a template. It's arguable whether or not the MapLoader member functions should remain or be removed in favor of using the QuadTree directly.

What do you think?

@fallahn
Copy link
Owner

fallahn commented Nov 17, 2015

I think this is a very fair point. When I implemeneted this it was my first attempt at a quad tree so there is a lot of room for improvement. The rest of the map loader library has apparently evolved, leaving the quad tree behind. I have since implemented a more flexible quad tree in another project, which I'll give some serious consideration to adapting, should I get the time.

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

No branches or pull requests

2 participants