pub struct BallisticForces { /* private fields */ }Expand description
Gravity and aerodynamic drag delegated to ballistics-engine’s force kernel.
Implementations§
Source§impl BallisticForces
impl BallisticForces
Sourcepub fn new(
diameter_m: f64,
cd_vs_mach: Vec<(f64, f64)>,
atmosphere: Atmosphere,
wind_mps: Vec3,
) -> Result<Self>
pub fn new( diameter_m: f64, cd_vs_mach: Vec<(f64, f64)>, atmosphere: Atmosphere, wind_mps: Vec3, ) -> Result<Self>
Build using the vehicle’s actual Cd curve, not a G-model reference curve or BC. At least two ascending, nonnegative Mach values and positive Cd values are required. Wind is a world-frame air velocity vector (positive X is a tailwind).
Sourcepub fn with_drag_scale(self, scale: f64) -> Result<Self>
pub fn with_drag_scale(self, scale: f64) -> Result<Self>
Apply a positive multiplier to the entire Cd curve. Default is 1.0.
Sourcepub fn set_wind(&mut self, wind_mps: Vec3) -> Result<()>
pub fn set_wind(&mut self, wind_mps: Vec3) -> Result<()>
Change uniform world-frame wind between public integration steps.
Sourcepub fn acceleration_in_wind(
&self,
state: &FlightState,
mass_kg: f64,
wind_mps: Vec3,
) -> Result<Vec3>
pub fn acceleration_in_wind( &self, state: &FlightState, mass_kg: f64, wind_mps: Vec3, ) -> Result<Vec3>
Evaluate using externally sampled wind, for a spatial or time-varying force wrapper.
Trait Implementations§
Source§impl Clone for BallisticForces
impl Clone for BallisticForces
Source§impl Debug for BallisticForces
impl Debug for BallisticForces
Source§impl ForceModel for BallisticForces
impl ForceModel for BallisticForces
Source§fn acceleration(&self, state: &FlightState, mass_kg: f64) -> Result<Vec3>
fn acceleration(&self, state: &FlightState, mass_kg: f64) -> Result<Vec3>
Acceleration in world-frame metres per second squared.
Auto Trait Implementations§
impl Freeze for BallisticForces
impl RefUnwindSafe for BallisticForces
impl Send for BallisticForces
impl Sync for BallisticForces
impl Unpin for BallisticForces
impl UnsafeUnpin for BallisticForces
impl UnwindSafe for BallisticForces
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.