ballistics-engine 0.21.0 → 0.21.1
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.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: 7d0ae414493f4d57e6ec143f9922d5bcacf54b1224d3a0005d33a1571665552b
|
|
4
|
+
data.tar.gz: 6a42ad2c8356fd977f1493ab48f209fa5fe87567e9ec03bd57351c0fffd2e77d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef3d7c9cb52a886de09fd885ef48ef431da28a0056cca4e5a5415d8ffa496557b72803f3670247e2ea62c4561fc0ea071c7a578be12fd4c06740e0f313ac353f
|
|
7
|
+
data.tar.gz: 116af0d6133e4d69b88a1d38187179309d33e83460eab0b17d7e4404ae5c5108d1e2ddaa320833ecc43471ab8cd8364e9202856d5b97cffeafb57e404e08347f
|
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.1"
|
|
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.1", 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
|
|