diff --git a/src/main.rs b/src/main.rs index 6c2c357..6d75746 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,13 +19,32 @@ struct Boid; #[derive(Component, Default)] struct Velocity(Vec2); +#[derive(Component, Default)] +struct SeperationCache(Vec2); + +#[derive(Component, Default)] +struct CohesionCache(Vec2); + +#[derive(Component, Default)] +struct AlignmentCache(Vec2); + +#[derive(Bundle, Default)] +struct BoidCacheBundle { + s_cache: SeperationCache, + c_cache: CohesionCache, + a_cache: AlignmentCache, +} + #[derive(Bundle, Default)] struct BoidBundle { mesh: MaterialMesh2dBundle, velocity: Velocity, boid: Boid, + cache: BoidCacheBundle, } +fn seperation(mut boids: Query<(&Transform, &mut SeperationCache), With>) {} + fn move_boids(mut boids: Query<(&mut Transform, &Velocity), With>, time: Res