seperation was actually cohesion the whole time
parent
b0a1676fd2
commit
4317ccf3a3
14
src/main.rs
14
src/main.rs
|
@ -86,12 +86,6 @@ fn build_local_cache(
|
|||
fn cohesion(
|
||||
mut boids: Query<(&Transform, &LocalCache, &mut CohesionAcceleration), With<Boid>>,
|
||||
other_boids: Query<&Transform, With<Boid>>,
|
||||
) {
|
||||
}
|
||||
|
||||
fn seperation(
|
||||
mut boids: Query<(&Transform, &LocalCache, &mut SeperationAcceleration), With<Boid>>,
|
||||
other_boids: Query<&Transform, With<Boid>>,
|
||||
) {
|
||||
boids
|
||||
.par_iter_mut()
|
||||
|
@ -106,10 +100,16 @@ fn seperation(
|
|||
}
|
||||
|
||||
accel.0 /= count as f32;
|
||||
accel.0 = transform.translation.xy() - accel.0;
|
||||
accel.0 -= transform.translation.xy();
|
||||
})
|
||||
}
|
||||
|
||||
fn seperation(
|
||||
mut boids: Query<(&Transform, &LocalCache, &mut SeperationAcceleration), With<Boid>>,
|
||||
other_boids: Query<&Transform, With<Boid>>,
|
||||
) {
|
||||
}
|
||||
|
||||
fn alignment(
|
||||
mut boids: Query<(&Velocity, &LocalCache, &mut AlignmentAcceleration), With<Boid>>,
|
||||
other_boids: Query<&Velocity, With<Boid>>,
|
||||
|
|
Loading…
Reference in New Issue