pub struct RifleV1 {
pub muzzle_velocity_mps: f64,
pub sight_height_m: Option<f64>,
pub muzzle_height_m: Option<f64>,
pub twist_rate_m_per_turn: Option<f64>,
pub twist_direction: Option<TwistDirectionV1>,
pub sight_offset_lateral_m: Option<f64>,
}Expand description
Rifle and sight geometry.
Fields§
§muzzle_velocity_mps: f64§sight_height_m: Option<f64>§muzzle_height_m: Option<f64>§twist_rate_m_per_turn: Option<f64>Rifling travel per full turn, meters.
Optional, which reads like “leave the twist out of it” — it is not. None defaults to
0.3048 m, exactly 1:12 inches, raises a default_applied assumption, and materializes
that value at ResolvedRifleV1::twist_rate_m_per_turn, after which nothing
downstream can tell an assumed barrel from a stated one.
Omitting it is never free. summary.stability_factor is a function of the twist and is
computed on EVERY solve, so an omitted field reports the Sg of a 1:12 barrel — 1.665 on
a .308 175 gr against 3.746 at a stated 1:8, with no effect enabled — and raises
stability_factor_assumed_twist_rate. What the omission does not move, absent a
spin-driven effect, is the trajectory: drop_m and windage_m are bit-identical for
every twist rate.
effects.magnus, effects.enhanced_spin_drift and effects.aerodynamic_jump each
read it as well, and each raises its own assumed-barrel warning when it is absent
(MBA-1484). The codes are distinct so that each names its own consumer; they are not
mutually exclusive, and one omitted twist can raise three of them at once.
twist_direction: Option<TwistDirectionV1>Rifling hand, viewed from the breech toward the muzzle. None defaults to Right
with a default_applied assumption. It flips the SIGN of the gyroscopic spin drift
rather than its magnitude, so an assumed hand on a left-twist barrel puts the drift on
the wrong side of the target.
sight_offset_lateral_m: Option<f64>Lateral offset between the sight axis and the bore axis, meters (MBA-1396,
offset-mounted optics): positive = the sight sits RIGHT of the bore. The bore
starts that far left of the line of sight, and a solved zero adds the windage
convergence (offset / zero_distance) so the trajectory crosses the LOS laterally
at the zero range. Omitted (the default) is byte-identical to pre-MBA-1396
behavior. Echoed at ResolvedRifleV1::sight_offset_lateral_m when supplied
(0.33.0 decision-support Task 1).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RifleV1
impl<'de> Deserialize<'de> for RifleV1
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for RifleV1
Auto Trait Implementations§
impl Freeze for RifleV1
impl RefUnwindSafe for RifleV1
impl Send for RifleV1
impl Sync for RifleV1
impl Unpin for RifleV1
impl UnsafeUnpin for RifleV1
impl UnwindSafe for RifleV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.