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

bevy-rapier-baseball-flight

Baseball flight simulation with Bevy and Rapier

5 releases

0.0.1-alpha.5 Nov 3, 2024
0.0.1-alpha.4 Oct 23, 2024
0.0.1-alpha.3 Oct 4, 2024
0.0.1-alpha.1 Oct 3, 2024

#430 in Game dev

Download history 300/week @ 2024-09-28 120/week @ 2024-10-05 33/week @ 2024-10-12 149/week @ 2024-10-19 12/week @ 2024-10-26 182/week @ 2024-11-02 8/week @ 2024-11-09 3/week @ 2024-11-16

193 downloads per month

MIT/Apache

33KB
698 lines

Baseball Flight simulation with Bevy and Rapier

A Bevy plugin for simulating baseball flight powered by Rapier 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

~48–86MB
~1.5M SLoC