#bevy #baseball #bevy-plugin #aerodynamics #coordinates #avian #baseball-flight

bevy-avian-baseball-flight

Baseball flight simulation with Bevy and Avian

1 unstable release

0.0.1-alpha.1 Sep 29, 2024

#786 in Game dev

Download history 122/week @ 2024-09-23 58/week @ 2024-09-30 9/week @ 2024-10-07 10/week @ 2024-10-14

199 downloads per month

MIT/Apache

31KB
525 lines

Baseball Flight simulation with Bevy and Avian

A Bevy plugin for simulating baseball flight powered by Avian physics based on the umba baseball flight calculator: https://github.com/AndRoo88/Baseball-Flight-Calculator;

Simulates the four forces that affect the trajectory of a baseball in flight: Gravity, Drag, Magnus Effect, and Seam Shifted Wake (SSW).

Add BaseballFlightBundle to whatever baseball entity. Entity must have the ExternalForce, Transform, LinearVelocity, and AngularVelocity components. Send ActivateAerodynamicsEvent to start simulation. Send DisableAerodynamicsEvent to stop simulation.

Note that the simulations are performed using imperial units instead and also its own coordinate system and NOT bevy's.

TODO

  • simulate in metric units
  • simulate in bevy coordinate system
  • configurable radius and mass of ball
  • configurable weather conditions such as air pressure at different altitudes

Dependencies

~42–80MB
~1.5M SLoC