ballistics_calculate_trajectory

Function ballistics_calculate_trajectory 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ballistics_calculate_trajectory( inputs: *const FFIBallisticInputs, wind: *const FFIWindConditions, atmosphere: *const FFIAtmosphericConditions, max_range: c_double, step_size: c_double, ) -> *mut FFITrajectoryResult
Expand description

Calculate a trajectory through the C ABI.

step_size is expressed in milliseconds and must be finite and at least MIN_FFI_STEP_SIZE_MS. This boundary contract is validated for every solver mode, although adaptive RK45 chooses its integration steps internally. Invalid values return null without starting a solve. A solve that would exceed crate::MAX_TRAJECTORY_POINTS also returns null; an enabled sampling grid above crate::MAX_TRAJECTORY_SAMPLES does likewise. Callers can increase step_size, reduce max_range, or select adaptive RK45.

ยงSafety

inputs may be null, in which case this function returns null. When non-null, it must point to a valid, properly aligned FFIBallisticInputs that remains readable and is not mutated for the duration of this call. wind and atmosphere may also be null; each non-null pointer has the same requirements for its corresponding type. The returned pointer, when non-null, must be released exactly once with ballistics_free_trajectory_result.