Skip to content

Give more control over quadtree elements #46

Open
@fluffynukeit

Description

@fluffynukeit

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?

Activity

fallahn

fallahn commented on Nov 17, 2015

@fallahn
Owner

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Give more control over quadtree elements · Issue #46 · fallahn/sfml-tmxloader