pub struct MuscleState {
pub flex: f32,
pub contract: f32,
pub fatigue: f32,
}Expand description
Current activation state of a single muscle.
Fields§
§flex: f32Flex activation: 0 = relaxed, 1 = fully flexed.
contract: f32Contraction: 0 = rest length, 1 = fully contracted.
fatigue: f32Fatigue: 0 = fresh, 1 = fatigued (reduces output).
Implementations§
Source§impl MuscleState
impl MuscleState
Sourcepub fn effective_flex(&self) -> f32
pub fn effective_flex(&self) -> f32
Effective flex output considering fatigue attenuation.
Fatigue linearly reduces output: effective = flex * (1 - fatigue).
Sourcepub fn effective_contract(&self) -> f32
pub fn effective_contract(&self) -> f32
Effective contract output considering fatigue attenuation.
Trait Implementations§
Source§impl Clone for MuscleState
impl Clone for MuscleState
Source§fn clone(&self) -> MuscleState
fn clone(&self) -> MuscleState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MuscleState
impl Debug for MuscleState
Auto Trait Implementations§
impl Freeze for MuscleState
impl RefUnwindSafe for MuscleState
impl Send for MuscleState
impl Sync for MuscleState
impl Unpin for MuscleState
impl UnsafeUnpin for MuscleState
impl UnwindSafe for MuscleState
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more