Get a technical overview of the Ballistics package.
Ballistics is organized into three namespaces:
Runtime is the primary namespace that you will interact with.
You can reference the Demo namespace to understand usage patterns.
You likely won’t need to interact with the Editor namespace.
Ballistics includes three data types. You should familiarize yourself with them.
Each one contains some information about how the simulation should work.
You can create these ahead of time as a Scriptable Object asset. You can also create or modify them during gameplay.
Projectile describes a ballistics projectile. These characteristics include the following:
- Muzzle Velocity
- Initial Kinetic Energy
When you instantiate a projectile, you should call Projectile.SetOriginAndDirection(Vector3 origin, Vector3 direction) to initialize these fields before passing the Projectile to the simulation.
Some of these characteristics are calculated automatically (e.g., Initial Kinetic Energy), but most are expected as inputs.
Environment describes a set of Environment Conditions. These characteristics include:
- Atmospheric Pressure
- Air Density
Some of these characteristics are calculated automatically (e.g., Air Density). OThers are expected as inputs (e.g., Humidity, Temperature)
SimulationConfig describes the nature of the simulation that should be executed,
These characteristics include:
- Maximum Simulation Distance
- Simulation Timestep