Skip to content

QuadTree which is written with Libgdx. This can use for collision detection optimization.

Notifications You must be signed in to change notification settings

fcenesiz/quad-tree

Repository files navigation

This can use for collision detection optimization or something else.

  • #c5f015 points
  • #00ff00 queried points

Example of usage

        List<QuadTreePoint> points = new ArrayList<>();
        for (int i = 0; i < 500; i++) {
            QuadTreePoint p = new QuadTreePoint(
                    MathUtils.random() * 500f, // x
                    MathUtils.random() * 500f // y
            );
            points.add(p);
        }

        quadTreeController = new QuadTreeController(
                0, 0, // x, y
                500, 500, // width, height
                points,
                4 // capacity
        );

        QuadTreeRectangle range = new QuadTreeRectangle(225, 375, 107, 75);
        quadTreeController.query(range);

About

QuadTree which is written with Libgdx. This can use for collision detection optimization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages