Projectile Toolkit - Targeting, Prediction, Aerodynamics

Want to implement game mechanics based on projectile motion? Want enemy AI to use ranged weapons such as cannons, rocks or arrows to accurately hit targets? Want to have full control over jump motion of objects in games or animations without losing their physical properties? This toolkit has got you covered!


🎮 WebGL Demos

📚 Docs


Projectile Toolkit currently provides templates and tools related to 3 key topics:


Targeting

Let gravity-affected rigidbodies to hit the specified target

Prediction

Compute various projectile info; Predict and render the trajectory of a rigidbody

Projectile Aerodynamics

Handle curved trajectories seen in boomerang, football, golf (draw/fade), etc. (and still hit the specified target)


Projectile Toolkit is extremly easy to use, and can be quickly integrated into existing projects.


🏆 Features:

- Flexible and easy to use: the low-level APIs are carefully-designed static methods; the high-level features are carefully designed to be used with no code or with simple code

- Super fast: most algorithms don't even touch trigonometric functions

- Works in both 3D and 2D (works in 2D if only your game treats y as up axis)

- Works on all build platforms

- Inspirational demos: great for both learning this toolkit and quick prototyping

- Full source code

- Detailed documentation


🎁 Bonuses:

Useful game toolkits such as:

★ Explosion system

★ Top-down character controller



-------------------------

Technical details


🎯 Targeting

• Compute the launch velocity by any of the following:

- angle

- height

- time

- a (coefficient of the quadratic function)

- speed

• Compute the launch angles by: speed

• Compute the max range by: elevation, speed

API Example Use Cases


☄️ Prediction

• Predict various projectile info (API libarary):

- Projectile's position at a given time

- Whole trajectory points

- Test if a given velocity can let a projectile to hit a given target

- Flight time


• Predict and render trajectory lines:

- Trajectory Predictor (math based)

- PEB Trajectory Predictor (physics engine based)

- Fully customizable line style

- Two template styles provided: dash, slash

- Compare the 3 Systems of Trajectory Prediction


Projectile Aerodynamics

• Mimic pro-level curve shots in football, baseball, golf, etc.

• Simulate wind and air drag

• Implement creative weapons such as boomerangs


Roadmap

- Propulsion library (v3.2)

- Custom gravity direction (v4.0)