seperation was actually cohesion the whole time
This commit is contained in:
parent
b0a1676fd2
commit
4317ccf3a3
1 changed files with 7 additions and 7 deletions
14
src/main.rs
14
src/main.rs
|
@ -86,12 +86,6 @@ fn build_local_cache(
|
||||||
fn cohesion(
|
fn cohesion(
|
||||||
mut boids: Query<(&Transform, &LocalCache, &mut CohesionAcceleration), With<Boid>>,
|
mut boids: Query<(&Transform, &LocalCache, &mut CohesionAcceleration), With<Boid>>,
|
||||||
other_boids: Query<&Transform, 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
|
boids
|
||||||
.par_iter_mut()
|
.par_iter_mut()
|
||||||
|
@ -106,10 +100,16 @@ fn seperation(
|
||||||
}
|
}
|
||||||
|
|
||||||
accel.0 /= count as f32;
|
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(
|
fn alignment(
|
||||||
mut boids: Query<(&Velocity, &LocalCache, &mut AlignmentAcceleration), With<Boid>>,
|
mut boids: Query<(&Velocity, &LocalCache, &mut AlignmentAcceleration), With<Boid>>,
|
||||||
other_boids: Query<&Velocity, With<Boid>>,
|
other_boids: Query<&Velocity, With<Boid>>,
|
||||||
|
|
Loading…
Reference in a new issue