pub struct AltitudeSwitch<Below, Above> { /* private fields */ }Expand description
Routes to one of two force models depending on altitude (position Y).
Use it to bound a dense-atmosphere model: at and below the cutoff, forces
come from e.g. BallisticForces; above it, from a vacuum model such as
UniformGravity or CentralGravity. The Y coordinate follows the
crate’s world-frame convention; with the ballistics adapter it is absolute
altitude above sea level.
Implementations§
Source§impl<Below, Above> AltitudeSwitch<Below, Above>
impl<Below, Above> AltitudeSwitch<Below, Above>
Trait Implementations§
Source§impl<Below: ForceModel, Above: ForceModel> ForceModel for AltitudeSwitch<Below, Above>
impl<Below: ForceModel, Above: ForceModel> ForceModel for AltitudeSwitch<Below, Above>
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.
Source§fn acceleration_with_axis(
&self,
state: &FlightState,
mass_kg: f64,
_body_axis: Vec3,
) -> Result<Vec3>
fn acceleration_with_axis( &self, state: &FlightState, mass_kg: f64, _body_axis: Vec3, ) -> Result<Vec3>
Acceleration when the commanded body axis is known, for angle-of-attack-aware
models (body lift, induced drag).
body_axis is the solver-resolved unit
thrust axis at this stage. The default ignores the axis, which keeps every
orientation-blind model (gravity, plain drag) bit-identical.Auto Trait Implementations§
impl<Below, Above> Freeze for AltitudeSwitch<Below, Above>
impl<Below, Above> RefUnwindSafe for AltitudeSwitch<Below, Above>where
Below: RefUnwindSafe,
Above: RefUnwindSafe,
impl<Below, Above> Send for AltitudeSwitch<Below, Above>
impl<Below, Above> Sync for AltitudeSwitch<Below, Above>
impl<Below, Above> Unpin for AltitudeSwitch<Below, Above>
impl<Below, Above> UnsafeUnpin for AltitudeSwitch<Below, Above>where
Below: UnsafeUnpin,
Above: UnsafeUnpin,
impl<Below, Above> UnwindSafe for AltitudeSwitch<Below, Above>where
Below: UnwindSafe,
Above: UnwindSafe,
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.