API

BallisticsProjectile - Protected Methods

protected void Simulate();

Automatically uses the projectile, environment, and simulation config along with the callbacks included in the BallisticsProjectile class.

protected void Simulate(
    Projectile projectile, 
    Environment environment, 
    SimulationConfig simulationConfig, 
    System.Action<BallisticsHitData> onBallisticsComplete, 
    System.Action<Kinematics> onBallisticsUpdate
    );

Allows you to pass custom data for the Projectile, Environment, SimulationConfig, and callbacks data.

BallisticsProjectile - Public Fields

public Projectile Projectile;
public Environment Environment;
public SimulationConfig SimulationConfig;

These automatically return the contents of the corresponding ScriptableObject provided via the inspector.

BallisticsProjectile - Protected Fields

protected System.Action<BallisticsHitData> onBallisticsComplete;
protected System.Action<Kinematics> onBallisticsUpdate;
protected ProjectileSO projectileSO;
protected EnvironmentSO environmentSO;
protected SimulationConfigSO simulationStateSO;

BallisticsCore - Public Methods

Predict

Declaration

public static BallisticsPrediction Predict(
    Projectile projectile, 
    Environment environment, 
    SimulationConfig simulationConfig
    );

Usage

public Projectile projectile;
public Environment environment;
Public SimulationConfig simulationConfig;
 
public void Update()
{
    BallisticsPrediction.Predict(projectile, environment, simulationConfig);
}

BallisticsPrediction - Class Definition

public BallisticsHitData BallisticsHitData;
public List<Kinematics> Kinematics;

BallisticsHitData - Class Definition

Provides more information about the final state of the simulated projectile.

public bool DidHit;
public RaycastHit HitInfo;
public Projectile Projectile;
public Details Details;

Details - Class Definition

Offers even more information about the hit event

public float TimeInFlight;
public float SpeedAtImpact;
public float KineticEnergyAtImpact;