About The Project
A quadtree plugin for bevy.
Function:
- Auto update following
Changed<GlobalTransform>
, all users need to do is querying. - LooseQuadTree supported.
Features:
gizmos
: show gizmos of the quadtree boundaries.sprite
: enableCollisionRect
andCollisionRotatedRect
to tracksprite.custom_size
.multi-quadtree
: support multiple quadtrees in one world, see [MultiQuadTreePlugin
].
Version:
To align with Bevy, the version is always the same as supported Bevy
's version.
Caution
For those who upgrade from version <= 0.15.1-alpha7, pay attention to the new type paramter D
in QuadTreePlugin
.
And shapes now have ID
as well. Moreover, the tree memory is pre-allocated, no longer dynamically allocating.
For those who upgrade from version <= 0.15.1-beta.2, X
Y
type params added to Plugins to set the origin of boundary.
The QuadTree's type params is simplified to only ID
as well.
Built With
Usage
- Add the plugin to your
Cargo.toml
:
[]
= { = "0.16.0" }
- Add the plugin to your Bevy app:
#
- Spawn CollisionShapes as Components:
// in systems
cmds.spawn
- Query the quadtree like bevy's
Or, Not
:
// default id 0
type MyQuadTree = ;
- However, you may need manually update collision shapes in some cases
xx.observe
See this repo graph for more complete examples.
For more details, please refer to the Documentation
Roadmap
- Feature
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact
Louis - 836250617@qq.com
Project Link: https://github.com/kingwingfly/bevy_quadtree