Commit Graph

10 Commits

Author SHA1 Message Date
e6e56506f8 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.
2025-09-03 14:11:18 -05:00
bc0630b4ae Fix: off-by-one error in alignment averaging
The "length" is actually the `enumerate()` index, which is one less than
the item count. The previous version was not using the average, and may
have been deviding by 0 for boids with exactly one neighbor.
2025-09-03 14:09:40 -05:00
76a6b4f999 New cohesion rule function 2025-09-03 14:07:50 -05:00
451311126d New separation rule function 2025-09-03 14:07:34 -05:00
7b380196a5 Filter-map the entities to avoid self-alignment
The boids shouldn't try to align with themselves. That doesn't really
make any sense.
2025-09-03 12:23:53 -05:00
8b61d38636 Make keyboard control forces, not velocities
The keyboard input should apply a force, not modify the velocity. Right
now, there is no Mass component, but in the future there might be. I've
just fixed a broken physics integrator made by bad assumptions, too, so
I'm goig to do this for consistency if nothing else.
2025-09-03 12:23:53 -05:00
b3cf47e684 Remove BoidBundle, use required-components instead 2025-09-03 12:23:53 -05:00
a6240c844a Make another new alignment system 2025-09-03 12:23:53 -05:00
3eb23fb4bf Move physics parts to a physics module 2025-09-03 12:23:53 -05:00
4150f85ccc Rename & restructure birdoids module
The module isn't the plugin, so it's going to be called simply
"birdoids" going forward.

I've turned it into a folder and a `mod.rs` so I can slap down a small,
custom physics system.
2025-08-30 15:39:41 -05:00