https://github.com/fcenesiz/quad-tree
QuadTree which is written with Libgdx. This can use for collision detection optimization.
https://github.com/fcenesiz/quad-tree
2d collision-detection java libgdx optimization optimization-algorithms quadtree
Last synced: 5 months ago
JSON representation
QuadTree which is written with Libgdx. This can use for collision detection optimization.
- Host: GitHub
- URL: https://github.com/fcenesiz/quad-tree
- Owner: fcenesiz
- Created: 2022-10-09T20:12:07.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-10T08:50:30.000Z (over 3 years ago)
- Last Synced: 2024-01-29T11:24:21.642Z (over 2 years ago)
- Topics: 2d, collision-detection, java, libgdx, optimization, optimization-algorithms, quadtree
- Language: Java
- Homepage:
- Size: 136 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
### This can use for collision detection optimization or something else.

-  `points`
-  `queried points`
Example of usage
```Java
List 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);
```