boids_rs_bevy

Crates.ioboids_rs_bevy
lib.rsboids_rs_bevy
version0.1.0
sourcesrc
created_at2023-11-09 12:53:44.012925
updated_at2023-11-09 12:53:44.012925
descriptionRust boids simulation using Reynolds model running with Bevy engine
homepage
repositoryhttps://github.com/danieldidiobalsamo/boids
max_upload_size
id1030157
size2,945,896
Daniel Di Dio Balsamo (danieldidiobalsamo)

documentation

README

https://github.com/danieldidiobalsamo/boids/assets/79797812/dd61766b-6962-4ac8-957f-da5a2f3b936d

About

Rust boids simulation using Reynolds model running with Bevy engine.

The following parameters can be updated while the simulation is running:

  • turn factor: boids ability to turn fast
  • visual range: radius (in px) of the circle in which boids can see
  • protected range: radius (in px) of the circle in which boids wants to be alone
  • centering factor (cohesion rule) : boids move toward the center of mass of their neighbors
  • avoid factor (separation rule): boids move away from other boids that are in protected range
  • matching factor (alignment rule): boids try to match the average velocity of boids located in its visual range
  • Maximum boids velocity
  • Minimum boids velocity
  • bias: some boids are searching for food, and are not exactly following the flock

While all the parameters can be updated live, you can also press 'P' to pause/resume the simulation. Press 'Q' to leave.

How to launch

Using cargo (recommended)

Make sure cargo is installed and then just launch:

cargo install boids_rs_bevy
boids_rs_bevy

Build manually

Firstly, install bevy dependencies

Then

cargo run --release

Note: if you want to launch as dev, make sure to add the following feature to decrease compilation time :

cargo run --features bevy/dynamic_linking 
Commit count: 38

cargo fmt