Fix: alignment should align to vel, not impulse
I need to apply an impulse to match the velocities, but the previous version was trying to match the forces.
This commit is contained in:
@@ -256,7 +256,8 @@ fn alignment(
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
force.0 = (avg.extend(0.0) - force.0) * ALIGNMENT_FACTOR;
|
let boid_vel = boid_velocities.get(this_entt).unwrap();
|
||||||
|
force.0 += (avg.extend(0.0) - boid_vel.0) * ALIGNMENT_FACTOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user