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:
2025-09-03 14:11:18 -05:00
parent bc0630b4ae
commit e6e56506f8

View File

@@ -256,7 +256,8 @@ fn alignment(
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;
}
}