ballistics-engine 0.23.0 → 0.25.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ec34ab4bdd56332259b3194f81201b960cfb222524599d5fea2dfd3e625696f
4
- data.tar.gz: 162e799cd63a05c3dbb482867dcf189b39cb9cac4adc176422f7738ae3160c8c
3
+ metadata.gz: fff50b7cd64242555fc39ec2045160a23698f765b1e30c878a7f5d248802ae6e
4
+ data.tar.gz: 7249aed24f1640c0c31fc67bef331379b81ff39569b536d3a5132353b540021c
5
5
  SHA512:
6
- metadata.gz: bfd13d22a449ca9190e0d661a0e4fd8c151e28bee2135d44ff648ba0717e7676ff21807b448d787205b64de295ca23d8b9ece5b847c2a611021bc366661e1729
7
- data.tar.gz: aebf742f19ba2e1134dfd9e755d2ef21cf6c5724a82398898a425792f5b1ddee9f69ec3b35509685c3b74f816fe212594fec72b7e06a86337aa66d41185c2a48
6
+ metadata.gz: b60b9cbd6bacb4d09b0843777d74fd4e0f51e77adfdd646e67ea6e30fb1dc5010a5e4ed4624af7860be60c01b7a3ba7ec265978c99f8c1281e3e8c660fd8bd92
7
+ data.tar.gz: a3bf393b386fbc90a08db009bdeaa9ad6d17abcddb6a6b884dc616d7b295f301d51de6a72bb7ff24ed8a3912c0ca4d9c6e93723b4434b3ddf8834d2ee2448b58
data/Cargo.lock CHANGED
@@ -93,9 +93,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
93
93
 
94
94
  [[package]]
95
95
  name = "ballistics-engine"
96
- version = "0.22.11"
96
+ version = "0.25.0"
97
97
  source = "registry+https://github.com/rust-lang/crates.io-index"
98
- checksum = "76e5814dcee860b6d400ef5bd432833afad4750328ab3666befe73fa2fe0eae4"
98
+ checksum = "a4c2f0aba5a49af6d972cde5402161dd6f4c77eb9b8ab491e828f8cf1fc7d3c5"
99
99
  dependencies = [
100
100
  "clap",
101
101
  "clap_complete",
data/Cargo.toml CHANGED
@@ -15,7 +15,7 @@ name = "ballistics_engine_rb"
15
15
  crate-type = ["cdylib"]
16
16
 
17
17
  [dependencies]
18
- ballistics-engine = { version = "0.23.0", default-features = false }
18
+ ballistics-engine = { version = "0.25.0", default-features = false }
19
19
  magnus = "0.8"
20
20
 
21
21
  [profile.release]
@@ -4,7 +4,7 @@ require "ballistics_engine_rb"
4
4
 
5
5
  # Top-level module for the BallisticsEngine gem
6
6
  module BallisticsEngine
7
- VERSION = "0.23.0"
7
+ VERSION = "0.25.0"
8
8
 
9
9
  class Error < StandardError; end
10
10
  end
data/src/lib.rs CHANGED
@@ -3,6 +3,7 @@ use ballistics_engine::{
3
3
  AtmosphericConditions, BCSegmentData, BallisticInputs, DragModel, MonteCarloParams,
4
4
  TrajectorySolver, WindConditions, calculate_zero_angle_with_conditions, run_monte_carlo,
5
5
  };
6
+ use ballistics_engine::wind::WindSegment;
6
7
 
7
8
  // Unit conversion constants
8
9
  const GRAINS_TO_KG: f64 = 0.00006479891;
@@ -49,12 +50,12 @@ fn build_wind(h: &RHash) -> Result<WindConditions, Error> {
49
50
  Ok(WindConditions {
50
51
  speed: opt_f64(&w, "speed_mph", 0.0)? * MPH_TO_MPS,
51
52
  direction: opt_f64(&w, "direction_degrees", 0.0)? * DEGREES_TO_RADIANS,
53
+ // ballistics-engine 0.24.0 added vertical_speed (MBA-728); the Ruby `wind`
54
+ // sub-hash has no vertical-wind key yet, so leave it at the engine default (0.0).
55
+ ..Default::default()
52
56
  })
53
57
  } else {
54
- Ok(WindConditions {
55
- speed: 0.0,
56
- direction: 0.0,
57
- })
58
+ Ok(WindConditions::default())
58
59
  }
59
60
  }
60
61
 
@@ -119,12 +120,18 @@ fn extract_bc_segments_data(h: &RHash) -> Result<Vec<BCSegmentData>, Error> {
119
120
  Ok(out)
120
121
  }
121
122
 
122
- /// `wind_segments` = array of [speed_mph, angle_degrees, until_yards] -> (km/h, deg, meters).
123
- fn extract_wind_segments(h: &RHash) -> Result<Vec<(f64, f64, f64)>, Error> {
123
+ /// `wind_segments` = array of [speed_mph, angle_degrees, until_yards] -> engine
124
+ /// `WindSegment` (km/h, deg, meters). ballistics-engine 0.24.0 converted `WindSock` /
125
+ /// `TrajectorySolver::set_wind_segments` from `(f64, f64, f64)` tuples to this named
126
+ /// struct; keep the Ruby-facing arrays as plain 3-number triples and convert at the
127
+ /// boundary via `WindSegment::new`.
128
+ fn extract_wind_segments(h: &RHash) -> Result<Vec<WindSegment>, Error> {
124
129
  match h.lookup::<_, Option<Vec<(f64, f64, f64)>>>("wind_segments")? {
125
130
  Some(v) => Ok(v
126
131
  .into_iter()
127
- .map(|(mph, ang, until_yd)| (mph * MPH_TO_KMH, ang, until_yd * YARDS_TO_METERS))
132
+ .map(|(mph, ang, until_yd)| {
133
+ WindSegment::new(mph * MPH_TO_KMH, ang, until_yd * YARDS_TO_METERS)
134
+ })
128
135
  .collect()),
129
136
  None => Ok(Vec::new()),
130
137
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ballistics-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Jokela
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-13 00:00:00.000000000 Z
11
+ date: 2026-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.5.3
96
+ rubygems_version: 3.3.15
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: High-performance ballistics calculations engine