Ballistic Solutions is a library for calculating interception times, impact positions, and firing vectors, taking into account the velocities and accelerations of both projectile and target.
- Install the addon in Godot or reference the DLL in your C# project.
- In your scene, compute the vector to the target:
to_target = target.global_position - global_position
- Call
best_firing_velocityto get initial projectile velocity. - Instantiate your projectile and assign
velocityandacceleration.
You can test the addon using the included demo scene.
- Contributions are welcome. Open an issue or PR.
- Demo scene is included for testing. Run it in Godot to validate behavior.
- The library sets up an interception equation between target and projectile motion and solves for
t. - Each positive solution
tcorresponds to a valid hit time and gives a required initial velocity. - If no positive solutions exist, interception is impossible with current parameters.
See detailed Formula documentation.
