Crate bevy_ballistic

Source
Expand description

Simple launch velocity calculation for game projectiles to hit a specified target based on given gravity. Only depending on bevy_math for vector math.

Based on this article by Forrest Smith

Functionsยง

ballistic_range
Caluculate range of a projectile being fired from initial_height with speed and only affected by gravity.
launch_velocity
Calculates a low and high angle for projectile to start at start_pos to hit target_pos with a given initial_velocity.
launch_velocity_lateral
Solve for arc with a fixed lateral speed. Vertical speed and gravity varies. This leads to a visually pleasing arc.
launch_velocity_lateral_moving_target
launch_velocity_moving_target