BcLibCFFIBindings class

Bindings for the bclibc ballistics engine C API.

Regenerate bindings with dart run ffigen --config ffigen.yaml.

Constructors

BcLibCFFIBindings(DynamicLibrary dynamicLibrary)
The symbols are looked up in dynamicLibrary.
BcLibCFFIBindings.fromLookup(Pointer<T> lookup<T extends NativeType>(String symbolName))
The symbols are looked up with lookup.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

BCLIBCFFI_calculate_energy(double bullet_weight_grain, double velocity_fps) double
Kinetic energy (ft-lb) from bullet weight (grains) and velocity (fps).
BCLIBCFFI_calculate_ogw(double bullet_weight_grain, double velocity_fps) double
Optimal Game Weight from bullet weight (grains) and velocity (fps).
BCLIBCFFI_find_apex(Pointer<BCLIBCFFI_ShotProps> props, Pointer<BCLIBCFFI_TrajectoryData> out, Pointer<BCLIBCFFI_Error> err) int
Find the apex (highest point) of the trajectory. @return BCLIBCFFI_OK on success, error code otherwise (fills *err).
BCLIBCFFI_find_apex_shot(Pointer<BCLIBCFFI_Shot> shot, Pointer<BCLIBCFFI_TrajectoryData> out, Pointer<BCLIBCFFI_Error> err) int
Find the apex of the trajectory. All physics/unit conversion is performed inside C++ via BCLIBCFFI_Shot::to_shot_props().
BCLIBCFFI_find_max_range(Pointer<BCLIBCFFI_ShotProps> props, double low_angle_deg, double high_angle_deg, Pointer<BCLIBCFFI_MaxRangeResult> out, Pointer<BCLIBCFFI_Error> err) int
Find the maximum range and corresponding angle. @param low_angle_deg Lower search bound (degrees). @param high_angle_deg Upper search bound (degrees).
BCLIBCFFI_find_max_range_shot(Pointer<BCLIBCFFI_Shot> shot, double low_angle_deg, double high_angle_deg, Pointer<BCLIBCFFI_MaxRangeResult> out, Pointer<BCLIBCFFI_Error> err) int
BCLIBCFFI_find_zero_angle(Pointer<BCLIBCFFI_ShotProps> props, double distance_ft, Pointer<Double> out_angle_rad, Pointer<BCLIBCFFI_Error> err) int
Find the barrel elevation angle to zero at the given distance. @param distance_ft Slant distance to target (ft). @param out_angle_rad Output: barrel elevation (radians).
BCLIBCFFI_find_zero_angle_shot(Pointer<BCLIBCFFI_Shot> shot, double distance_ft, Pointer<Double> out_angle_rad, Pointer<BCLIBCFFI_Error> err) int
BCLIBCFFI_free_trajectory(Pointer<BCLIBCFFI_TrajectoryData> records) → void
Free a trajectory array allocated by BCLIBCFFI_integrate().
BCLIBCFFI_get_correction(double distance_ft, double offset_ft) double
Angular correction (radians) to hit target at distance with given offset.
BCLIBCFFI_get_layout(Pointer<Int32> out, int out_len) int
Fills out with byte sizes/offsets for every BCLIBCFFI_Shot-family struct field consumed by a hand-written (non-Embind) JS/wasm binding, computed via sizeof()/offsetof() by whichever compiler builds this library — so a JS-side binding never has to hardcode/guess struct layout. See bclibc_ffi.cpp for the fixed field order this fills.
BCLIBCFFI_get_version() Pointer<Char>
@brief Returns the library version string.
BCLIBCFFI_integrate(Pointer<BCLIBCFFI_ShotProps> props, Pointer<BCLIBCFFI_TrajectoryRequest> request, Pointer<Pointer<BCLIBCFFI_TrajectoryData>> out_records, Pointer<Int32> out_count, Pointer<Int32> out_reason, Pointer<BCLIBCFFI_Error> err) int
Integrate trajectory and return filtered records.
BCLIBCFFI_integrate_at(Pointer<BCLIBCFFI_ShotProps> props, int key, double target_value, Pointer<BCLIBCFFI_Interception> out, Pointer<BCLIBCFFI_Error> err) int
Integrate and interpolate the single point where a key field reaches the target value. @param key BCLIBCFFI_BaseTrajInterpKey @param target_value Value the key field must reach.
BCLIBCFFI_integrate_at_shot(Pointer<BCLIBCFFI_Shot> shot, int key, double target_value, Pointer<BCLIBCFFI_Interception> out, Pointer<BCLIBCFFI_Error> err) int
BCLIBCFFI_integrate_shot(Pointer<BCLIBCFFI_Shot> shot, Pointer<BCLIBCFFI_TrajectoryRequest> request, Pointer<Pointer<BCLIBCFFI_TrajectoryData>> out_records, Pointer<Int32> out_count, Pointer<Int32> out_reason, Pointer<BCLIBCFFI_Error> err) int
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited