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_find_zero_point(
Pointer< BCLIBCFFI_ShotProps> props, double distance_ft, Pointer<BCLIBCFFI_ZeroPointResult> out, Pointer<BCLIBCFFI_Error> err) → int - @brief Find the lower zero and its terminal trajectory point.
-
BCLIBCFFI_find_zero_point_shot(
Pointer< BCLIBCFFI_Shot> shot, double distance_ft, Pointer<BCLIBCFFI_ZeroPointResult> out, Pointer<BCLIBCFFI_Error> err) → int - @brief Find the lower zero for a user-facing shot and its terminal point.
-
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
outwith 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_hermite(
double x, double xk, double xk1, double yk, double yk1, double mk, double mk1) → double - Cubic Hermite polynomial through (xk, yk) and (xk1, yk1) with slopes mk and mk1, at x.
-
BCLIBCFFI_integrate(
Pointer< BCLIBCFFI_ShotProps> props, Pointer<BCLIBCFFI_TrajectoryRequest> request, Pointer<Pointer< out_records, Pointer<BCLIBCFFI_TrajectoryData> >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< out_records, Pointer<BCLIBCFFI_TrajectoryData> >Int32> out_count, Pointer<Int32> out_reason, Pointer<BCLIBCFFI_Error> err) → int -
BCLIBCFFI_interpolate_2pt(
double x, double x0, double y0, double x1, double y1, Pointer< Double> out, Pointer<BCLIBCFFI_Error> err) → int - Linear interpolation at x between (x0, y0) and (x1, y1). @return BCLIBCFFI_OK, or BCLIBCFFI_ERR_GENERIC (fills *err) when x0 == x1.
-
BCLIBCFFI_interpolate_3pt(
double x, double x0, double x1, double x2, double y0, double y1, double y2) → double - PCHIP interpolation at x through three points (x0, y0), (x1, y1), (x2, y2).
-
BCLIBCFFI_interpolate_trajectory_data(
int key, double value, Pointer< BCLIBCFFI_TrajectoryData> t0, Pointer<BCLIBCFFI_TrajectoryData> t1, Pointer<BCLIBCFFI_TrajectoryData> t2, int flag, int method, Pointer<BCLIBCFFI_TrajectoryData> out, Pointer<BCLIBCFFI_Error> err) → int -
The point of a trajectory where the field
keyhas the valuevalue, interpolated from the three points around it (BCLIBC_TrajectoryData::interpolate): every field is interpolated, the key field is set tovalueandflag(BCLIBCFFI_TrajFlag) is the flag of the result. @param key BCLIBCFFI_TrajectoryInterpKey @param method BCLIBCFFI_InterpMethod @return BCLIBCFFI_OK, or an error code (fills *err), for example when two of the points have the same key. -
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