pub struct HardStop {
pub stiffness: f64,
pub damping: f64,
}Expand description
End stops of an axis whose stroke runs from 0 to stroke: a spring and a damper at both ends that act
only beyond it.
Fields§
§stiffness: f64§damping: f64Implementations§
Source§impl HardStop
impl HardStop
pub fn from_config(cfg: &Config) -> Result<Self, ConfigError>
Sourcepub fn force(&self, pos: f64, vel: f64, stroke: f64) -> f64
pub fn force(&self, pos: f64, vel: f64, stroke: f64) -> f64
Force of the stops on the axis. They push back, they never hold on.
pub fn energy(&self, pos: f64, stroke: f64) -> f64
Sourcepub fn met_within(&self, pos: f64, vel: f64, stroke: f64, dt: f64) -> bool
pub fn met_within(&self, pos: f64, vel: f64, stroke: f64, dt: f64) -> bool
Whether an axis at pos moving at vel meets a stop within a base step dt (s): in one already, or nearer to
the one it moves towards than STOP_REACH steps at its speed (STOP_SUBSTEPS). Never without stops.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HardStop
impl RefUnwindSafe for HardStop
impl Send for HardStop
impl Sync for HardStop
impl Unpin for HardStop
impl UnsafeUnpin for HardStop
impl UnwindSafe for HardStop
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