pub struct FacsMapper { /* private fields */ }Expand description
Maps FACS Action Units to morph-target weights.
Each AU can influence one or more named morph targets with a configurable
weight at full (1.0) intensity. The Self::evaluate method scales each
morph contribution by the AU intensity and accumulates the results.
Implementations§
Source§impl FacsMapper
impl FacsMapper
Sourcepub fn add_mapping(
&mut self,
au: ActionUnit,
morph: impl Into<String>,
weight: f32,
)
pub fn add_mapping( &mut self, au: ActionUnit, morph: impl Into<String>, weight: f32, )
Register a morph target for the given AU.
weight is the morph-target weight applied when the AU has intensity
1.0. Multiple calls for the same AU accumulate additional mappings.
Sourcepub fn mappings_for(&self, au: &ActionUnit) -> &[(String, f32)]
pub fn mappings_for(&self, au: &ActionUnit) -> &[(String, f32)]
Return the list of (morph_name, weight) pairs registered for au.
Sourcepub fn evaluate(&self, state: &FacsState) -> HashMap<String, f32>
pub fn evaluate(&self, state: &FacsState) -> HashMap<String, f32>
Convert a FacsState into a flat map of morph-target weights.
For each active AU, each associated morph target receives a contribution
of intensity × weight_at_full. When multiple AUs influence the same
morph target, contributions are summed and clamped to [0.0, 1.0].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FacsMapper
impl RefUnwindSafe for FacsMapper
impl Send for FacsMapper
impl Sync for FacsMapper
impl Unpin for FacsMapper
impl UnsafeUnpin for FacsMapper
impl UnwindSafe for FacsMapper
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
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>
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>
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