ballistics-engine 0.21.0 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +3 -3
- data/Cargo.toml +2 -2
- data/src/lib.rs +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7f93de922ed86b6f8ff2080c663c5f81cb91a0f7d439c174e3eee52effca898
|
|
4
|
+
data.tar.gz: 0ba5ce2fef719a1498cd2826c70c37ec818100ed6964ea806f92b2d10ab69935
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75fda7b37ade653d483ed5a93eb96493feaa3ab52a7875dff9203a1c03bfc9c374374549311a52804745c46325888892055051a6ca2232d1ab988cfe564922b9
|
|
7
|
+
data.tar.gz: 82aa5fb82384eec07751fc21e97b506861ecbb53d0cad1bf6d62f020093a5c725e10f32260d22355f2d122d2d85b8d6ab84908782357a0c1b915cae851ba8278
|
data/Cargo.lock
CHANGED
|
@@ -93,9 +93,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|
|
93
93
|
|
|
94
94
|
[[package]]
|
|
95
95
|
name = "ballistics-engine"
|
|
96
|
-
version = "0.21.
|
|
96
|
+
version = "0.21.3"
|
|
97
97
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
98
|
-
checksum = "
|
|
98
|
+
checksum = "c5596fd91e235bc028fa8e71e9c64a5445b9f86d33e70b97f2e56e1f17011b7a"
|
|
99
99
|
dependencies = [
|
|
100
100
|
"clap",
|
|
101
101
|
"clap_complete",
|
|
@@ -121,7 +121,7 @@ dependencies = [
|
|
|
121
121
|
|
|
122
122
|
[[package]]
|
|
123
123
|
name = "ballistics_engine_rb"
|
|
124
|
-
version = "0.21.
|
|
124
|
+
version = "0.21.3"
|
|
125
125
|
dependencies = [
|
|
126
126
|
"ballistics-engine",
|
|
127
127
|
"magnus",
|
data/Cargo.toml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# rake-compiler/rb-sys cargo-metadata lookup resolves (newer rb-sys does not
|
|
4
4
|
# normalize hyphens). The published gem name is set in the gemspec, independent.
|
|
5
5
|
name = "ballistics_engine_rb"
|
|
6
|
-
version = "0.21.
|
|
6
|
+
version = "0.21.3"
|
|
7
7
|
edition = "2021"
|
|
8
8
|
authors = ["Alex Jokela <email@tinycomputers.io>"]
|
|
9
9
|
description = "Ruby bindings for ballistics-engine"
|
|
@@ -15,7 +15,7 @@ name = "ballistics_engine_rb"
|
|
|
15
15
|
crate-type = ["cdylib"]
|
|
16
16
|
|
|
17
17
|
[dependencies]
|
|
18
|
-
ballistics-engine = { version = "0.21.
|
|
18
|
+
ballistics-engine = { version = "0.21.3", default-features = false }
|
|
19
19
|
magnus = "0.8"
|
|
20
20
|
|
|
21
21
|
[profile.release]
|
data/src/lib.rs
CHANGED
|
@@ -28,6 +28,13 @@ fn solve_trajectory(ruby: &magnus::Ruby, inputs_hash: RHash) -> Result<RHash, Er
|
|
|
28
28
|
let is_right_twist: bool = inputs_hash.lookup2("is_right_twist", true)?;
|
|
29
29
|
let enable_aerodynamic_jump: bool = inputs_hash.lookup2("enable_aerodynamic_jump", false)?;
|
|
30
30
|
|
|
31
|
+
// Coriolis (Earth-rotation) inputs. Requires latitude_degrees to take effect; with
|
|
32
|
+
// enable_coriolis + a latitude, shot_direction_degrees (compass bearing, 0=N, 90=E)
|
|
33
|
+
// drives the lateral drift and the vertical Eotvos term (east lifts, west depresses).
|
|
34
|
+
let enable_coriolis: bool = inputs_hash.lookup2("enable_coriolis", false)?;
|
|
35
|
+
let latitude_degrees: Option<f64> = inputs_hash.lookup::<_, Option<f64>>("latitude_degrees")?;
|
|
36
|
+
let shot_direction_degrees: f64 = inputs_hash.lookup2("shot_direction_degrees", 0.0)?;
|
|
37
|
+
|
|
31
38
|
// Drag model (default to G7)
|
|
32
39
|
let drag_model_str: String = inputs_hash.lookup2("drag_model", "G7")?;
|
|
33
40
|
let drag_model = match drag_model_str.to_uppercase().as_str() {
|
|
@@ -53,6 +60,9 @@ fn solve_trajectory(ruby: &magnus::Ruby, inputs_hash: RHash) -> Result<RHash, Er
|
|
|
53
60
|
caliber_inches: bullet_diameter_inches,
|
|
54
61
|
weight_grains: bullet_weight_grains,
|
|
55
62
|
enable_aerodynamic_jump,
|
|
63
|
+
enable_coriolis,
|
|
64
|
+
latitude: latitude_degrees,
|
|
65
|
+
shot_azimuth: shot_direction_degrees * DEGREES_TO_RADIANS,
|
|
56
66
|
..Default::default()
|
|
57
67
|
};
|
|
58
68
|
|