pub struct MuscleDefinition {
pub name: String,
pub group: MuscleGroup,
pub flex_morphs: Vec<(String, f32)>,
pub contract_morphs: Vec<(String, f32)>,
pub symmetrical: bool,
pub side: Option<Side>,
pub rest_length: f32,
}Expand description
A named muscle definition that drives one or more morph targets.
Fields§
§name: StringUnique name for this muscle (e.g. “bicep_left”).
group: MuscleGroupAnatomical group this muscle belongs to.
flex_morphs: Vec<(String, f32)>Morph targets driven when this muscle flexes (0 = relaxed, 1 = full flex).
Each entry is (morph_name, max_weight).
contract_morphs: Vec<(String, f32)>Morph targets driven when contracted (e.g., shortened).
symmetrical: boolIf true, this muscle has a left/right counterpart.
side: Option<Side>Which side this muscle is on, if applicable.
rest_length: f32Reference length in normalised units (0..1).
Implementations§
Source§impl MuscleDefinition
impl MuscleDefinition
Sourcepub fn new(name: impl Into<String>, group: MuscleGroup) -> Self
pub fn new(name: impl Into<String>, group: MuscleGroup) -> Self
Convenience constructor.
Sourcepub fn with_flex_morph(self, morph: impl Into<String>, max_weight: f32) -> Self
pub fn with_flex_morph(self, morph: impl Into<String>, max_weight: f32) -> Self
Builder: add a flex morph.
Sourcepub fn with_contract_morph(
self,
morph: impl Into<String>,
max_weight: f32,
) -> Self
pub fn with_contract_morph( self, morph: impl Into<String>, max_weight: f32, ) -> Self
Builder: add a contract morph.
Sourcepub fn with_rest_length(self, length: f32) -> Self
pub fn with_rest_length(self, length: f32) -> Self
Builder: set rest length.
Auto Trait Implementations§
impl Freeze for MuscleDefinition
impl RefUnwindSafe for MuscleDefinition
impl Send for MuscleDefinition
impl Sync for MuscleDefinition
impl Unpin for MuscleDefinition
impl UnsafeUnpin for MuscleDefinition
impl UnwindSafe for MuscleDefinition
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> 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