1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! A bevy plugin to track your entities in spatial indices and query them.
//!
//! Quickstart using the `kdtree` feature:
//! ```
//! use bevy_spatial::{AutomaticUpdate, KDTree3, TransformMode, SpatialAccess};
//!
//! #[derive(Component, Default)]
//! struct TrackedByKDTree;
//!
//! fn main() {
//! App::new()
//! .add_plugin(AutomaticUpdate::<TrackedByKDTree>::new()
//! .with_frequency(Duration::from_secs_f32(0.3))
//! .with_transform(TransformMode::GlobalTransform))
//! .add_system(use_neighbour);
//! // ...
//! }
//!
//! type NNTree = KDTree3<TrackedByKDTree>; // type alias for later
//!
//! // spawn some entities with the TrackedByKDTree component
//!
//! fn use_neighbour(tree: Res<NNTree>){
//! if let Some((pos, entity)) = tree.nearest_neighbour(Vec3::ZERO) {
//! // pos: Vec3
//! // do something with the nearest entity here
//! }
//! }
//! ```
//!
//! For more details see [Examples](https://github.com/laundmo/bevy-spatial/tree/main/examples)
pub use SpatialAccess;
use Component;
pub use TimestepLength;
pub use ;
pub use TransformMode;
/// automatically implemented trait for all components which can be used as markers for automatic updates?