pub struct Muscle {
pub name: String,
pub joint_name: String,
pub max_flex_angle: f32,
pub bulge_amplitude: f32,
pub influences: Vec<(u32, f32)>,
pub bulge_direction: BulgeDirection,
}Expand description
A muscle definition: a named region that bulges when a joint flexes
Fields§
§name: String§joint_name: StringWhich joint drives this muscle
max_flex_angle: f32Flex angle that produces maximum bulge (radians, e.g., PI/2)
bulge_amplitude: f32Peak bulge amplitude (world units)
influences: Vec<(u32, f32)>Vertex influences: (vertex_index, weight 0..1)
bulge_direction: BulgeDirectionDirection of bulge per influenced vertex (outward normal override)
Implementations§
Source§impl Muscle
impl Muscle
pub fn new(name: impl Into<String>, joint_name: impl Into<String>) -> Self
pub fn with_influences(self, influences: Vec<(u32, f32)>) -> Self
pub fn with_amplitude(self, amp: f32) -> Self
pub fn with_max_flex(self, angle: f32) -> Self
Sourcepub fn bulge_weight(&self, joint_angle: f32) -> f32
pub fn bulge_weight(&self, joint_angle: f32) -> f32
Compute bulge weight [0,1] from joint angle using smoothstep
Auto Trait Implementations§
impl Freeze for Muscle
impl RefUnwindSafe for Muscle
impl Send for Muscle
impl Sync for Muscle
impl Unpin for Muscle
impl UnsafeUnpin for Muscle
impl UnwindSafe for Muscle
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